Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rb:ubuntunetwork [07/09/2018 19:38] (current)
andrew created
Line 1: Line 1:
 +====== Ubuntu Network Config ======
  
 +
 +Ubuntu uses ''/​etc/​network/​interfaces''​ for all the network definitions.
 +
 +===== Static =====
 +
 +<​code>​
 +# The primary network interface
 +auto eth0
 +iface eth0 inet static
 +        address 192.168.110.16
 +        netmask 255.255.255.0
 +        network 192.168.110.0
 +        broadcast 192.168.110.255
 +        gateway 192.168.110.1
 +        # dns-* options are implemented by the resolvconf package, if installed
 +        dns-nameservers 192.168.1.10 192.168.1.11
 +        dns-search example.com
 +</​code>​
 +
 +===== DHCP =====
 +
 +<​code>​
 +# The primary network interface
 +auto eth1
 +iface eth1 inet dhcp
 +</​code>​
 +
 +
 +===== Bonding =====
 +
 +<​code>​
 +# The primary network interface ​
 +auto bond0               
 + iface bond0 inet static ​       ​
 + ​bond-mode active-backup
 +
 +Also
 + ​bond-mode broadcast
 +
 + ​bond-miimon 100           
 + ​bond-slaves none     
 + ​bond-primary eth0      ​
 + ​address 192.168.20.11
 + ​gateway 192.168.20.1 ​
 + ​netmask 255.255.255.0
 + ​dns-nameservers 192.168.20.5 192.168.1.10 192.168.110.11
 + ​dns-search subnet1.example.com subnet2.example.com
 +
 +
 +auto eth0
 + iface eth0 inet manual
 + ​bond-master bond0
 +
 +auto eth1
 + iface eth1 inet manual
 + ​bond-master bond0 
 +
 +</​code>​
 +
 +===== VLAN driver =====
 +
 +This requires the 802.1q module to talk to the Cisco switch but does not require special switch config and works across switches (unlike LCAP):-
 +
 +  # modprobe 8021q
 +
 +
 +<​code>​
 +auto eth1
 +iface eth1 inet static
 +address 1.1.1.10
 +netmask 255.255.255.0
 +
 +auto eth1.2
 +iface eth1.2 inet static
 +address 2.2.2.10
 +netmask 255.255.255.0
 +
 +auto eth1.3
 +iface eth1.3 inet static
 +address 3.3.3.10
 +netmask 255.255.255.0
 +
 +
 +auto eth1.100
 +iface eth1.100 inet static
 +address 100.100.100.10
 +netmask 255.255.255.0
 +
 +auto eth1.220
 +iface eth1.220 inet static
 +address 220.220.220.10
 +netmask 255.255.255.0
 +</​code>​
 +
 +
 +Setting trunk mode on IOS
 +
 +<​code>​
 +interface GigabitEthernet0/​24
 + ​switchport trunk encapsulation dot1q
 + ​switchport mode trunk
 + speed 1000
 + ​duplex full
 +</​code>​
 +
 +
 +
 +
 +===== Bonding with VLAN driver and bridging =====
 +
 +No specific switch config is required for this, but the switch ports need to be trunks not access ports.
 +
 +<​code>​
 +auto bond0     
 + iface bond0 inet manual ​       ​
 + ​bond-mode active-backup
 +# bond-mode broadcast
 +# bond-mode balance-rr
 + ​bond-miimon 100           
 + ​bond-slaves none     
 +
 +
 +auto eth1
 + iface eth1 inet manual
 + ​bond-master bond0
 +
 +auto eth3
 + iface eth3 inet manual
 + ​bond-master bond0 
 +
 +
 +
 +
 +
 +#auto bond0
 +#iface bond0 inet static
 +#address 1.1.1.10
 +#netmask 255.255.255.0
 +
 +auto bond0.2
 +iface bond0.2 inet static
 +address 2.2.2.10
 +netmask 255.255.255.0
 +
 +auto bond0.3
 +iface bond0.3 inet static
 +address 3.3.3.10
 +netmask 255.255.255.0
 +
 +auto bond0.100
 +iface bond0.100 inet static
 +address 100.100.100.10
 +netmask 255.255.255.0
 +
 +auto bond0.220
 +iface bond0.220 inet manual
 +
 +auto br220
 +iface br220 inet static
 +bridge-ports bond0.220
 +address 220.220.220.10
 +netmask 255.255.255.0
 +
 +</​code>​
 +
 +
 +Add new bridge with 
 +
 +  # brctl addbr br220
 +  ​
 +  ​
 +  # brctl show
 +  bridge name     ​bridge id               STP enabled ​    ​interfaces
 +  br220           ​8000.0025909243d5 ​      ​no ​             bond0.220
 +  #
 +
 +On new server:
 +
 +<​code>​
 +apt-get update
 +# it was failing to download some packages, then)
 +# rm -rf /​var/​lib/​apt/​lists/​*
 +apt-get update
 +apt-get install vlan
 +</​code>​

rb/ubuntunetwork.txt ยท Last modified: 07/09/2018 19:38 by andrew