opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.26k stars 725 forks source link

system: interface route (far gateway setting) not applied unless gateway becomes the default gateway #6846

Closed mitnicki closed 1 year ago

mitnicki commented 1 year ago

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

When we get a dhcp address on a WAN Interface we always get 1.2.3.4/32 masks by DHCP Server. When that happens we are able to configure the option "Far Gateway" for the Gateway. That should be enough for the interface to come up. But its not working. Far Gateway Option only works when we set interface IP to static IPV4 and configure it the same 1.2.3.4/32.

What we can see is that the opnsense doesnt get the arp resolution for the DHCP Gateway when having a Mask of /32 via DHCP.

in the logs we can see: arpresolve: can't allocate llinfo for on OPT1

furthermore we can see that there is no arp entry for the auto-detected gateway resulting in no connectivity when that interface is configured as DHCP Client.

Could you please change the behavior ? The DHCP Interface with mask /32 must be able to do a arp request for the Gateway which is not in the /32 Network of dhcp client address.. .

Thank you!

Software version used and hardware type if relevant, e.g.:

OPNsense latest version as of writing Hosted on KVM Virtual Appliance

fichtner commented 1 year ago

I don’t see any logs but assuming you have multi-WAN (multiple default gateways) it may already be fixed in the development version.

mitnicki commented 1 year ago

yes thats exactly what we are doing. sorry i forgot to mention that its a multi wan setup.

fichtner commented 1 year ago

You could try this patch: https://github.com/opnsense/core/commit/c8a5d32760

# opnsense-patch c8a5d32760

Cheers, Franco

mitnicki commented 1 year ago

i will give it a try immediately and report back. thank you so far!

Gesendet von Outlook für iOShttps://aka.ms/o0ukef


Von: Franco Fichtner @.> Gesendet: Thursday, September 14, 2023 8:09:40 AM An: opnsense/core @.> Cc: mitnicki @.>; Author @.> Betreff: Re: [opnsense/core] WAN DHCP Interfaces dont get ARP resolution of auto-detect WAN-gateway (Issue #6846)

You could try this patch: c8a5d32760https://github.com/opnsense/core/commit/c8a5d32760

opnsense-patch c8a5d32760

Cheers, Franco

— Reply to this email directly, view it on GitHubhttps://github.com/opnsense/core/issues/6846#issuecomment-1718819283, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGDBO6PU5AUZK7FQWQ2UC3TX2KNSJANCNFSM6AAAAAA4XBVJTY. You are receiving this because you authored the thread.Message ID: @.***>

mitnicki commented 1 year ago

Thats awesome. it just works right away now. now im also able to use the gateway monitoring for the additional wan interfaces. Furthermore im able to use your patch on version 23.7 and also on version 24.1 (developer).

fichtner commented 1 year ago

Careful with the patch on the development version. You may be removing it because it's already included. ;)

Cheers, Franco

fichtner commented 1 year ago

Note to self: since there wasn't a ticket before use this one. It's marked bug but the scope is quite small. This needs a bit more time before being merged to 23.7.x.

mitnicki commented 1 year ago

Careful with the patch on the development version. You may be removing it because it's already included. ;)

Cheers, Franco

One last question concerning the patch you supplied; do i get in trouble with further updates on community release channel? I mean.. do we lose the patch when the next update runs ?

fichtner commented 1 year ago

Yeah, the release state is enforced scrubbing patches applied that are not part of the release. E.g. 23.7.4 today will remove the patch again so you need to reapply. I'm trying to get the patch into 23.7.5 but I'm not sure yet.

Cheers, Franco

gionag commented 1 year ago

You could try this patch: c8a5d32760

# opnsense-patch c8a5d32760

Cheers, Franco

for what is worth, similar problem of the OP, patch solved the problem also for me. i suggest to promote it

fichtner commented 1 year ago

Yeah, as I said it’s on the table for inclusion in 23.7.5.

gionag commented 1 year ago

thanks for that, i was just highlighting the effectiveness of the patch.