
上QQ阅读APP看书,第一时间看更新
Interface configuration
Ubuntu 16.04 LTS uses configuration files found in /etc/network/interfaces.d/ or the file/etc/network/interfaces that describe how network interfaces should be configured.
Using a text editor, update the network interface file on each host as follows.
For controller01:
auto eth0
iface eth0 inet static
address 10.10.0.100
netmask 255.255.255.0
gateway 10.10.0.1
dns-nameserver 8.8.8.8
auto eth1
iface eth1 inet static
address 10.20.0.100
netmask 255.255.255.0
auto eth2
iface eth2 inet manual
For compute01:
auto eth0
iface eth0 inet static
address 10.10.0.101
netmask 255.255.255.0
gateway 10.10.0.1
dns-nameserver 8.8.8.8
auto eth1
iface eth1 inet static
address 10.20.0.101
netmask 255.255.255.0
auto eth2
iface eth2 inet manual
For compute02:
auto eth0
iface eth0 inet static
address 10.10.0.102
netmask 255.255.255.0
gateway 10.10.0.1
dns-nameserver 8.8.8.8
auto eth1
iface eth1 inet static
address 10.20.0.102
netmask 255.255.255.0
auto eth2
iface eth2 inet manual
For compute03:
auto eth0
iface eth0 inet static
address 10.10.0.103
netmask 255.255.255.0
gateway 10.10.0.1
dns-nameserver 8.8.8.8
auto eth1
iface eth1 inet static
address 10.20.0.103
netmask 255.255.255.0
auto eth2
iface eth2 inet manual
For snat01:
auto eth0
iface eth0 inet static
address 10.10.0.104
netmask 255.255.255.0
gateway 10.10.0.1
dns-nameserver 8.8.8.8
auto eth1
iface eth1 inet static
address 10.20.0.104
netmask 255.255.255.0
auto eth2
iface eth2 inet manual
The eth2 interface will be used in a network bridge described in further detail in upcoming chapters. To activate the changes, cycle the interfaces using the ifdown and ifup commands on each node:
# ifdown --all; ifup --all
For more information on configuring network interfaces, please refer to the Ubuntu man page at the following URL: http://manpages.ubuntu.com/manpages/xenial/man5/interfaces.5.html