Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Re: Rhel 6 nic order with 4 network adapter or more

$
0
0

I wrote a small bash script to help solve this problem. You feed the script an index number representing the order in which the devices appear in the vmware console and the script responds with the name of the device that corresponds with that index number.  If I find any problems with it I'll keep a gist updated here: https://gist.github.com/logicalmethods/da1d89f8cfcfd58ad365e6ea98461f16

 

#! /bin/bash

 

###
# Written by Alex Speaks
# Takes the position in which a NIC appears in the vmware console and returns the ethernet device that corresponds to that position.
# Position numbers start at 0
# You can think of this as the old-style ethX number

 

NIC_INDEX=$1

 

for dir in /sys/bus/pci/devices/*/
do
    if [ -f $dir/label ] && [ $(cat ${dir}/label|tr -d '\n') == "Ethernet${NIC_INDEX}" ]
    then
        ls $dir/net/
    fi
done


Viewing all articles
Browse latest Browse all 219257

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>