OPNsense Forum

Archive => 24.1, 24.4 Legacy Series => Topic started by: dennisvo on February 01, 2024, 05:03:18 PM

Title: [Solved] WAN interface magically losing IP-address after closing tcpdump
Post by: dennisvo on February 01, 2024, 05:03:18 PM
I've switched from VyOS to OPNSense (24.1.1) yesterday and I am really impressed by the product. It is easy to use, has loads of options and has a lot of extention possibilities.

I have found one issue though: the WAN interface (via a vlan0.10) doesn't receive a DHCP IPv4 address after the router is booted. When I open a console using a SSH connection, running a tcpdump to inspect the DHCP traffic (' tcpdump -i vlan0.10 -nvvv udp port 67 or udp port 68') triggers something which makes everything work all of a sudden: the WAN interface gets an IP-address and starts to magically work.

When I stop the tcpdump (ctrl-c), the traffic is stopping again, and the internet stops working. My question is: what could cause this issue? It is really strange. I've tried it five times now and five times the same result. I'm losing the internet connection unless I leave the SSH-shell open with the tcpdump running.

Please let me know which logs I need to share, I would be happy to share them if needed.
Title: Re: WAN interface magically losing IP-address after closing tcpdump on SSH-console
Post by: franco on February 01, 2024, 05:44:13 PM
Promiscuous mode to the rescue? Are you spoofing VLAN MACs without setting the parent into promiscuous mode?


Cheers,
Franco
Title: Re: WAN interface magically losing IP-address after closing tcpdump on SSH-console
Post by: franco on February 01, 2024, 05:44:55 PM
> I've switched from VyOS to OPNSense (24.1.1) yesterday and I am really impressed by the product.

PS:  :)
Title: Re: WAN interface magically losing IP-address after closing tcpdump on SSH-console
Post by: dennisvo on February 01, 2024, 06:07:15 PM
Wow, that's a fast response and might be the key, as this makes sense. I'm indeed spoofing the MAC on the vlan interface, as otherwise I wouldn't receive an IP-address from my provider :-)

Where should I change this setting? I've assigned vlan0.10 to the WAN interface. Should I set the promiscuous mode on that WAN interface? I'm asking because I can't find the option to do this on the main interface (igb0), as that interface can only be seen in the 'overview' section under 'interfaces' and there is no edit button there.

When I press the search button on the right next to igb0 it shows me some info for the device, among which:

Should I add the igb0 interface under 'Assignments' and enable it and then set it to promiscuous mode, or should I enable promiscuous mode on the WAN (vlan0.10) level? Or should I spoof the MAC-address on the hardware interface (igb0)? So many choices....  ::) :-\
Title: Re: WAN interface magically losing IP-address after closing tcpdump on SSH-console
Post by: dennisvo on February 03, 2024, 05:16:13 PM
For those with similar issues: I've found the answer:

Also the comments below VLAN WAN configuration MAC-address field reads:
"This field can be used to spoof the MAC address of the interface. Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx or leave blank if unsure. This may only be required e.g. with certain cable connections on a WAN interface. When used on a single VLAN interface the setting "Promiscuous mode" is required for this to work. Alternatively, the parent interface MAC can be spoofed applying the MAC address to all attached VLAN children automatically."

I hope this helps..
Title: Re: WAN interface magically losing IP-address after closing tcpdump on SSH-console
Post by: franco on February 04, 2024, 12:06:38 PM
Sorry, missed your last question, but what you posted is entirely correct. Thanks!


Cheers,
Franco