You are not logged in.

#1 2006-12-28 14:29:24

dawid.ciezarkiewicz
Member
Registered: 2006-12-21
Posts: 12

ip route add xxxx table yyyy does not work

dpc@empire:~$ sudo ip route ls table main | grep 8.8.8.8
dpc@empire:~$ sudo ip route ls table 10
dpc@empire:~$ sudo ip route add 8.8.8.8/31 via 10.8.19.3 table 10
dpc@empire:~$ sudo ip route ls table 10
dpc@empire:~$ sudo ip route ls table main | grep 8.8.8.8
8.8.8.8/31 via 10.8.19.3 dev tun3

It seems ip route does not use table parameter at add.

dpc@empire:~$ uname -a
Linux empire 2.6.19-beyond #1 SMP PREEMPT Fri Dec 15 17:41:19 EST 2006 i686 Intel(R) Celeron(R) CPU 2.60GHz GenuineIntel GNU/Linux
dpc@empire:~$ pacman -Q iproute
iproute 061002-2

Offline

#2 2006-12-28 17:16:14

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: ip route add xxxx table yyyy does not work

I'm not sure what you are trying to say here but I'm guessing you are having a hard time adding a default gateway?

The command is:

route add default gw 10.8.19.1 eth0

Note: I'm just using a bogus IP address and assume that the NiC interface is eth0, you may adjust that to your specific needs.

To test that it works issue "route"

Hope this helps.

R

Offline

#3 2006-12-28 18:15:36

dawid.ciezarkiewicz
Member
Registered: 2006-12-21
Posts: 12

Re: ip route add xxxx table yyyy does not work

LOL

I'm talking that on Arch "ip route add" command does not use "table X" parameter and throws everything to main routing table. This is some bug. I gues headers/compilation problem or something like this.

Hope this clarify my post.

Offline

#4 2006-12-29 00:20:17

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: ip route add xxxx table yyyy does not work

ummm... a /31 gives you two hosts.

Did you try any other netmasks?
It might be that a /31 isn't "happy", because that mask is not often used (as it specifies only two hosts).
That is not a possible mask for a network, since it would only specify a network id, and a broadcast, if use on an interface.

Try a full /32 mask and see if that works.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2006-12-29 11:41:51

dawid.ciezarkiewicz
Member
Registered: 2006-12-21
Posts: 12

Re: ip route add xxxx table yyyy does not work

No, it does not. It does not make difference how many hosts netmask has.

I wish someone reproduce this and we can think where the problem is.

Offline

#6 2006-12-29 16:20:41

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: ip route add xxxx table yyyy does not work

       table TABLEID
the table to add this route to.  TABLEID may be a  number  or  a string from the file /etc/iproute2/rt_tables.  If this parameter is omitted, ip assumes the main table,  with  the  exception  of local  ,  broadcast and nat routes, which are put into the local table by default.

I tried adding an entry to the rt_tables file, but like you, I was unable to put a route into a custom table.
Did this work for you in the past kernel versions? I haven't dealt with ip route very often, as I don't do much policy based routing. I have done some source routing with it, but I have never used custom tables and routing rules.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#7 2006-12-29 16:25:38

dawid.ciezarkiewicz
Member
Registered: 2006-12-21
Posts: 12

Re: ip route add xxxx table yyyy does not work

The problem is using routing tables is quite uncommon. I've done that before on some router machines, but not on my workstation (where Arch resides) - till now. So I have now clue when was that working last time in Arch.

Offline

#8 2006-12-29 20:36:45

Bebo
Member
From: Göteborg, Sweden
Registered: 2006-06-07
Posts: 207

Re: ip route add xxxx table yyyy does not work

If you use the Arch "default" kernel I think you need to recompile it, after adding the options CONFIG_IP_ADVANCED_ROUTER and CONFIG_IP_MULTIPLE_TABLES to the config.

To use the iptables MARK target to mark packets and select a specific routing table based on this, you also need CONFIG_IP_ROUTE_FWMARK set.

Offline

#9 2006-12-30 00:34:06

dawid.ciezarkiewicz
Member
Registered: 2006-12-21
Posts: 12

Re: ip route add xxxx table yyyy does not work

Thx. I'd expect error of any kind - not such behaviour. But you are probably right. I'd do that.

Offline

Board footer

Powered by FluxBB