setup and Configuring Static ip address in Ubuntu server 12.04 through Command Prompt

To get setup a static IP address in Ubuntu 12.04, press Ctrl – Alt – T on your keyboard to open terminal. When it opens, run the commands below to open the interfaces file.
sudo vi /etc/network/interfaces

static_ip_address_precise_2

Finally, type the lines as shown below into the file and save it.
iface eth0 inet static
      address xxx.xxx.x.x
      netmask xxx.xxx.xxx.x
      gateway xxx.xxx.x.x

static_ip_address_precise_3

To insert characters into the file, press the letter ( i ) . Use the arrow keys to move left to right, up, down. To save your work, press the Esc key, then type :wq and press Enter.
More Details Click

Configuring Static ip address in Ubuntu server
If you want to install vim editor use the following command
sudo apt-get install vim
Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit
Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 172.19.0.10):
sudo vi /etc/network/interfaces
and enter the following save the file and exit (In vi, ESC, then ZZ to save and exit)
# The primary network interface
auto eth0
iface eth0 inet static
address 172.19.0.10
netmask 255.255.255.0
network 172.19.0.0
broadcast 172.19.0.255
gateway 172.19.0.1
Now you need to restart your network services using the following command
sudo /etc/init.d/networking restart
You need to setup manually DNS servers in resolv.conf file when you are not using DHCP.
sudo vi /etc/resolv.conf
You need to add look something like this
search domain.com
nameserver xxx.xxx.xxx.xxx
More Details Click

0 comments:

Post a Comment