Saturday, May 18, 2013

How to config static ip on ubuntu 12.04 virtual

1. edit the file /etc/network/interfaces as follows:
auto lo
#iface lo inet loopback

#set static ip
auto eth0
iface eth0 inet static
address 192.168.1.101
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1

2. restart networking services:
sudo /etc/init.d/networking restart

Enjoy your Ubuntu with static ip!

Note: No need to edit /etc/resolv.conf. For Redhat it may be required.

No comments:

Post a Comment