Difference between ip and ifconfig command

Comparing the diferrence between the Network Configuration of ifconfig vs ip

' ifconfig' is used to configure, display and control network interfaces. ' ip' command is a new alternative now exists on Linux distributions which is much more powerful than it. In this article we will discuss the differences between the ip and ifconfig command.

Various tasks that ifconfig performs are

  • Removing, Adding ARP Cache entries to create new Static ARP entry for a host.
  • Modifying and displaying kernel routing tables.
  • Modifying or displaying Interface properties.


To Display all Network Interfaces in Linux

Run the following command to display all network interfaces.

ifconfig command

[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:67  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING NOARP PROMISC ALLMULTI MULTICAST  MTU:3000  Metric:1
          RX packets:723675 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263635 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:735413931 (701.3 MiB)  TX bytes:18694734 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9890 (9.6 KiB)  TX bytes:9890 (9.6 KiB)

ip command

[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,NOARP,ALLMULTI,PROMISC,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
    link/ether 00:0c:29:0f:82:67 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
    inet6 fe80::20c:29ff:fe0f:8267/64 scope link
       valid_lft forever preferred_lft forever


To Add or Delete an IP in Linux

The following script adds, the IP 192.168.5.123 to the interface eth0.

ifconfig command

[root@linuxhelp ~]# ifconfig eth0 add 192.168.5.123
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:67  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING NOARP PROMISC ALLMULTI MULTICAST  MTU:3000  Metric:1
          RX packets:730831 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263647 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:737489856 (703.3 MiB)  TX bytes:18695522 (17.8 MiB)
eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:0F:82:67  
          inet addr:192.168.5.123  Bcast:192.168.7.255  Mask:255.255.255.0
          UP BROADCAST RUNNING NOARP PROMISC ALLMULTI MULTICAST  MTU:3000  Metric:1
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9890 (9.6 KiB)  TX bytes:9890 (9.6 KiB)
[root@linuxhelp ~]# ifconfig eth0 del 192.168.5.123
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:67  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING NOARP PROMISC ALLMULTI MULTICAST  MTU:3000  Metric:1
          RX packets:736546 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263674 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:738770733 (704.5 MiB)  TX bytes:18697356 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9890 (9.6 KiB)  TX bytes:9890 (9.6 KiB)

ip command

[root@linuxhelp ~]# ip a add 192.168.5.123 dev eth0
[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,NOARP,ALLMULTI,PROMISC,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
    link/ether 00:0c:29:0f:82:67 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
    inet 192.168.5.123/32 scope global eth0
    inet6 fe80::20c:29ff:fe0f:8267/64 scope link
       valid_lft forever preferred_lft forever
[root@linuxhelp ~]# ip a del 192.168.5.123 dev eth0
Warning: Executing wildcard deletion to stay compatible with old scripts.
         Explicitly specify the prefix length (192.168.5.123/32) to avoid this warning.
         This special behaviour is likely to disappear in further releases,
         fix your scripts!
[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,NOARP,ALLMULTI,PROMISC,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
    link/ether 00:0c:29:0f:82:67 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
    inet6 fe80::20c:29ff:fe0f:8267/64 scope link
       valid_lft forever preferred_lft forever


To Enable or Disable Network Interface

ifconfig command

[root@linuxhelp ~]# ifconfig
eth0     Link encap:Ethernet HWaddr 00:0C:29:0F:82:99
         inet addr:192.168.7.123 Bcast:192.168.7.255 Mask:255.255.255.0
         inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
         UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:3000 Metric:1
         RX packets:494375 errors:0 dropped:0 overruns:0 frame:0
         TX packets:263534 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:2500
         RX bytes:638763636 (609.1 MiB) TX bytes:18687410 (17.8 MiB)
lo       Link encap:Local Loopback
         inet addr:127.0.0.1 Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING MTU:65536 Metric:1
         RX packets:146 errors:0 dropped:0 overruns:0 frame:0
         TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:9890 (9.6 KiB) TX bytes:9890 (9.6 KiB)
[root@linuxhelp ~]# ifconfig eth0 down
[root@linuxhelp ~]# ifconfig
lo       Link encap:Local Loopback
         inet addr:127.0.0.1 Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING MTU:65536 Metric:1
         RX packets:146 errors:0 dropped:0 overruns:0 frame:0
         TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:9890 (9.6 KiB) TX bytes:9890 (9.6 KiB)
[root@linuxhelp ~]# ifconfig eth0 up
[root@linuxhelp ~]# ifconfig
eth0    Link encap:Ethernet HWaddr 00:0C:29:0F:82:99
        inet addr:192.168.7.123 Bcast:192.168.7.255 Mask:255.255.255.0
        inet6 addr: fe80::20c:29ff:fe0f:8299/64 Scope:Link
        UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:3000 Metric:1
        RX packets:501628 errors:0 dropped:0 overruns:0 frame:0
        TX packets:263565 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:2500
        RX bytes:641694392 (611.9 MiB) TX bytes:18689665 (17.8 MiB)
lo      Link encap:Local Loopback
        inet addr:127.0.0.1 Mask:255.0.0.0
        inet6 addr: ::1/128 Scope:Host
        UP LOOPBACK RUNNING MTU:65536 Metric:1
        RX packets:146 errors:0 dropped:0 overruns:0 frame:0
        TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:0
        RX bytes:9890 (9.6 KiB) TX bytes:9890 (9.6 KiB)

ip command

The output of " ip a" script shows all the interfaces as default, either down or up, but have to highlights the status along with description.

[root@linuxhelp ~]# ip a
1: lo:  < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
        inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: eth0:< BROADCAST,MULTICAST,ALLMULTI,PROMISC,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
        link/ether 00:0c:29:0f:82:99 brd ff:ff:ff:ff:ff:ff
        inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
        inet6 fe80::20c:29ff:fe0f:8299/64 scope link
        valid_lft forever preferred_lft forever
[root@linuxhelp ~]# ip link set eth0 down
[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
       link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
       inet 127.0.0.1/8 scope host lo
       inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
[root@linuxhelp ~]# ip link set eth0 up
[root@linuxhelp ~]# ip a
1: lo:  < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
        inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,ALLMULTI,PROMISC,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
         link/ether 00:0c:29:0f:82:67 brd ff:ff:ff:ff:ff:ff
         inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
         inet6 fe80::20c:29ff:fe0f:8267/64 scope link
         valid_lft forever preferred_lft forever


To Add MAC Hardware Address to the Network Interface

To check the HW addr value in the output.

ifconfig command

[root@linuxhelp ~]# ifconfig eth0 hw ether 00:0C:29:0F:82:89
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:89  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING NOARP PROMISC ALLMULTI MULTICAST  MTU:3000  Metric:1
          RX packets:753372 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263697 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:744557176 (710.0 MiB)  TX bytes:18699014 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9890 (9.6 KiB)  TX bytes:9890 (9.6 KiB)

ip command

[root@linuxhelp ~]# ip link set dev eth0 address 00:0C:29:0F:82:99
[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,NOARP,ALLMULTI,PROMISC,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
    link/ether 00:0c:29:0f:82:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
    inet6 fe80::20c:29ff:fe0f:8267/64 scope link
       valid_lft forever preferred_lft forever


To Set other Configurations of Network Interface

Other than setting IP or Hardware address, the configurations that have to apply to an interface are,

  • Transmit Queue length
  • Promiscuous mode
  • Disable or enable all multicast mode
  • Maximum Transfer Unit
  • Multicast flag

ifconfig and ip &ndash Other Network Configurations

a. Set MTU value to 2500.

ifconfig command

[root@linuxhelp ~]# ifconfig eth0 mtu 2500
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:99  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING NOARP PROMISC ALLMULTI MULTICAST  MTU:2500  Metric:1
          RX packets:784666 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263736 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:756924939 (721.8 MiB)  TX bytes:18701605 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9890 (9.6 KiB)  TX bytes:9890 (9.6 KiB)

ip command

[root@linuxhelp ~]# ip link set dev eth0 mtu 3000
[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,NOARP,ALLMULTI,PROMISC,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
    link/ether 00:0c:29:0f:82:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
    inet6 fe80::20c:29ff:fe0f:8267/64 scope link
       valid_lft forever preferred_lft forever

b. Enable or Disable multicast flag.

ifconfig command

[root@linuxhelp ~]# ifconfig eth0 multicast
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:99  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING NOARP PROMISC ALLMULTI MULTICAST  MTU:3000  Metric:1
          RX packets:795743 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263750 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:760749503 (725.5 MiB)  TX bytes:18702616 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9890 (9.6 KiB)  TX bytes:9890 (9.6 KiB)

ip command

[root@linuxhelp ~]# ip link set dev eth0 multicast on
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:99  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:3000  Metric:1
          RX packets:429507 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263534 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:610781188 (582.4 MiB)  TX bytes:18687410 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9792 (9.5 KiB)  TX bytes:9792 (9.5 KiB)

c. Setting the transmit queue length.

ifconfig command

[root@linuxhelp ~]# ifconfig eth0 txqueuelen 1500
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:99  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:3000  Metric:1
          RX packets:429524 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263534 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1500
          RX bytes:610782330 (582.4 MiB)  TX bytes:18687410 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9792 (9.5 KiB)  TX bytes:9792 (9.5 KiB)

ip command

[root@linuxhelp ~]# ip link set dev eth0 txqueuelen 2500
[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,UP,LOWER_UP>  mtu 3000 qdisc pfifo_fast state UP qlen 2500
    link/ether 00:0c:29:0f:82:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
    inet6 fe80::20c:29ff:fe0f:8267/64 scope link
       valid_lft forever preferred_lft forever

d. Enabling or disabling promiscuous mode.

ifconfig command

[root@linuxhelp ~]# ifconfig eth0 promisc
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:99  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:3000  Metric:1
          RX packets:431715 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263534 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:611730229 (583.3 MiB)  TX bytes:18687410 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9792 (9.5 KiB)  TX bytes:9792 (9.5 KiB)

ip command

[root@linuxhelp ~]# ip link set dev eth0 promisc on

[root@linuxhelp ~]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: < BROADCAST,MULTICAST,UP,LOWER_UP,PROMISC>  mtu 3000 qdisc pfifo_fast state UP
    link/ether 00:0c:29:0f:82:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.123/24 brd 192.168.7.255 scope global eth0
    inet6 fe80::20c:29ff:fe0f:8267/64 scope link
       valid_lft forever preferred_lft forever

e. Enable or disable all multicast mode.

ifconfig command

[root@linuxhelp ~]# ifconfig eth0 allmulti
[root@linuxhelp ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:0F:82:99  
          inet addr:192.168.7.123  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe0f:8267/64 Scope:Link
          UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:3000  Metric:1
          RX packets:460881 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263534 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:2500
          RX bytes:624959520 (596.0 MiB)  TX bytes:18687410 (17.8 MiB)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9792 (9.5 KiB)  TX bytes:9792 (9.5 KiB)

ip command

[root@linuxhelp ~]# ip link set dev eth0 allmulti on



To Enable or disable the use of ARP protocol

To Enable/Disable ARP Protocol

ifconfig command

To disable, change arp with -arp. This command enables the protocol ARP to be used with interface eth0.

[root@linuxhelp ~]# ifconfig eth0 arp

ip command

For disabling replace on with off.

[root@linuxhelp ~]# ip link set dev eth0 arp on
FAQ
Q
What are the various tasks that ifconfig will do?
A
Various tasks that ifconfig performs are

Removing, Adding ARP Cache entries to create new Static ARP entry for a host.
Modifying and displaying kernel routing tables.
Modifying or displaying Interface properties
Q
Which one is appropriate to work with?
A
Both does the same functionality almost but ifconfig shows everything in one go
Q
Good Post.
A
Thank you stay connected
Q
How to Add MAC Hardware Address to the Network Interface
A
ifconfig eth0 hw ether 00:0C:29:0F:82:89 Here is this example/syntax
Q
How to do for MTU?
A
ifconfig eth0 mtu 2500 and in ipconfig ip link set dev eth0 mtu 3000