1
General Discussion / Re: Setting WAN interface with Gateway in different subnets
« on: July 30, 2015, 11:32:37 am »
I had the same issue with my cloud infrastructure provider, and from the research I made on Google, this is not a bug, and is the standard BSD behavior.
To bypass this problem, I made a small script to set the gateway and the route when the system starts:
Hope it helps. I put this script in a cronjob to make sure the gateway is reapplied regularly "just in case" something changes it.
To bypass this problem, I made a small script to set the gateway and the route when the system starts:
Code: [Select]
#!/bin/sh
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
route add -host IP_REMOTE_GATEWAY -iface WAN_INTERFACE_NAME
route add default IP_REMOTE_GATEWAY
Hope it helps. I put this script in a cronjob to make sure the gateway is reapplied regularly "just in case" something changes it.