Ubuntu Ethernet w/Static IP

Mindwatering Incorporated

Author: Tripp W Black

Created: 06/14/2009 at 10:06 PM

 

Category:
Ubuntu
Configuration Files

How to Set Up Ubuntu with a Static IP

/etc/network/interfaces

For the first ethernet adapter (eth0), you would update the line(s) under auto eth0 as follows.
(BTW, the auto means start the network adapter interface at boot.)

vi /etc/network/interfaces

1. For DHCP
auto eth0
iface eth0 inet dhcp

2. For Static
auto eth0
iface eth0 inet static
address 192.168.2.232
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.129
dns-nameservers 192.168.2.1 123.45.67.123 123.55.67.123

To Update the Hostname:
vi /etc/hostname

To Update the DNS (Domain) Suffix and Search Suffix:
vi /etc/resolv.conf
Note: resolv.conf gets overwritten upon reboot by DHCP server as design if DHCP and not static.

previous page

×