1
20.1 Legacy Series / Re: IPSEC tunnel config changes Opnsense host IP in /etc/hosts
« on: December 21, 2020, 02:32:54 pm »
I'm digging up this old topic in case anyone else runs into this edge case and finds this thread.
The 2nd line of the /etc/hosts file is generated with the IP address of the first interface when sorting by interface name (so LAN first, then OPTx, then WAN).
I have no LAN interface (only OPT's) and at some point removed OPT1 because it was not being used anymore. OPT2 is my primary "LAN" network. As a result, when I set up Wireguard, the interface was assigned OPT1, so it comes first in the system.inc sort() job mentioned by Charlie above and the Wireguard/VPN IP gets added to the hosts file.
Workaround that worked for me: I temporarily removed the Wireguard interface (you will lose the firewall rules), created a dummy interface that gets assigned opt1, then added back the Wireguard interface (now as opt5).
The 2nd line of the /etc/hosts file is generated with the IP address of the first interface when sorting by interface name (so LAN first, then OPTx, then WAN).
I have no LAN interface (only OPT's) and at some point removed OPT1 because it was not being used anymore. OPT2 is my primary "LAN" network. As a result, when I set up Wireguard, the interface was assigned OPT1, so it comes first in the system.inc sort() job mentioned by Charlie above and the Wireguard/VPN IP gets added to the hosts file.
Workaround that worked for me: I temporarily removed the Wireguard interface (you will lose the firewall rules), created a dummy interface that gets assigned opt1, then added back the Wireguard interface (now as opt5).