Map mac-address to IP VyOS

The issue is with the parameter name. In VyOS, use mac instead of mac-address. Here’s the correct syntax:

configure

# Static mapping for dmz-host-11
set service dhcp-server shared-network-name DMZ subnet 192.168.100.0/24 static-mapping dmz-host-11 mac bc:24:11:35:a9:01
set service dhcp-server shared-network-name DMZ subnet 192.168.100.0/24 static-mapping dmz-host-11 ip-address 192.168.100.11

# Static mapping for dmz-host-12
set service dhcp-server shared-network-name DMZ subnet 192.168.100.0/24 static-mapping dmz-host-12 mac bc:24:11:35:a9:02
set service dhcp-server shared-network-name DMZ subnet 192.168.100.0/24 static-mapping dmz-host-12 ip-address 192.168.100.12

set service dhcp-server shared-network-name DMZ subnet 192.168.100.0/24 static-mapping dmz-rclone-10 mac bc:24:11:35:88:10
set service dhcp-server shared-network-name DMZ subnet 192.168.100.0/24 static-mapping dmz-rclone-10 ip-address 192.168.100.10

commit
save
exit

Key difference: Use mac instead of mac-address

You can verify the configuration with:

show service dhcp-server shared-network-name DMZ

And check active leases with:

show dhcp server leases

To map MAC address 18:31:bf:bd:2d:71 to IP 192.168.51.203 in your VyOS configuration, you need to add a static DHCP mapping in the LAN network. Use these commands:

set service dhcp-server shared-network-name LAN subnet 192.168.51.0/24 static-mapping lan-host-203 ip-address '192.168.51.203'
set service dhcp-server shared-network-name LAN subnet 192.168.51.0/24 static-mapping lan-host-203 mac '18:31:bf:bd:2d:71'

Notes:

  • Replace lan-host-203 with a descriptive name for the device (e.g., printer, server, desktop, etc.)
  • The IP address 192.168.51.203 is outside your current DHCP range (.100-.199), which is good practice for static assignments
  • Both commands must use the same mapping name
  • After entering these commands, commit the changes with commit and save with save

This follows the same pattern as your existing DMZ static mappings (dmz-host-11 and dmz-host-12).

To rename the DHCP static mapping from lan-paxwin11-203 to lan-pax-win11-203, you need to delete the old mapping and create a new one with the corrected name:

Commands:

# Delete the old static mapping
delete service dhcp-server shared-network-name LAN subnet 192.168.51.0/24 static-mapping lan-paxwin11-203

# Create the new static mapping with the corrected name
set service dhcp-server shared-network-name LAN subnet 192.168.51.0/24 static-mapping lan-pax-win11-203 ip-address '192.168.51.203'
set service dhcp-server shared-network-name LAN subnet 192.168.51.0/24 static-mapping lan-pax-win11-203 mac '18:31:bf:bd:2d:71'

# Apply the changes
commit
save

Note: VyOS doesn’t support renaming configuration nodes directly, so you must delete and recreate the mapping. The device will maintain the same IP address (192.168.51.203) as long as the MAC address (18:31:bf:bd:2d:71) matches, so there should be no interruption to the host.

Leave a Reply