1
General Discussion / DMZ static IP hosts getting LAN default route
« on: July 14, 2020, 03:11:24 pm »
Hi
I'm fairly new to OPNSense but loving it so far. However, I've encountered an odd issue with my DMZ hosts.
I've a host in my DMZ running Debian 9 with a static IP configuration which includes the DMZ interface of the OPNSense box as the default gateway. However, when this server restarts it has the LAN interface of the OPNSenese box as it's default route?!?!?
I'm assuming the server is getting a default route advertised by OPNsense as, if I start the server with the NIC disconnected the route is as expected but as soon as I connect the NIC the default route changes.
I've tried enabling DHCP on the DMZ interface with the correct default gateway but it doesn't make any any difference (the server isn't using DHCP anyway)
OPNsense 20.1.8_1-amd64
/etc/network/interfaces (on the Debian 9 server)
Routing table with NIC disconnected (ip -r)
Routing table with NIC connected
192.168.28.254 is the LAN IP of the OPNSense box
I can address the issue by adding
Any help much appreciated.
I'm fairly new to OPNSense but loving it so far. However, I've encountered an odd issue with my DMZ hosts.
I've a host in my DMZ running Debian 9 with a static IP configuration which includes the DMZ interface of the OPNSense box as the default gateway. However, when this server restarts it has the LAN interface of the OPNSenese box as it's default route?!?!?
I'm assuming the server is getting a default route advertised by OPNsense as, if I start the server with the NIC disconnected the route is as expected but as soon as I connect the NIC the default route changes.
I've tried enabling DHCP on the DMZ interface with the correct default gateway but it doesn't make any any difference (the server isn't using DHCP anyway)
OPNsense 20.1.8_1-amd64
/etc/network/interfaces (on the Debian 9 server)
Code: [Select]
iface eth0 inet static
address 192.168.29.2
netmask 255.255.255.0
gateway 192.168.29.254
Routing table with NIC disconnected (ip -r)
Code: [Select]
default via 192.168.29.254 dev eth0 onlink linkdown
192.168.29.0/24 dev eth0 proto kernel scope link src 192.168.29.2 linkdown
Routing table with NIC connected
Code: [Select]
default via 192.168.28.254 dev eth0 src 192.168.29.2 metric 202
192.168.28.254 dev eth0 scope link src 192.168.29.2 metric 202
192.168.29.0/24 dev eth0 proto kernel scope link src 192.168.29.2 metric 202
192.168.28.254 is the LAN IP of the OPNSense box
I can address the issue by adding
Code: [Select]
up route add default gw 192.168.29.254
to the interfaces file but I'm curious as to where the default route information is coming from and how to set it correctly?Any help much appreciated.