Multi-homed IPv4, dnsmasq on only one of them

21.02.0-rc3 Acher C7

Trying to setup a dedicated testbench router, so I do not have to keep replugging and hardcoding the ethernet of my laptop.

The idea is roughly LAN become BENCH, WAN becomes LAN; no NAT but normal routing, and still firewalled. This way I have a isolated net to play with. It may not always be network stuff, but also camera's and other devices my friends and family brings me to fix/tune/update for them. I am getting tired of always messing with my laptop IP settings to pick up whatever address the device may be set to.

Apart from a 'normal' subnet on the BENCH, normally dhcp'ed and gatewayed, I also would like a selection of static addresses: 192.169.0.2 192.168.1.2 that I may or may not alter as needed.

The issue is: DHCP / dnsmasq stops serving addresses as soon as I add those?
So question is, how to
a) ensure it serves at all on a multi-homed interface
b) ensure it -only- serves -one- of those multi-homed IP's (192.168.18.x below)

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fda3:e4e5:d04e::/48'

config device
        option name 'br-bench'
        option type 'bridge'
        list ports 'eth1.1'

config interface 'bench'
        option device 'br-bench'
        option proto 'static'
        option ip6assign '60'
        list ipaddr '192.168.18.1/24'
        list ipaddr '192.168.0.2/24'
        list ipaddr '192.168.1.2/24'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.2'

config interface 'lan'
        option device 'br-lan'
        option proto 'dhcp'

config interface 'lan6'
        option device 'br-lan'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '0t 3 4 5'
        option description 'CPU to BENCH'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option vid '2'
        option ports '6t 2 1'
        option description 'CPU to LAN'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option vid '3'
        option description 'Extra VLAN'
        option ports '3t'
1 Like

Follow up additional info, but not relevant to the question:

The idea is also that one of the switch ports can be, if needed, a switch mirror/monitor port that does go back to my laptop via an additional USB/ETH adapter, not even getting its own IP address, simply so I can run Wireshark on it.

That has the added benefit wireshark is cleaner, because the extra USB/Eth does not have its own address, so all sorts of advertisements and broadcasts are not send out by the laptop itself, nor will it have any googling and browsing I do.

1 Like

Nice, works perfectly, thanks!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.