How to Configure and maintain networking services in Linux.

System/Computer communicate to some other computer via a network. We can internally or externally exchange some information. Network can be small as some computers connected in home or office or can be large or complicated as in large University or the entire Internet.

We can maintain a system’s network & task includes network configuration and troubleshooting.

ifconfig

ifconfig stands for interface configurator. It enables us to initialize an interface, assign IP address, enable or disable an interface. It show route and network interface.

ifconfig

Here is the command output.

eno1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 34:73:5a:c4:f2:2e  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 200484  bytes 19555100 (19.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 200484  bytes 19555100 (19.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Details of specific interface

fconfig eth0  
or
ifconfig lo
or  
ifconfig wlan0  

Here is the command output.

Fig 1

Provide IP address and Gateway

ifconfig interface-name <address> netmask <address>  

Enable or Disable specific interface

ifup interface-name  
or
ifdown interface-name

Listing the IP addresses

ip a
or
ip address show  
or
ip addr

Here is the command output.

Fig. 6

Show the Ipv4 and Ipv6 Addresses.

ip -4 addr 
&
ip -6 addr  

Here is the command output.

Fig. 3

Add an IP address to an Interface.

  • ‘add’ and ‘dev’ are used to add an IP address to an interface.
ip addr add ip-address dev interface-name
  • Show Added Ip address.
ip addr show dev wlp6s0  

Deleting an IP Address

ip addr del ip-address dev interface

IP with Network Interfaces

ip link show  

Here is the command output.

Fig. 7

Start & Stop a Network Interface.

ip link set interface-name up
&
ip link set interface-name down  

IP address with Routes

  • List the defined routes of system.
ip route  

Here is the command output.

Fig. 8

 

Leave a Reply