Showing posts with label debian squeeze. Show all posts
Showing posts with label debian squeeze. Show all posts

Tuesday, November 1, 2011

Setup Static IP Address on Debian 6 (Squeeze)

During installation, Debian uses DHCP by default.You should disable DHCP feature for primary network interface by editing /etc/network/interfaces
By default, it looks like following:

# 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



We should make this look like:


# 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
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.1
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1



You may not need to enter network and broadcast details.
Now, restart service by 
/etc/init.d/networking restart

Fully Qualified Domain Name on Debian Squeeze

Debian uses a simple FQDN approach by getting the values from hosts file.So, if you would like to set up ns1.example.com as a FQDN for your server, then modify /etc/hosts file so it looks like

127.0.0.1 localhost 127.0.1.1 ns1.example.com ns1 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts

Other values may depend on your system.