Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, February 20, 2014

Linux: Changing network IP



sudo nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

sudo /etc/init.d/networking restart

Monday, October 7, 2013

Setting static IP on Ubuntu Server


1. Go to network interface:

sudo vi /etc/network/interfaces
2. Under the line

auto eth0iface eth0 inet dhcp
Customize the above to the following:
auto eth0iface eth0 inet static 
address 192.168.1.100 
netmask 255.255.255.0 
network 192.168.1.0 
broadcast 192.168.1.255 
gateway 192.168.1.1

3. Update the DNS setting.

sudo vi /etc/resolv.conf
On the line ‘name server xxx.xxx.xxx.xxx’ replace the x with the IP of your name server.

4. You need to also remove the dhcp client.

sudo apt-get remove dhcp-client
5. Restart the networking components.

sudo /etc/init.d/networking restart