Twitter Updates

Saturday 31 May 2008

Convert debain/ubuntu to static IP

My Ubuntu Mini-ITX server was by default being assined an IP through DHCP from the router. If my router could assign IP based on the MAC address I would not have to assign a STATIC IP on the machine itself but could control it from a central location. Since I dont have this most of my machine have a static IP assigned. For Debain and Ubuntu systems this is quite easy.
Following instructions are for eth0 (the first real network socket)

$sudo vim /etc/network/interfaces

This text should already be present
----
auto lo
iface lo inet loopback

if these lines are present delete/comment out (#at the beginning of the line is a commet)
----
auto eth0
iface eth0 inet dhcp



Add the following (replace the x's with the assigned ip)
----
#### Manually Added Below Morgy ####
auto eth0
iface eth0 inet static
address 192.168.1.x
netmask 255.255.255.0
gateway 192.168.1.x
network 192.168.1.0
broadcast 192.168.1.255

Now restart networking
$ sudo /etc/init.d/networking restart


A more complete tutorial

No comments: