netbox-proxbox icon indicating copy to clipboard operation
netbox-proxbox copied to clipboard

Get Network information from Proxmox (IP address from VM's and Containers, MAC address, etc...)

Open emersonfelipesp opened this issue 3 years ago • 0 comments

Discussed in https://github.com/netdevopsbr/netbox-proxbox/discussions/51

Originally posted by quiknick May 10, 2022 Currently only LXC container IPs and interfaces are recorded, but not VM IPs, MACs, interfaces and hostnames, even with QEMU agent installed.

Option 1: use qemu-guest-agent to get info

apt install qemu-guest-agent enabling the Guest agent flag in the VM config (in the GUI -> VM -> 'Options')

Proxmox VM Summary now lists IP and actual interface.

Use pvesh commands in following comment to get interface name, IP address and hostname.

Option 2: Use arp to get basic IP info

Look for the mac address in the configuration of the vm. In my example: vmid = 1176

Code: ~# qm config 1176 | grep net boot: order=scsi0;ide2;net0 net0: virtio=4E:57:9F:01:4E:6F,bridge=vmbr12,firewall=1

Now you can use "arp" to get the current IP address from the MAC:

Code: ~# arp -n | grep -i 4E:57:9F:01:4E:6F 10.12.4.59 ether 4e:57:9f:01:4e:6f C vmbr12

emersonfelipesp avatar May 12 '22 11:05 emersonfelipesp