Setting IP Address in Linux Manually

Written By Frek on Saturday, 26 November 2011 | 05:19

Setting the IP Address on Linux - can we suppose that the IP address as the address of a device on the network. IP (Internet Protocol) is a network layer protocol used by TCP / IP for addressing and routing data packets between the hosts on the network computer-based TCP / IP.

IP configuration file on linux in / etc / network / interfaces. Edit the file with the command,

server:~# nano /etc/network/interfaces
You are ready to add or edit the IP address manually. By default if we have not given an IP address on file so that there was only the loopback interface configuration. To add another IP on the interface (eg eth0, eth1) add the following parameters at the bottom after the loopback so it be like this.

# Loopback network interface
auto lo
iface lo inet loopback

# Tambahkan konfigurasi interface dibawah sini
auto eth0
   iface eth0 inet static
   address 192.168.10.1
   netmask 255.255.255.0
   network 192.168.10.0
   broadcast 192.168.10.255
   gateway 192.168.10.254
   dns-nameservers 202.134.0.155

auto eth1
iface eth1 inet dhcp

In the example above I add the IP on eth0 a static IP. While on my eth1 set to get IP from DHCP server. Examples of the above IP to be adjusted with the IP configuration on your network.

"auto eth1" the intention is that the interface runs automatically once the computer is turned on. "iface eth0 inet static", meaning the interface eth0 using static IP, not dynamic. If you want to be dynamic then use dhcp.

0 comments:

Post a Comment