Just quick config snippet for Debian 6.0 which I came across when setting up few Debian Linux 6.0 virtual machines for recent network LAB. By default network adapter is set to get IP address from DHCP.
/etc/network/interfaces – dynamic IP address configuration
# 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 network interface allow-hotplug eth0 iface eth0 inet dhcp
/etc/network/interfaces – static IP address configuration
# 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 network interface allow-hotplug eth0 iface eth0 inet static address 172.16.10.11 netmask 255.255.255.0 network 172.16.10.0 broadcast 172.16.10.255 gateway 172.16.10.5
Restarting network services
Once all is set in /etc/network/interfaces file you can restart network services to apply new setting on network interface(s) instead of rebooting whole system.
root@lab-lnx-01:~# /etc/init.d/networking restart
Network interface might have different name than eth0 or there might be more network interfaces in configuration file. Adjust configuration of the apropriate interface you want to change.