Koozali.org: home of the SME Server

Static Routes

Brent

Static Routes
« on: December 13, 2001, 06:26:09 AM »
If I have more than one static address.  Is it possible to have multiple static routes.  For example can I point a.a.a.a to 10.10.10.3 and a.a.a.b to 10.10.10.4.  I haven't seen any threads dealling with multiple static addresses.  Is it even possible.
TIA
Brent

anatole

Re: Static Routes
« Reply #1 on: December 15, 2001, 04:11:14 PM »
Yes that is possible but will require a unique and non-standard way of doing it.
You  create a executable file in the directory of /etc/rc.d/init

example touch /etc/rc.d/init/my-routes will create a file my-routes, make it executable using chmod.

the add the following lines

#!/bin/bash
ip add rule from a.a.a.a  table 100 pref 100
ip add rule from b.b.b.b table 101 pref 100
ip route add default via 10.10.10.a  dev [eth0 or ppp or /
   whatever the device is ]  table 100
ip route add default via 10.10.10.b  dev [eth1 or ppp or /
   whatever the device is ] table 101

make at symlink of the file  at /etc/rc7.d  example S15my-route link to
   /etc/rc7.d/my-routes (must be after the network is up so you don't get errors. then all should run fine.

Any comments from others may help. This is totally out of the e-smith
configuration templates, thought someone out there may know how to make one?

I used a similar routing scheme to do multiple masquerade ip address to the
internet to evenly distribute network clients for chat purposes.

Anatole

Brent Gunn

Re: Static Routes
« Reply #2 on: April 19, 2002, 06:33:17 AM »
OK, that all sounds good.  But I am a total virgin when it comes to playing with Linux.  Is there a good site or book that could translate all of what Anatole said.

For example how do you create a file in linux.  I can navigate through the directories.  That is about it.  

Thanks,
Brent

Dan G.

Re: Static Routes
« Reply #3 on: April 19, 2002, 09:38:16 AM »
My translation of what Anatole said:

I recommend you manage your system via Putty from a Windows machine.  If you don't already have it, get it here: http://www.myezserver.com/downloads/windows/putty.exe

At your command prompt, type:

touch /etc/rc.d/init/my-routes

'touch' will create an empty file named 'my-routes'

Now, at the same command prompt, type 'mc'  which will start Midnight Commander. (for a full treatment of the Midnight Commander topic, have a look at: http://www.myezserver.com/downloads/mitel/howto/midnightcommander-howto.html)

You will be presented with a blue user interface that allows you browse thru your file system --- like Windows explorer, without the mouse.  You'll need to use your arrow keys to navigate.  Arrow down and select the 'my-routes' file to open it in edit mode.  Type in Anatole's commands, press F2 to save the file, answer "Yes," and press F10 twice to close the file and Midnight Commander.

For the symbolic link Anatole mentioned, you will need to understand some Linux basics for that.  Unfortunately, that's not something you are likely to get lessons on here.  Either pick up one of the O'Reilley books on Linux, get a "Dummies" series book on it, or go to http://www.optimumnetworks.com/man-1.5i2-6.i386.rpm
Download that rpm, and install it using:

rpm -ivh man-1.5i2-6.i386.rpm

Then, type 'man ln' at the prompt, an you'll get a very arcane explanation of the process --- one you are likely to not understand at first blush.  Hey, no one said this was easy :)

As Anatole pointed out, this is the non-standard way of doing things in SME.  The 'real' way to do it is here:

http://forums.contribs.org/index.php?topic=12911.msg48657#msg48657  

but, be warned -- this involves taking the time to understand what you're doing.

In any case, make sure to keep track of where you make changes, and what changes you make, so you can fix it if things go wrong.

Dan G.

Re: Static Routes
« Reply #4 on: April 19, 2002, 09:39:47 AM »
errata:

When you select the file in Midnight Commander, you'll need to press F4 to edit it.