Home > Linux, Ubuntu, Virtualizzazione > Bridges su server di virtualizzazione kvm qemu

Bridges su server di virtualizzazione kvm qemu

Impostazione doppio bridge su server di virtualizzazione kvm qemu ubuntu in ambito domestico .

HP NC382T PCI Express Dual Port Multifunction Gigabit Server Adapter (458492-B21) -Impostazione delle tre porte  di rete:

  • eth0 integrata realtek
  • eth1  HP  NC382T
  • eth2 HP   NC382T

File /etc/network/iterfaces

:~$ cat /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary on board nic
auto eth0 
# iface eth0 inet dhcp   
iface eth0 inet static
 address 192.168.1.161
 netmask 255.255.255.0
 broadcast 192.168.1.255
 network 192.168.1.0
 gateway 192.168.1.254
 dns-nameservers 8.8.8.8 61.101.93.101 85.37.17.14

# The eth1 left HP dual board primary  network interface
auto eth1
iface eth1 inet manual

auto br1 
iface br1 inet static
 address 192.168.67.160
 network 192.168.67.0
 netmask 255.255.255.0
 broadcast 192.168.67.255
# gateway 192.168.67.1
 bridge_ports eth1
 bridge_stp off
 bridge_fd 0
 bridge_maxwait 0
# dns-nameservers 85.37.17.14 85.38.28.78 8.8.8.8

# The eth2 right HP dual port nic
auto eth2
#iface eth2 inet dhcp
iface eth2 inet manual

auto br2 
iface br2 inet static  
 address 192.168.1.160
 network 192.168.1.0
 netmask 255.255.255.0
 broadcast 192.168.1.255 
 gateway 192.168.1.254
 bridge_ports eth2
 bridge_stp off
 bridge_fd 0
 bridge_maxwait 0
 # dns-nameservers 61.101.93.101 83.103.25.250 8.8.8.8

Impostatazione risultante delle porte di rete con ifconfig:

:~$ ifconfig
br1       Link encap:Ethernet  HWaddr ac:16:2d:c2:bf:b0  
          inet addr:192.168.67.160  Bcast:192.168.67.255  Mask:255.255.255.0
          inet6 addr: fe80::ae16:2dff:fec2:bfb0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:71750 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1328 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8513102 (8.5 MB)  TX bytes:134757 (134.7 KB)

br2       Link encap:Ethernet  HWaddr ac:16:2d:c2:bf:b2  
          inet addr:192.168.1.160  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ae16:2dff:fec2:bfb2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:52931 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18593 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7694979 (7.6 MB)  TX bytes:781446 (781.4 KB)

eth0      Link encap:Ethernet  HWaddr 90:2b:34:a8:43:f7  
          inet addr:192.168.1.161  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::922b:34ff:fea8:43f7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1480373 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2574286 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:119896407 (119.8 MB)  TX bytes:3039995108 (3.0 GB)

eth1      Link encap:Ethernet  HWaddr ac:16:2d:c2:bf:b0  
          inet6 addr: fe80::ae16:2dff:fec2:bfb0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3598708 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12491199 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:643806892 (643.8 MB)  TX bytes:16984776801 (16.9 GB)

eth2      Link encap:Ethernet  HWaddr ac:16:2d:c2:bf:b2  
          inet6 addr: fe80::ae16:2dff:fec2:bfb2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:83979 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24852 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:25307687 (25.3 MB)  TX bytes:2064289 (2.0 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4245672 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4245672 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:6966004595 (6.9 GB)  TX bytes:6966004595 (6.9 GB)

virbr0    Link encap:Ethernet  HWaddr fe:54:00:74:ab:cc  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:247 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:37549 (37.5 KB)  TX bytes:47897 (47.8 KB)

vnet0     Link encap:Ethernet  HWaddr fe:54:00:38:ba:0d  
          inet6 addr: fe80::fc54:ff:fe38:ba0d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3049011 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3490305 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:16309005764 (16.3 GB)  TX bytes:513720532 (513.7 MB)

vnet1     Link encap:Ethernet  HWaddr fe:54:00:89:0d:a9  
          inet6 addr: fe80::fc54:ff:fe89:da9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3914 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18612 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:1365381 (1.3 MB)  TX bytes:2133097 (2.1 MB)

vnet2     Link encap:Ethernet  HWaddr fe:54:00:bb:f6:ed  
          inet6 addr: fe80::fc54:ff:febb:f6ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6097 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10878 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:819235 (819.2 KB)  TX bytes:7984953 (7.9 MB)

vnet3     Link encap:Ethernet  HWaddr fe:54:00:74:ab:cc  
          inet6 addr: fe80::fc54:ff:fe74:abcc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:264 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8337 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:29599 (29.5 KB)  TX bytes:446597 (446.5 KB)

Schede di rete a disposizione in KVM in questo caso.

KVM-virtual network device

KVM virtual network device available

Impostando il bridge2 come source device è possible assegnare al nic virtuale della VM anche indirizzi della classe relativa primo bridge,in questo caso 192.168.67.xxx, che vengono però correttamente instradati verso il gateway della seconda porta 192.168.1.xxx.

KVM-virt-manager-VM-bridge2

KVM-virt-manager VM con eth1 using bridge2 -vrtio

KVM-VM-ip-bridge2-class-eth1

KVM-VM con nic bridge2 using class bridge1 server eth1

KVM- eth2 bridge2 firefox

KVM-  bridge2  using ip class bridge1 firefox

Altrettando dicasi per il caso del bridge1 è possibile utlizzare anche la classe della eth2.

Unica avvertenza indicare comunque il gateway della sottorete scelta e se possibile i dns di google 8.8.8.8. Diversamente impostare i dns relativi al bridge della porta e sottorete specifica.

riavviare il servizio di networking con

sudo service networking restart
o
sudo service networking --full-restart
o
sudo /etc/init.d/networking restart

Risorse:

Advertisements
  1. Non c'è ancora nessun commento.
  1. No trackbacks yet.

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...

%d blogger hanno fatto clic su Mi Piace per questo: