In recent days I was confronted with a problem regarding the routing under Linux.
The request was to add a route on a Proxy ARP server.
The Linux OS does give you the possibility to do add a route, in an “automatic mode”, in ways like:
- add a route on the interface configuration (it will be applied only when the interface will go on-line) – for example Ubuntu and SUSE Linux
- add a route on the network start script
- add a route in the static-routes file
- add a route with a script on the ifup folder on the “/sbin/ifup” (here more details: http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlsysconfig.html)
But because this was a complicated setup I was forced to use a bash script under the “/sbin/ifup”.
The script looked like this:
DMZ_INTERFACE=”eth0″ #we should have an IP address on this network – 220.127.116.11/24
LAN_INTERFACE_1=”eth1″ #we should have an IP address on this network – 10.12.0.0/24
EXTIPADDR=”18.104.22.168″ #an dmz gateway
INTIPADDR=”10.12.0.254″ #all the internal traffic
$ROUTE_CMD add -host 22.214.171.124 gw $EXTIPADDR $DMZ_INTERFACE
$ROUTE_CMD add default gw $INTIPADDR $LAN_INTERFACE_1
I hope that this is going to help you,