Clark's Home page

Tecnicismi vari di un Sysadmin Linux ma anche qualcosa della sua vita

Networking su Devuan 5 per ambiente di test con XEN —

La parte di networking è stata senza dubbio la più complessa.
l’inizio è stato “legare” i mac delle schede di rete al nome eth delle interfacce, il primo passo che deve essere eseguito in sequenza su ambo i nodi è installare con apt i pacchetti ifrename bridge-utils ifensalve rispettivamente per creare iftab dove linkare mac a eth, creare le interfacce xenbrx necessarie, creare le interfacce bond necessarie.
Linkare mac a nome interfaccia sarebbe possibile anzi senza condizionale è possibile tramite eudev (l’udev senza systemd) ma è una cosa più complessa che usare iftab.
/etc/iftab nel caso in esame è un semplice file di testo simile a questo:
eth0    mac     00:0a:f7:c0:be:b4
eth1    mac     00:0a:f7:c0:be:b5
eth2    mac     b4:45:06:f7:db:86
eth3    mac     b4:45:06:f7:db:87
eth4    mac     a0:36:9f:7c:40:d0
eth5    mac     a0:36:9f:7c:40:d2
eth6    mac     a0:36:9f:7c:39:a8
eth7    mac     a0:36:9f:7c:39:aa
In questo modo c’è la certezza che le eth mantengano il nome, non mi è mai successo che cambiassero nome, ma se hanno messo in piedi una simile situazione vuol dire che il rischi è concreto quindi prima di fare danni lo uso.
Una volta definita questa questione modificare il file /etc/network/interfaces in questo modo:

# The loopback network interface
auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet manual

allow-hotplug eth1
iface eth1 inet manual

allow-hotplug eth2
iface eth2 inet manual

allow-hotplug eth3
iface eth3 inet manual

allow-hotplug eth4
iface eth4 inet manual
bond-master bond0

allow-hotplug eth5
iface eth5 inet manual
bond-master bond0

allow-hotplug  eth6
iface eth6 inet manual
bond-master bond1

allow-hotplug eth7
iface eth7 inet manual
bond-master bond1

### interfaccia di rete LAN
auto xenbr0
iface xenbr0 inet static
address 192.168.2.245
netmask 255.255.254.0
network 192.168.2.0
broadcast 192.168.3.255
gateway 192.168.2.241
bridge_ports eth0
bridge_waitport 0
bridge_fd 0
bridge_maxwait 0
bridge_stp off
#### interfaccia firewall virtuali
auto xenbr1
iface xenbr1 inet manual
bridge_ports eth1
bridge_waitport 0
bridge_fd 0
bridge_maxwait 0
bridge_stp off

#### interfaccia DMZ
auto xenbr2
iface xenbr2 inet static
address 192.168.200.245
netmask 255.255.255.0
network 192.168.200.0
broadcast 192.168.200.255
bridge_ports eth2
bridge_waitports 0
bridge_fd 0
bridge_maxwait 0
bridge_stp off

auto bond0
iface bond0 inet static
address 172.18.19.245
netmask 255.255.255.0
network 172.18.19.0
broadcast 172.18.19.255
bond-slaves eth4 eth5
bond-mode 0
bond-miimon 100
bond-updelay 200
bond-downdelay 200
mtu 9000
#
auto bond1
iface bond1 inet static
address 172.19.19.245
netmask 255.255.255.0
network 172.19.19.0
broadcast 172.19.19.255
bond-slaves eth6 eth7
bond-mode 0
bond-miimon 100
bond-updelay 200
bond-downdelay 200
mtu 9000

Chiaramente sull’altro nodo gli IP sono uguali a meno dell’ultimo ottetto che è .246

in /etc/sysctl.d/ creiamo il file 10G.conf che contiene:
net.ipv4.tcp_congestion_control=cubic
net.core.somaxconn = 1000
net.core.netdev_max_backlog = 300000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_max_syn_backlog = 8096
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_mtu_probing=1
net.ipv4.route.flush = 1
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_fin_timeout=15
net.ipv4.tcp_sack=0
net.ipv4.tcp_moderate_rcvbuf=1
vm.vfs_cache_pressure=50

modprobe tcp_cubic e inserire anche in /etc/modules per caricarlo ai successivi riavvii.

Rieditare /etc/rc.local e aggiungere:
### eth 10gb tuning
ifconfig eth4 txqueuelen 300000
ifconfig eth4 mtu 9000
ethtool -K eth4 rx on
ethtool -K eth4 tx on
ethtool -K eth4 sg on
ethtool -K eth4 tso on
ethtool -K eth4 gso on
ethtool -K eth4 gro off
###
ifconfig eth5 txqueuelen 300000
ifconfig eth5 mtu 9000
ethtool -K eth5 rx on
ethtool -K eth5 tx on
ethtool -K eth5 sg on
ethtool -K eth5 tso on
ethtool -K eth5 gso on
ethtool -K eth5 gro off
####
ifconfig eth6 txqueuelen 300000
ifconfig eth6 mtu 9000
ethtool -K eth6 rx on
ethtool -K eth6 tx on
ethtool -K eth6 sg on
ethtool -K eth6 tso on
ethtool -K eth6 gso on
ethtool -K eth6 gro off
###
ifconfig eth7 txqueuelen 300000
ifconfig eth7 mtu 9000
ethtool -K eth7 rx on
ethtool -K eth7 tx on
ethtool -K eth7 sg on
ethtool -K eth7 tso on
ethtool -K eth7 gso on
ethtool -K eth7 gro off
La parte di networking è configurata

fonte https://doc.tranquil.it/xenserver_xcp-ng/xcpng-config/install-xcpng-drbd.html

back          home          next


Categorised as: Linux | Networking | Sistemi operativi | Work

Comments are disabled on this post


Comments are closed.


Hide picture