Skip to contentSkip to conversation

sysconfig changes and problems with ip route add

LARTC Luis Miguel Cruz Miranda 3 participants 4 messages Nov 28, 2002 – Nov 29, 2002

lore
Share & tools
lore
#0 lore raw

I edited the file /etc/sysconfig/network-scripts/ifup-routes, and I add...

# Add any advanced routes
grep "^advanced" /etc/sysconfig/static-routes |
while read ignore dev args; do
if [ "$dev" = "$1" ]; then
/sbin/ip route add $args
fi
done

Then, I went to /etc/sysconfig and I created a file called static-routes with this content:
advanced eth1 194.149.216.1/32 dev vlan2 table 21
advanced eth1 194.149.216.2/32 dev vlan2 table 21
advanced eth1 194.149.216.3/32 dev vlan2 table 21
advanced eth1 0.0.0.0/0 via 10.1.0.254 table 20

Why table 21 is not loaded at boot?
:(

Quoted 35 lines · Martin A. Brown

: >/etc/iproute2/rt_tables contains a mapping of human names to routing
table
: >numbers. I call them table identifiers to table ids. This file does not : >contain routes.
: So, if I understand all correctly, I don't need that file to use multiple : route tables, do I?

You are correct. It simply maps names to numbers so that you can use something like this if you want:

# ip route add default via 10.0.0.1 table dsl-link
# ip route add default via 10.0.0.2 table t1-link

Where the rt_tables file contains:

1 dsl-link
2 t1-link

If you do not have the file /etc/iproute2/rt_tables, you can use the following syntax .

# ip route add default via 10.0.0.1 table 1
# ip route add default via 10.0.0.2 table 2

: I found a solution here:
: http://www.samag.com/documents/s=1824/sam0201h/0201h.htm

I've not seen this before and will have to read this article. Thanks for the link.

I do have some general documentation on the use of "ip route" and "ip rule" in the appendices of my documentation available here:

http://plorf.net/linux-ip/

Quoted 7 lines

Let me know if you find any flaws, areas for improvement, or missing content.

-Martin

--
Martin A. Brown --- SecurePipe, Inc. --- [email protected]

Luis Miguel Cruz Miranda.
CCNA - Systems Administrator

---------------------------------------------------------------
B2B INTEGRAL, S.A.
Pol. Ind. de Asipo
C/A - Parcela 86-C
33.428 - CAYES - LLANERA
ASTURIAS (ESPAÑA/SPAIN)
---------------------------------------------------------------
Tel: +34 985 980 804 ---- Fax: +34 985 980 794
---------------------------------------------------------------
WEB: http://www.b2bi.es/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw

Luis,

<speculation mode on>

: Then, I went to /etc/sysconfig and I created a file called static-routes : with this content:
: advanced eth1 194.149.216.1/32 dev vlan2 table 21
: advanced eth1 194.149.216.2/32 dev vlan2 table 21
: advanced eth1 194.149.216.3/32 dev vlan2 table 21
: advanced eth1 0.0.0.0/0 via 10.1.0.254 table 20
:
: Why table 21 is not loaded at boot?
: :(

is the vlan2 device up when these networking scripts are called? If I had to guess, I'd say they are not.....hard to add a route through a device that isn't there!

<speculation mode off>

-Martin

Signature · 7 lines
Martin A. Brown --- SecurePipe, Inc. --- [email protected]



_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Luis Miguel Cruz Miranda

table 21 is defined in rt_tables ?? .. it resides in dir /etc/iproute2 else might in your build directory

Quoted 14 lines · Martin A. Brown

Luis,

<speculation mode on>

: Then, I went to /etc/sysconfig and I created a file called static-routes : with this content:
: advanced eth1 194.149.216.1/32 dev vlan2 table 21
: advanced eth1 194.149.216.2/32 dev vlan2 table 21
: advanced eth1 194.149.216.3/32 dev vlan2 table 21
: advanced eth1 0.0.0.0/0 via 10.1.0.254 table 20
:
: Why table 21 is not loaded at boot?
: :(

Quoted 8 lines

is the vlan2 device up when these networking scripts are called? If I had to guess, I'd say they are not.....hard to add a route through a device that isn't there!

<speculation mode off>

-Martin

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#3 lore raw
In reply to Luis Miguel Cruz Miranda
Quoted 2 lines · Arindam Haldar

table 21 is defined in rt_tables ?? .. it resides in dir /etc/iproute2 else might in your build directory

As I know it is not neccesary

Quoted 20 lines
Quoted 8 lines · Martin A. Brown

Luis,
<speculation mode on>
: Then, I went to /etc/sysconfig and I created a file called
static-routes : with this content:
: advanced eth1 194.149.216.1/32 dev vlan2 table 21 : advanced eth1 194.149.216.2/32 dev vlan2 table 21 : advanced eth1 194.149.216.3/32 dev vlan2 table 21 : advanced eth1 0.0.0.0/0 via 10.1.0.254 table 20

Quoted 8 lines

:
: Why table 21 is not loaded at boot?
: :(
is the vlan2 device up when these networking scripts are called? If I had to guess, I'd say they are not.....hard to add a route through a device that isn't there!
<speculation mode off>
-Martin

Quoted 3 lines

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

Luis Miguel Cruz Miranda.
CCNA - Systems Administrator

---------------------------------------------------------------
B2B INTEGRAL, S.A.
Pol. Ind. de Asipo
C/A - Parcela 86-C
33.428 - CAYES - LLANERA
ASTURIAS (ESPAÑA/SPAIN)
---------------------------------------------------------------
Tel: +34 985 980 804 ---- Fax: +34 985 980 794
---------------------------------------------------------------
WEB: http://www.b2bi.es/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/