1

Is there an easy to set Linux (Ubuntu 10.4) to always use the same IP address from my router? I know in windows you can tell it to use a static IP address in the TCP/IP settings, what's the same for Linux?

I need it to always have an IP address of 192.168.111.133

John Gardeniers
  • 27,262
  • 12
  • 53
  • 108
Dave
  • 11
  • 1
  • 2
    There's a big difference between setting a static address and a DHCP reservation. Which are you really after? – John Gardeniers Jan 04 '11 at 00:36
  • 1
    Probably a duplicate of http://serverfault.com/questions/113866/how-do-i-setup-a-public-static-ip-in-ubuntu-9-10 – TheLQ Jan 04 '11 at 01:11

1 Answers1

2

To set your machine up with a static IP address, edit /etc/network/interfaces

Add lines like:

auto eth0
iface eth0 inet static
        address 192.168.111.133
        netmask 255.255.255.0
        gateway 192.168.111.1

This assumes your router is on 192.168.111.1.

If you really want a DHCP reservation, that needs to be done from your DHCP server (probably your router).

mibus
  • 816
  • 4
  • 5