ClearOS Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Managing Static Routes

This document describes how to configure a static route on a ClearOS system.

Configuration

Static routes on a ClearOS system are associated with a particular network interface. The route is then enabled/disabled when the particular network interface is enabled/disabled. Here is a simple scenario:

  • A ClearOS LAN interface - eth1 - is configured with a 192.168.1.x network.
  • A private building-to-building wireless connection is configured via a wireless router. One side of the wireless router is connected to the ClearOS LAN at 192.168.1.100. The other side of the wireless router is connected to a 192.168.99.x LAN.

In order for the ClearOS gateway to be aware of the remote 192.168.99.x LAN, a static route must be configured. In this example, /etc/sysconfig/network-scripts/route-eth1 is created with the following:

192.168.99.0/24 via 192.168.1.100

After adding this static route, the route can be activated by re-enabling the ClearOS LAN interface:

/sbin/ifup eth1

If you are adding routes to a routing table with existing routes present, you can use the above command to load the new routes. You will get a number of 'route already exists error messages' for those entries where routes exist.

If you are changing or deleting a route which has previously been defined, the above command will run, but the new route will not take effect.

In this scenario you need to re-load the routing table:

/sbin/ifdown eth1
/sbin/ifup eth1

This command will take the associated network down. - be aware of the network you are connected from

(It might be a good idea to do this from the console if possible). If you have no access to the console and wish to do it remotely try:

/sbin/ifdown eth1 && /sbin/ifup eth1

(must be entered on the same line, which will try to re-load after taking it down).

If you are using Multi-WAN, then you also need to restart the firewall:

/sbin/service firewall restart

Additional LAN Networks

If you have other LAN networks connected behind your ClearOS gateway, you need to configure these on the system. You can add extra networks in /etc/clearos/network.conf (/etc/system/network in ClearOS 5.x). The format is:

  • EXTRALANS=“LAN1 LAN2 … LANx”

For example:

EXTRALANS="192.168.4.0/24 192.168.5.0/24"

If you make this change, then you also need to restart the firewall:

/sbin/service firewall restart
content/en_us/kb_bestpractices_managing_static_routes.txt · Last modified: 2015/11/12 16:12 (external edit)

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Akb_bestpractices_managing_static_routes&1563610978