core icon indicating copy to clipboard operation
core copied to clipboard

No IPv6 Web GUI access if LAN interface is set to 'Track Interface'

Open maurice-w opened this issue 2 years ago • 3 comments

Important notices

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

  • [x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [x] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Describe the bug

If a LAN interface is tracking a WAN interface and the Web GUI is configured to only listen on this LAN interface, the Web GUI is inaccessible via IPv6.

To Reproduce

Steps to reproduce the behavior:

  1. Make sure the WAN and LAN interfaces have default settings (WAN: DHCPv4 + DHCPv6 with prefix delegation, LAN: Static IPv4 + 'Track Interface' IPv6).
  2. Go to 'System: Settings: Administration', set the 'Web GUI Listen Interfaces' to 'LAN', save and reboot.
  3. See error: The Web GUI is not accessible via the LAN IPv6 address.
  4. Access the Web GUI via the LAN IPv4 address, go to 'System: Diagnostics: Services' and restart the webgui service.
  5. See result: The Web GUI is now accessible via the LAN IPv6 address.

Expected behavior

The Web GUI should be accessible via IPv6 without having to manually restart the service after a reboot.

Relevant log files

Excerpt from /var/etc/lighty-webConfigurator.conf after a reboot:

## bind to port (default: 80)
server.bind  = "127.0.0.1"
server.port  = 80
$SERVER["socket"] == "127.0.0.1:80" {
}
$SERVER["socket"] == "[::1]:80" {
}
$SERVER["socket"] == "192.168.1.1:80" {
}

After webgui service restart:

## bind to port (default: 80)
server.bind  = "127.0.0.1"
server.port  = 80
$SERVER["socket"] == "127.0.0.1:80" {
}
$SERVER["socket"] == "[::1]:80" {
}
$SERVER["socket"] == "192.168.1.1:80" {
}
$SERVER["socket"] == "[2001:db8:1234:5600:215:5dff:fed2:761b]:80" {
}

Additional context

It works when not selecting specific listen interfaces ($SERVER["socket"] == "[::]:80").

Environment

OPNsense 23.1.a_102 (amd64, OpenSSL) Hyper-V Gen2 Ver10.0

maurice-w avatar Aug 20 '22 17:08 maurice-w

Same issue for SSH. After a reboot, the tracking LAN interface's IPv6 address is missing from /usr/local/etc/ssh/sshd_config and IPv6 SSH access doesn't work. Restarting the openssh service temporarily fixes this.

Historical context seems to be #1347.

maurice-w avatar Aug 20 '22 22:08 maurice-w

I'm happy to try and tackle this while working on #5933, but it might not be a pretty outcome.

Cheers, Franco

fichtner avatar Aug 22 '22 06:08 fichtner

@maurice-w I was a bit surprised to see a newwanip event for web GUI already implemented. The issue here is that newwanip is not called for LAN, only for WAN... 745d46c could work, but is not the best thing structurally as webgui (and other things) may be loaded multiple times.

fichtner avatar Sep 08 '22 12:09 fichtner

RC1 seems to behave for the time being. Nothing to do and do another iteration if necessary.

fichtner avatar Jan 18 '23 13:01 fichtner