Opnsense box stuck with 0.0.0.0 wan ip

Started by verytiredstudent, October 28, 2023, 09:32:06 PM

Previous topic - Next topic
Heres my setup: isp cable line -> arris sb8200 modem -> opnsense box (bare metal) -> tp link sg1008mp switch -> computers, ap, etc.

I cannot for the life of me figure out why my opnsense box cannot get an ip from my modem. Throughout the entire time of me troubleshooting this, I was always capable of plugging another regular computer into it, and getting working internet. Things I tried:


  • I've reinstalled opnsense, rebooted the box, rebooted the modem, more times than I could ever remember at this point
  • Checked all of the cables to make sure they worked, they all worked
  • Knew it was pretty old and probably very cheap nics in the opnsense box, so I got some tp link ue300's to use as a sanity check
  • Disabled all the things that I thought could be causing issues: firewall, ids/ips, blocking of private and bogon networks
  • Spoofed the mac address of the router modem combo the isp gave me
  • Spoofed the hostname of the router modem combo the isp gave me
  • I tried to force opnsense to use ipv6 only since it automatically created a ipv6 gateway for me, however through testing it seemed like my isp only ever supported ipv4. I then tried forcing opnsense to only use ipv4, but still nothing
  • I thought maybe this was some weird double nat stuff, so I called my isp and had them put the router into bridge mode (kinda crazy I couldn't just do that myself but thats another rant) and tried all the stuff again
  • I still had wifi even after the bridge mode change, so I thought maybe they were using that weird hybrid mode and it'd be better if I replaced the whole thing with a standalone modem, so I got the sb8200 and tried all the stuff again

I've attached the packet capture of the wan interface using the setup I described in the beginning of the post (only difference being my laptop is plugged into the back of the modem as well so I have internet to post this with). Admittedly, this a bit of uncharted territory for me here, as I typically deal with things like my lets encrypt ssl certificates not working, not my router straight up not having an ip address and having to analyze individual packets. I looked up what they meant and tried to fix things from there but got nowhere

Before 23.1:
Add a manual nat with source 0.0.0.0/32 to nat outbound

After 23.1:
No idea :/

This is about address assignment never going past 0.0.0.0, yes?


Cheers,
Franco

Quote from: franco on October 28, 2023, 11:02:59 PM
This is about address assignment never going past 0.0.0.0, yes?


Cheers,
Franco

Yes, it has never changed from 0.0.0.0 throughout all the things I tried. I believe the only thing that ever changed was getting an ipv6 link local address if I set it to ask for a prefix and not a ipv6 address

The problem appears to be that the ISP/upstream router won't or can't reach you for the final phase of the DHCP. Did you have another router here that works? Try to spoof the OPNsense WAN to its MAC address if you can find it.

In any case I'd recommend a packet capture on the WAN to see when the DHCP sequence stops. It might give a clue which side is to blame.


Cheers,
Franco

I unfortunately do not have any router on-hand aside from the combo my isp gave, which I'm pretty sure they disabled once I had to call in the swap to my own modem. What I can do is take that packet capture. Tell me if I did this wrong, I had opnsense release the dhcp lease on the wan interface, I unplugged the ethernet cable from the back, waited 30 seconds, I started a packet capture on the wan interface in promiscuous mode, I plugged the ethernet cable back in, and I stopped the capture once both dhcpv4 and dhcpv6 were back up (at least according to the wan interface overview anyways). I've attached that packet capture here

October 28, 2023, 11:52:42 PM #6 Last Edit: October 29, 2023, 12:02:31 AM by Maurice
Maybe start from scratch. USB Ethernet, MAC spoofing... That sounds like it could only make it worse. Make sure you have properly supported NICs before going any further.

The packet captures are very weird. Assuming 2c:86:d2:89:10:19 is the CMTS and 00:05:1b:db:54:be is the OPNsense USB WAN NIC:

In the first packet capture, OPNsense isn't sending anything related to DHCPv4, Router Solicitations or DHCPv6. But a bunch of mDNS, LLMNR and even NetBIOS(!) name resolution attempts. That's something you would expect only in a LAN.
The second packet capture doesn't have anything originating from OPNsense.

Multiple devices connected directly to a cable modem isn't supported by many ISPs. Typically, you even have to reboot the cable modem once the device connected to it changes.

Oh, and your ISP sends Router Advertisements, indicating they actually do support IPv6.

Cheers
Maurice

[edit] Don't use promiscuous mode for the packet captures, that's quite possibly not properly supported by your USB NIC. [/edit]
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Quote from: Maurice on October 28, 2023, 11:52:42 PM
Maybe start from scratch. USB Ethernet, MAC spoofing... That sounds like it could only make it worse. Make sure you have properly supported NICs before going any further.

The packet captures are very weird. Assuming 2c:86:d2:89:10:19 is the CMTS and 00:05:1b:db:54:be is the OPNsense USB WAN NIC:

In the first packet capture, OPNsense isn't sending anything related to DHCPv4, Router Solicitations or DHCPv6. But a bunch of mDNS, LLMNR and even NetBIOS(!) name resolution attempts. That's something you would expect only in a LAN.
The second packet capture doesn't have anything originating from OPNsense.

Multiple devices connected directly to a cable modem isn't supported by many ISPs. Typically, you even have to reboot the cable modem once the device connected to it changes.

Oh, and your ISP sends Router Advertisements, indicating they actually do support IPv6.

Cheers
Maurice

I have no clue about the why behind the weird packets, in regards to the lan packets I can try redoing that packet capture after having rebooted the modem and only having the opnsense box connected? A quick google search has people reporting that my isp gives a separate ip for each port, which does go in line with the person I spoke with on the phone encouraging me to test for internet access on my laptop using both ports (granted this was for the combo unit specifically and not the arris sb8200)

Your ISP may or may not support multiple devices connected to the modem. Try connecting only OPNsense and reboot the modem. Perform a packet capture on the WAN interface without promiscuous mode.
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Quote from: Maurice on October 29, 2023, 12:07:19 AM
Your ISP may or may not support multiple devices connected to the modem. Try connecting only OPNsense and reboot the modem. Perform a packet capture on the WAN interface without promiscuous mode.

Here's the capture

Not a single frame sent by OPNsense. Something is very off.
I'd really start from scratch with proper NICs. What "very cheap and old" NICs does your device have?
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Quote from: Maurice on October 29, 2023, 12:35:42 AM
Not a single frame sent by OPNsense. Something is very off.
I'd really start from scratch with proper NICs. What "very cheap and old" NICs does your device have?

According to pciconf it is a rlt810xE nic

As a side note, I think I may have been told some false information, I was under the impression this laptop was easily a decade old based off what my parents told me when I bought it off them. I'm pleasantly surprised that this laptop is only 5 ish years old (if the CPU is anything to go by anyways)

A couple things I've tried since: I downloaded the files to make the realtek driver plugin, copied them to my computer and then copied them over ssh to the box. Drivers unfortunately did not change anything.

Now here's the good news: I thought maybe I'd have better luck having proxmox make the DHCP request, it running on linux rather than bsd. And I was right, proxmox can get a DHCP offer from my modem no problem. So it's not the nics being faulty, they work. Now here's the bad news: even though proxmox has a working public IP address, opnsense still reports a 0.0.0.0 IP address for the wan. I might be just passing the network devices to opnsense incorrectly, but I if I'm not I really don't know what else to do