Main Menu

Search

Showing posts with label interface. Show all posts
Showing posts with label interface. Show all posts

LINUX: How to list Ethernet Interfaces (mlx4_vnic_info)

Following commands can be used for listing the Ethernet interfaces on Linux hosts.
mlx4_vnic_info -l 
mlx4_vnic_info -S

Products to which Article Applies
All Linux hosts using Ethernet interfaces

Article Author: Tarun Boyella

ANSIBLE: Ansible Script to Test Pings Between Multiple Hosts on All Network Interfaces (How To Docs)


Download the ansible script available following github repository link to do ping tests between multiple hosts on all network interfaces.

https://github.com/tarbots/ansible-script-to-test-pings-to-multiple-hosts-all-network-interfaces

Ansible script available in above github repository is very simple, easy to deploy and execute. README.txt file has detailed information on how to do the ping tests using the ansible script files. 



Products to which Article Applies

All Operating Systems which Support Ansible.

Additional Reference


https://github.com/tarbots/ansible-script-to-test-pings-to-multiple-hosts-all-network-interfaces


LINUX: "ip addr" or "ip a" Command To List All Network Interfaces & IP Addresses In Linux (How To Doc)

Below "ip addr" or "ip a" commands can be used to list all network interfaces & IP addresses in Linux.
ip addr | grep -i global

ip a | grep -i global

Below is example output of above commands showing network bonds and their IP addresses.

# ip a | grep global
inet 192.168.20.6/24 brd 192.168.20.255 scope global bond1
inet 192.168.21.6/24 brd 192.168.21.255 scope global bond2
inet 192.168.23.6/24 brd 192.168.23.255 scope global bond0

Products to which Article Applies

All Linux Operating Systems

LINUX: How To Change MTU Setting Value for Network Bonds/Interfaces Dynamically Without Reboot? ("ip link" Command)

Below command can be used to change MTU setting value for Network bonds/interfaces dynamically without reboot.
ip link set dev <bond/interface name> mtu <value>

For e.g. if you want MTU value for network bond bond0 as 64000, your command looks as follows:


ip link set dev bond0 mtu 64000


Products to which Article Applies

All Linux Operating Systems

Additional Reference

https://www.cyberciti.biz/faq/how-can-i-setup-the-mtu-for-my-network-interface/
http://www.tldp.org/test/en/linux-ip/apbs03.html


LINUX: How To Do ARP Ping Test To Ping IP Address Over Specific Interface?

Below is command to run on source VM to do arp ping on destination VM on specific interface.


arping -c 3 -I <Source VM Interface> <Destination VM IP>

Below is snippet of above command.


[root@testVM ~]# arping -c 3 -I <eth0> 192.168.0.1
ARPING 192.168.0.1 from 192.168.20.6 bond1
Unicast reply from 192.168.0.1 [80:00:ZZ:ZZ:ZZ:YY:YY:YY:ZZ:ZZ:ZZ:YY:YY:YY:97:C3:52]  0.694ms
Unicast reply from 192.168.0.1 [80:00:ZZ:ZZ:ZZ:YY:YY:YY:ZZ:ZZ:ZZ:YY:YY:YY:97:C3:52]  1.688ms
Unicast reply from 192.168.0.1 [80:00:ZZ:ZZ:ZZ:YY:YY:YY:ZZ:ZZ:ZZ:YY:YY:YY:97:C3:52]  0.713ms
Sent 3 probes (1 broadcast(s))
Received 3 response(s)
[root@testVM ~]#

Products to which Article Applies


All Linux Operating Systems

Additional Reference

https://www.poftut.com/arping-command-tutorial-examples-linux/

How To Check Active Slave For Particular Network Bond On Linux Machine

In general HA Linux Machines have 2 slaves for each network bond. This is to ensure that network works when one of the network slave links does not work due to upstream issues like issues with the switches. Below is the command for checking the slaves for network bond.
cat /proc/net/bonding/bondX
In above command bondX is the name of the network bond. For e.g. if you have a network bond as bond0, your ifconfig command will show it as follows.

bond0     Link encap:Ethernet  HWaddr 00:ZZ:ZZ:ZZ:ZZ:1b            inet addr:10.ZZ.ZZ.ZZ  Bcast:10.ZZ.ZZ.ZZ  Mask:255.ZZ.ZZ.0
          inet6 addr: ZZZZ::ZZZ:ZZZ:zZZZ:ZZZZ/ZZ Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:ZZZZZZZZZ errors:0 dropped:ZZZZZZ overruns:0 frame:0
          TX packets:ZZZZZZZZZ errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:ZZZZZZZZZZZZ (2ZZ.Z GiB)  TX bytes:ZZZZZZZZZZZZ (2ZZ.Z GiB)

In order to check the active slave for bond0 below is the command to use.

cat /proc/net/bonding/bond0
  
Following is snippet of above command. From below command output we see that bond0 has 2 slaves eth1276_2.3131 & eth641_1.3131 and eth1276_2.3131 slave is the active slave. If notice ifconfig output the Hardware address 00:ZZ:ZZ:ZZ:ZZ:1b shown is the Hardware address corresponding to eth1276_2.3131 slave as it is the active slave.
  Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

  Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
  Primary Slave: None
  Currently Active Slave: eth1276_2.3131
  MII Status: up
  MII Polling Interval (ms): 250
  Up Delay (ms): 5000
  Down Delay (ms): 5000


  Slave Interface: eth1276_2.3131
  MII Status: up
  Speed: 10000 Mbps
  Duplex: full
  Link Failure Count: 0
  Permanent HW addr: 00:ZZ:ZZ:ZZ:ZZ:1b
  Slave queue ID: 0


  Slave Interface: eth641_1.3131
  MII Status: up
  Speed: 10000 Mbps
  Duplex: full
  Link Failure Count: 0
  Permanent HW addr: 00:ZZ:ZZ:ZZ:ZZ:1a
  Slave queue ID: 0

Products to which Article Applies



All Linux Operating Systems

Additional References

https://docs.oracle.com/cd/E37670_01/E41138/html/ch10s05.html