Friday, August 6, 2010

Manually Setting Up a Static IP in Ubuntu

For some reason, Webmin doesnt work well with Ubuntu 10.04. Everytime I configure a static IP using Webmin, it throws an error at boot. Ive reinstalled several times hoping that it was just a glitch. Maybe for some reason, there was a misconfiguration in the network modules in the source code perhaps.

Anyway, getting around this, I decided to be a command line ninja once more. Logging in as root, edit the /etc/network/interfaces file an tweak as needed (I removed the last octet for security reasons, replaced with x and y).
# The primary network interface
auto eth0
iface eth0 inet static

address 192.168.1.x
gateway 192.168.1.y

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255
You could actually just copy some of the values when you're on DHCP by entering ifconfig -a as a sample, heres the data I got (I removed some values and replaced the last octet of the IP with x).
eth0      Link encap:Ethernet  HWaddr -- removed -- 
          inet addr:192.168.1.x  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: -- removed -- Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5140320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1978783 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:946219572 (946.2 MB)  TX bytes:2233516408 (2.2 GB)

No comments:

Post a Comment