HOWTO: Add Static routes on IPCop, and add to startup
Posted by koolbeans on June 21, 2007
In my opinion, this should have been added to the web interface LONG ago…. but the IPCop folks seem determined to keep it as a SOHO firewall and nothing more….. and the vast majority of SOHO setups only deal with one subnet
route add -net 172.31.0.0 netmask 255.255.0.0 gw 192.168.0.252
To make it stick, add this command to the end of /etc/rc.d/rc.netaddress.up
Maybe they’ll finally add this to the GUI in 1.5….. hopefully a lot of other stuff as well, before the project stagnates and is surpassed by pfSense.
Sgt Bazz said
Wouldn’t you need a /sbin/ in front of the router command, aka:
/sbin/route add -net blah blah blah…..
?
koolbeans said
Not in this instance. /sbin is in the path. I have this setup in server ‘cops and the route sticks.
Must be an IPcop thing…..
carisa said
http://forum.aoa.org.ar/viewtopic.php?p=58556
Antonguido Rizzi said
A simple script for adding (and configuring in /var/ipcop/routes) static routes to hosts/networks.
I had the problem and I wroite this one.
Add this to the end of /etc/rc.d/rc.network as
. /etc/rc.d/rc.static.routes
Hope it may help
=== cut here ========
#!/bin/sh
while read net gate; do
route add -net $net gw $gate
done < /var/ipcop/routes/networks
while read host gate; do
route add $host gw $gate
done < /var/ipcop/routes/hosts
=== cut here ========
It gets /var/ipcop/routes and /var/ipcop/networks.
Form me (multiple VPNS on another machines) it works.
Here’s an example of networks
==========================
1.0.0.0/8 192.168.254.9
10.10.0.0/16 192.168.254.9
192.9.200.0/24 192.168.254.9
192.168.128.0/24 192.168.254.9
============================
Enjoy!
sesaristoteles said
route add -net 172.16.0.0/20 gw 172.17.70.254