think tank forum

technology » networking for a laptop with ethernet and wifi

lucas's avatar
2 years ago
link
lucas
i ❤ demo
use case:
one local ethernet subnet is available using gigabit ethernet or 802.11abgn.

the laptop user often uses wifi, but will connect to ethernet if she wants additional bandwidth.

she runs windows 7 on the laptop, and has a program that disables her wifi adapter when she connects to ethernet, to avoid routing problems caused by two interfaces on the same local subnet.

what is the best way to configure the DHCP and DNS services to accommodate this use case?
lucas's avatar
2 years ago
r4, link
lucas
i ❤ demo
SOLUTION ONE

dhcpd.conf
option domain-name "mydomain.com";

subnet 10.6.6.0 netmask 255.255.255.0 {

    option routers 10.6.6.1;
    option domain-name-servers 10.6.6.1;
    option time-servers 10.6.6.1;

    use-host-decl-names on;

    host calliope {
        # thinkpad x220
        hardware ethernet AA:BB:CC:DD:EE:FF; # wireless
        hardware ethernet DE:AD:BE:EF:00:00; # ethernet
        fixed-address calliope;
    }


the daemon seems OK with that:
$ sudo dhcpd -n vr1
$ sudo dhcpd vr1
$


dhcpd will lease the address for calliope to the first request from either mac address. but then if the other mac address asks for a dhcp lease, dhcpd assigns a lease from the pool (if any), as the address for calliope is already leased to another mac. not quite what i want.
lucas's avatar
2 years ago
r3, link
lucas
i ❤ demo
SOLUTION TWO

same dhcpd.conf as before, but now "calliope" will resolve to two IP addresses.

dns zone:
calliope            IN A 10.6.6.6       ; thinkpad x220
                    IN A 10.6.6.7       ; thinkpad x220


ok, that works:

$ sudo rndc reload
server reload successful
$ nslookup calliope
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   calliope.mydomain.com 
Address: 10.6.6.6
Name:   calliope.mydomain.com 
Address: 10.6.6.7

$


curious to see what dhcpd will do! killed it, checked config, and started it in foreground.

$ sudo dhcpd -n vr0
$ sudo dhcpd -d vr0


doesn't seem to work. :(

trying to read https://github.com/openbsd/src/blob/master/us … ars.c#L892 but struggling to figure out if the code allows multiple hardward addresses and ip addresses for a host.
lucas's avatar
2 years ago
r1, link
lucas
i ❤ demo
i'm insane, and ttf is a place i come to talk to myself :)
bluet's avatar
2 years ago
link
bluet
https://en.wikipedia.org/wiki/Multicast_DNS if you can live with calliope.local :>