Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Fails to grab the MAC on OpenVZ virtual server. #5

Open
powerpbx opened this issue Nov 15, 2023 · 0 comments
Open

Fails to grab the MAC on OpenVZ virtual server. #5

powerpbx opened this issue Nov 15, 2023 · 0 comments

Comments

@powerpbx
Copy link

powerpbx commented Nov 15, 2023

When this package is used on an OpenVZ virtual server with virtual interfaces it incorrectly detects venet0 as the interface for grabbing the MAC address from even though the VPS has an eth0 interface I manually create for that purpose. Since virtual interfaces venet0 and venet0:0 can not have a MAC address it fails to grab it.

ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 127.0.0.2  netmask 255.255.255.255  broadcast 0.0.0.0
        ether 00:17:54:7b:b6:4c  txqueuelen 0  (Ethernet)
        RX packets 1  bytes 76 (76.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 168 (168.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
        loop  txqueuelen 0  (Local Loopback)
        RX packets 26549593  bytes 3905852680 (3.6 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 26549593  bytes 3905852680 (3.6 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

venet0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP>  mtu 1500
        inet 127.0.0.1  netmask 255.255.255.255  broadcast 0.0.0.0  destination 127.0.0.1
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 0  (UNSPEC)
        RX packets 17385507  bytes 5207240613 (4.8 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 15444595  bytes 2569783211 (2.3 GiB)
        TX errors 0  dropped 45 overruns 0  carrier 0  collisions 0

venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP>  mtu 1500
        inet 77.25.34.23  netmask 255.255.255.255  broadcast 77.25.34.23  destination 77.25.34.23
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 0  (UNSPEC

The above MAC and public IP have been changed and are not my real ones. The eth0 interface was created for this container, specifically for attaching a MAC address to, using the following command on the physical server. $VEID is the virtual server ID #.

vzctl set $VEID --netif_add eth0 --save

I would be helpful if this package was updated to ignore virtual interfaces, such as venet0 and venet0:0, and only detect MAC capable interfaces, if they exist, instead.

@powerpbx powerpbx changed the title Fails on openVZ platforms Fails on OpenVZ platforms Nov 15, 2023
@powerpbx powerpbx changed the title Fails on OpenVZ platforms Fails to grab the MAC on OpenVZ platforms Nov 15, 2023
@powerpbx powerpbx changed the title Fails to grab the MAC on OpenVZ platforms Fails to grab the MAC on OpenVZ virtual server. Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant