Configuring the IP Address in a LAN (Local Area Network)

IP address of the function is to provide an identity to the host in order to be recognized by the network.  IANA (Internet Assigned Numbers Authority) is the competent authority to deal with the existing IP settings on this earth, this is because the IP may not be the same used in the network.  IP address in Linux can be done in two ways permanent and not permanent.

1.  Not permanent settings

Now we check our network interface

Code:
ediant@ediant:~$ sudo ifconfig 


We will see below (may be different from yours)
Code:
eth0      Link encap:Ethernet  HWaddr 00:22:19:f9:27:51  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:20 

Now we will configuring it
Code:
ediant@ediant:~$ sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0
Finished, now you have an existing network device IP address, to check the residence to do ifconfig command again and the results are as follows

Code:
eth0      Link encap:Ethernet  HWaddr 00:22:19:f9:27:51  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:20 
2.  Permanent settings


Now we edit file in /etc/network/interfaces
Code:
ediant@ediant:~$ sudo nano /etc/network/interfaces 
Edit that file to be like this
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
 network 192.168.1.0
 broadcast 192.168.1.255
 address 192.168.1.1
 netmask 255.255.255.0
Restart network interfaces
Code:
ediant@ediant:~$ sudo nano /etc/init.d/networking restart



0 Comment:

Post a Comment