I'm doing a baremetal installation on a Cisco C2200-M4 server with the EVE-NG v5 Pro. It has 4 interfaces on it. 2x 10 gig SFP, and 2x 1 gig copper. I'm using the copper interfaces. Everything works well through the standard Linux installation, I'm creating a bonded interface between 2 of my copper gigabit ethernet ports, and the installation works great. I get all the way to configuring the Management IP for EVE-NG, but, the software is chosing PNET0 which is being mapped to an interface that I am not using. The one I want to use is PNET2 which is mapped to the proper physical interface, even though I would prefer the bonded interface. I did try this with only a single, non-bonded interface during set up, and I get the same issue.
Any thoughts on how to resolve this?
New baremetal install/proper interface not chosen for PNET0 mapping
Moderator: mike
-
- Posts: 9
- Joined: Tue Jul 20, 2021 1:19 am
-
- Posts: 4809
- Joined: Wed Mar 15, 2017 4:44 pm
- Location: London
- Contact:
Re: New baremetal install/proper interface not chosen for PNET0 mapping
Try this:
To fix all nic, you have to use /opt/ovf/pimarywizard.sh and to choose auto
Then create new file:
grep : /sys/class/net/eth*/address | sed -e 's/.*eth/eth/g' -e 's,/address:,=,' -e 's/://g' -e 's/=/=enx/' -e 's/\(.*\)=\(.*\)/\2=\1/' > /opt/unetlab/nicorder
The edit this file to match your requirement
Sample:
enx000c29709660=eth8
enx000c29709688=eth1
enx000c297096b0=eth2
enx000c2970966a=eth4
enx000c29709692=eth3
enx000c297096ba=eth5
enx000c29709674=eth6
enx000c2970969c=eth7
enx000c2970967e=eth0
enx000c297096a6=eth9
Just check your needs to match ethX(pnetX) with mac
Once your file is created,
create a new file named /etc/udev/rules.d/70-eve-nicorder-net.rules
with content:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", RUN+="/opt/unetlab/scripts/nicorder.sh"
Then create file /opt/unetlab/scripts/nicorder.sh
With content:
#!/bin/bash
if [ ! -e /opt/unetlab/nicorder ] ; then \
exit 0
fi
. /opt/unetlab/nicorder
LIVE_ID_NET_NAME_MAC=$(cat /sys/class/net/${!ID_NET_NAME_MAC}/address | sed -e 's/://g' -e 's/^/enx/')
if [ $LIVE_ID_NET_NAME_MAC = $ID_NET_NAME_MAC ] ; then exit 0 ; fi
if [ -n "${!ID_NET_NAME_MAC}" -a "${!ID_NET_NAME_MAC}" != "$INTERFACE" ] ; then \
ip link set $INTERFACE name ${!ID_NET_NAME_MAC}
if [ $? -ne 0 ] ; then \
ip link set $INTERFACE name ${!ID_NET_NAME_MAC}-new
fi
# try set every interfaces
ls -d /sys/class/net/eth* | sed -e 's,.*/,,' | grep new | while read IF
do TIF=$(echo $IF | sed -e 's/-new//')
ip link set $IF name $TIF
done
fi
Make it executable: chmod +x /opt/unetlab/scripts/nicorder.sh
Reboot your server and nic should be ordered
To fix all nic, you have to use /opt/ovf/pimarywizard.sh and to choose auto
Then create new file:
grep : /sys/class/net/eth*/address | sed -e 's/.*eth/eth/g' -e 's,/address:,=,' -e 's/://g' -e 's/=/=enx/' -e 's/\(.*\)=\(.*\)/\2=\1/' > /opt/unetlab/nicorder
The edit this file to match your requirement
Sample:
enx000c29709660=eth8
enx000c29709688=eth1
enx000c297096b0=eth2
enx000c2970966a=eth4
enx000c29709692=eth3
enx000c297096ba=eth5
enx000c29709674=eth6
enx000c2970969c=eth7
enx000c2970967e=eth0
enx000c297096a6=eth9
Just check your needs to match ethX(pnetX) with mac
Once your file is created,
create a new file named /etc/udev/rules.d/70-eve-nicorder-net.rules
with content:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", RUN+="/opt/unetlab/scripts/nicorder.sh"
Then create file /opt/unetlab/scripts/nicorder.sh
With content:
#!/bin/bash
if [ ! -e /opt/unetlab/nicorder ] ; then \
exit 0
fi
. /opt/unetlab/nicorder
LIVE_ID_NET_NAME_MAC=$(cat /sys/class/net/${!ID_NET_NAME_MAC}/address | sed -e 's/://g' -e 's/^/enx/')
if [ $LIVE_ID_NET_NAME_MAC = $ID_NET_NAME_MAC ] ; then exit 0 ; fi
if [ -n "${!ID_NET_NAME_MAC}" -a "${!ID_NET_NAME_MAC}" != "$INTERFACE" ] ; then \
ip link set $INTERFACE name ${!ID_NET_NAME_MAC}
if [ $? -ne 0 ] ; then \
ip link set $INTERFACE name ${!ID_NET_NAME_MAC}-new
fi
# try set every interfaces
ls -d /sys/class/net/eth* | sed -e 's,.*/,,' | grep new | while read IF
do TIF=$(echo $IF | sed -e 's/-new//')
ip link set $IF name $TIF
done
fi
Make it executable: chmod +x /opt/unetlab/scripts/nicorder.sh
Reboot your server and nic should be ordered
-
- Posts: 1
- Joined: Sat Apr 04, 2020 11:24 pm
Re: New baremetal install/proper interface not chosen for PNET0 mapping
Hi,
I have the same issue. I previously chatted with UD and RUSTY, but still have some questions. In my case pnet0 bridged with wrong interface (eth0) instead of eth4.
Ran below command:
/opt/unetlab/nicorder content is below:
eth0=enxXXXXXXXX
eth1=enxXXXXXXXX
eth2=enxXXXXXXXX
eth3=enxXXXXXXXX
eth4=enxXXXXXXXX
eth5=enxXXXXXXXX
In order to use this file for my case, I believe I need to move eth4 before eth0 ?
Regards,
I have the same issue. I previously chatted with UD and RUSTY, but still have some questions. In my case pnet0 bridged with wrong interface (eth0) instead of eth4.
Do we suppose to have pimarywizard.sh under /opt/ovf/ ? I only have ovfconfig.sh, ovfstartup.sh and ovf.xslTo fix all nic, you have to use /opt/ovf/pimarywizard.sh and to choose auto
Ran below command:
Code: Select all
grep : /sys/class/net/eth*/address | sed -e 's/.*eth/eth/g' -e 's,/address:,=,' -e 's/://g' -e 's/=/=enx/' -e 's/\(.*\)=\(.*\)/\2=\1/' > /opt/unetlab/nicorder
eth0=enxXXXXXXXX
eth1=enxXXXXXXXX
eth2=enxXXXXXXXX
eth3=enxXXXXXXXX
eth4=enxXXXXXXXX
eth5=enxXXXXXXXX
In order to use this file for my case, I believe I need to move eth4 before eth0 ?
I did, then created /opt/unetlab/scripts/nicorder.sh with the content you provided, made it executable and rebooted the server. Nothing changed.create a new file named /etc/udev/rules.d/70-eve-nicorder-net.rules
with content:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", RUN+="/opt/unetlab/scripts/nicorder.sh"
Regards,
You do not have the required permissions to view the files attached to this post.
-
- Posts: 533
- Joined: Wed Mar 15, 2017 1:54 pm
Re: New baremetal install/proper interface not chosen for PNET0 mapping
When /opt/unetlab/nicorder is created, edit it and replace eth4 by eth0 and eth0 by eth4
so
eth0=enxXXXXXXXX
eth1=enxXXXXXXXX
eth2=enxXXXXXXXX
eth3=enxXXXXXXXX
eth4=enxXXXXXXXX
eth5=enxXXXXXXXX
become
eth4=enxXXXXXXXX
eth1=enxXXXXXXXX
eth2=enxXXXXXXXX
eth3=enxXXXXXXXX
eth0=enxXXXXXXXX
eth5=enxXXXXXXXX
without touching to order... just edit the eth before the egal sign
Regards,
E.
so
eth0=enxXXXXXXXX
eth1=enxXXXXXXXX
eth2=enxXXXXXXXX
eth3=enxXXXXXXXX
eth4=enxXXXXXXXX
eth5=enxXXXXXXXX
become
eth4=enxXXXXXXXX
eth1=enxXXXXXXXX
eth2=enxXXXXXXXX
eth3=enxXXXXXXXX
eth0=enxXXXXXXXX
eth5=enxXXXXXXXX
without touching to order... just edit the eth before the egal sign
Regards,
E.