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

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/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!

  4. route add -net 172.16.0.0/20 gw 172.17.70.254

  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 192.168.20.0 netmask 255.255.255.0 gw 192.168.2.10 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 to carisa Cancel reply