HOWTO: Add Static routes on IPCop, and add to startup

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 netmask gw

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.

This entry was posted in IPCop, Linux. Bookmark the permalink.

9 Responses to HOWTO: Add Static routes on IPCop, and add to startup

  1. Sgt Bazz says:

    Wouldn’t you need a /sbin/ in front of the router command, aka:

    /sbin/route add -net blah blah blah…..


  2. koolbeans says:

    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…..

  3. 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/ as

    . /etc/rc.d/rc.static.routes

    Hope it may help

    === cut here ========

    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



  4. route add -net gw

  5. Ovais says:

    How to permanently delete a route in ipcop, can anyone show it step by step

  6. deepak says:

    how nat diseble for ipcop how to cmd

  7. Richard Bade says:

    Hi, I know this is quite an old thread now but since I came across it when trying to find a solution to this problem I thought I’d add the extra thing I needed to make this work.
    We recently set up IPCop v2.0.3 and although we needed the route command mentioned here we also needed a routing rule to allow traffic to be redirected from green to green. I added a file in the startup with these two lines:

    route add -net netmask gw lan-1
    iptables -A CUSTOMFORWARD -i lan-1 -o lan-1 -j ACCEPT

    I’m not 100% sure but I may also have needed the tweak I made to the /etc/sysctl.conf changing the following items from 0 to 1:
    net.ipv4.conf.default.send_redirects = 1
    net.ipv4.conf.all.send_redirects = 1

    This is now working well for us.

  8. Sajid Ahmed says:

    Struggling with this at the moment. Added static route, added rule to iptables customforward chain I am able to ping machines on both network but not able to browse via smb or port 80 unless i add manual route. Any ideas? i have two ipcops running with version 1.4.21 & 2.1.9

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s