Use a fixed IP address for interface settings. Suppose you want to configure an Ethernet interface so that it has a fixed IP address 192.168.0.111. This IP address starts with 192.168.0, so it must be in a LAN. It is assumed that 192.168.0.1 is the IP address of the Internet gateway on the LAN. Edit/etc/network/interfaces to include content similar to the following section: iface eth0 inet staticaddress 192.168.0.111netmask 255.255.255.0gateway 192.168.0.1 before the interface is activated or, you can configure other parts of the interface or perform other operations. As long as you set the appropriate commands in the "up" and "down" lines. Iface eth0 inet staticaddress 255.255.255.192.168.0.1up route add-net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.2 dev $ route del-net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.2 dev $ login echo Interface $ IFACE going up | /bin/logger-t ifupdown echo Interface $ IFACE Going down |/usr/bin/logger-t ifdown you can also choose to insert the command to/etc/network/if-up.d and/etc /network/if -In the down. d directory script. These scripts can also execute extended options. For more information, see interfaces (5 ). For example, the script contained in the resolvconf package allows you to go to/etc/resolv when the interface is activated. add the specified DNS information to the conf file: iface eth0 inet staticaddress 192.168.0.111netmask 255.255.255.0gateway 192.168.0.1dns-search somedomain. orgdns-nameservers 195.238.2.21 195.238.2.22dns-search parameter somedomain.org meets resolv. the search option parameter described in conf (5. The parameters 195.238.2.21 and 195.238.2.22 of the dns-nameservers option comply with the parameters of the nameserver option. Other identifiable options are dns-domain and dns-sortlist.