Assigning a Static IP Address in Ubuntu
Posted on March 28, 2006
Filed Under /dev/null/ | 48 views |
In order to assign a static IP address to your Ubuntu box you want to open up /etc/network/interfaces:
sudo gedit /etc/network/interfaces
And change this:
# The primary network interface
auto eth0
iface eth0 inet dhcp
To this:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.2.101
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
filling in the appropriate values for your network. In my case it’s 2.101 because I’ve got an SMC router and it’s at 192.168.2.1.
You’ll notice that I showed you in the previous post how to fix it if this goes wrong, I suggest giving that a once-over before making these changes, just in case.
Comments
Leave a Reply