Set a Static IP on Ubuntu

Nostra-Daniel once pontificated that memory is like stacking penguins on an island. Each thing you’d like to remember is a penguin, as you fill the island, you have to choose which penguins end up in the ocean. For me, setting a static IP on Ubuntu was one of those penguins that ended up being fed to the seals.

Setting A Static IP

You’ll need to edit /etc/network/interfaces and add/change the following area:

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

Reference

http://codesnippets.joyent.com/posts/show/319

One thought on “Set a Static IP on Ubuntu”

  • Unless you’re doing a strange network config, specifying netmask, network, and broadcast is redundant. You can drop the network and broadcast and it will figure it out from the netmask.

Comments are closed.