dhclient fails to get WAN route

Started by aida, August 23, 2022, 07:26:57 AM

Previous topic - Next topic
So I am replacing an old router which works fine in bridge mode. In that configuration dhcpcd was run and was able to obtain the WAN IP, routes and necessary information. It uses a very standard IPOE configuration to my ISP that has no additional settings.

I've found though when trying to do the same thing with opnsense, it appears to get an IP but no route. For exmaple if I ping something out on the internet I get "no route to host".

My WAN interface does have an IP address:

aida@opnsense:~ % ifconfig igb3
igb3: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: WAN
        options=4800028<VLAN_MTU,JUMBO_MTU,NOMAP>
        ether xx:xx:xx:xx:xx:xx
        hwaddr xx:xx:xx:xx:xx:xx
        inet6 xxxx:xxxx:xxxx:101::1 prefixlen 64
        inet6 fe80::c225:e9ff:feac:xxxx%igb3 prefixlen 64 scopeid 0x4
        inet 203.123.115.61 netmask 0xffffff00 broadcast 203.123.115.255
        inet 192.168.0.1 netmask 0xfffffffc broadcast 192.168.0.3
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>


Here's my routing table:

aida@opnsense:~ % netstat -r
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            203.123.115.1      UGS        igb3
119.40.106.35      203.123.115.1      UGHS       igb3
119.40.106.36      203.123.115.1      UGHS       igb3
localhost          link#7             UH          lo0
192.168.0.0/30     link#4             U          igb3
192.168.0.1        link#4             UHS         lo0
192.168.10.0/24    link#1             U          igb0
opnsense           link#1             UHS         lo0
192.168.11.0/24    link#2             U          igb1
opnsense           link#2             UHS         lo0
203.123.115.0/24   link#4             U          igb3
203.123.115.61     link#4             UHS         lo0

aida@opnsense:~ % route get 8.8.8.8
   route to: 8.8.8.8
destination: default
       mask: default
    gateway: 203.123.115.1
        fib: 0
  interface: igb3
      flags: <UP,GATEWAY,DONE,STATIC>
recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         1         0


What's more is that opnsense seems to work correctly in exactly the same configuration if I put it behind my modem (in router mode) or another router.

I did notice in the logs a few "no route to host" errors from dhclient.

I'm wondering if it's timing out or something because I noticed that with my old linux router I was generally unable to get a WAN IP on boot and would have to run "dhcpcd -z <wan interface>" to get a net connection. Sometimes then I would have to run it a few times to get a lease.

August 25, 2022, 03:10:10 PM #1 Last Edit: August 26, 2022, 04:56:13 AM by aida
So I figured out what was causing this. Seems when I try to spoof the MAC address on the WAN interface this happens. I made the WAN MAC address one character off my modem so it would appear with a common OUI.

It's pretty unlikely the ISP has that MAC on their network already. I wonder how they can tell its not real? I didn't buy my modem from them so it's not on some registered list or anything like that.

The appliance is a DEC3840 sold by opnsense, so that has intel i210 interfaces.