LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-27-2012, 10:14 PM   #1
donalbane
LQ Newbie
 
Registered: Jan 2011
Location: Austin, TX
Posts: 29

Rep: Reputation: 2
Question iproute2 in Debian lenny adds routes to the main table instead of desired table


I perform the following:
[1]Add "1 lan" to /etc/iproute2/rt_tables.
[2]Type "ifconfig eth2 up" to bring up eth2, and verify that there are no routes for it by typing "ip route show"
[3]Type "ip route add XXX.XXX.XXX.XXX dev eth2 table lan"
[4]Type "ip route add default via XXX.XXX.XXX.XXX dev eth2 table lan"
[5]Type "ip route flush cache"
[6]Type "ip route show table lan". There is no response.
[7]Type "ip route show table main". There are the routes that I added in steps [3] & [4].
Can someone tell me why the routes are added to the main routing table instead of to the lan table? The kernel version is 2.6.21.

Don
 
Old 03-28-2012, 02:53 AM   #2
nikmit
Member
 
Registered: May 2011
Location: Nottingham, UK
Distribution: Debian
Posts: 178

Rep: Reputation: 34
I add routing tables by simply specifying them when adding the route, like in
ip route add default table 8 dev tun0
ip route show table 8
default dev tun0 scope link

I think it adds the routes to the default table because it doesn't recognise the named table you defined in the config file.
Did you restart the service/reboot after the changes in the config file?
 
Old 03-28-2012, 09:29 AM   #3
donalbane
LQ Newbie
 
Registered: Jan 2011
Location: Austin, TX
Posts: 29

Original Poster
Rep: Reputation: 2
Yes, I executed "/etc/init.d/networking restart" after making the changes to rt_tables. I also just tried adding the route with a number like you did, but that didn't work either:

tcors01:/etc# ip route show
192.168.128.0/24 dev eth3 proto kernel scope link src 192.168.128.101
129.116.134.0/24 dev eth2 proto kernel scope link src XXX.XXX.XXX.XXX
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1
tcors01:/etc# ip route add default table 1 dev eth2
tcors01:/etc# ip route show table 1
tcors01:/etc# ip route show table main
192.168.128.0/24 dev eth3 proto kernel scope link src 192.168.128.101
129.116.134.0/24 dev eth2 proto kernel scope link src XXX.XXX.XXX.XXX
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1
default dev eth2 scope link
tcors01:/etc#

Don
 
Old 03-28-2012, 11:01 AM   #4
donalbane
LQ Newbie
 
Registered: Jan 2011
Location: Austin, TX
Posts: 29

Original Poster
Rep: Reputation: 2
I upgraded iproute2 from the lenny version to the squeeze version (20100519-3), but this did not seem to make a difference.

I went ahead and rebuilt the kernel adding:
CONFIG_NETFILTER_XTABLES=m
CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
to the kernel configuration. I don't think they are required for iproute2, but I know that they are required for other things (Shorewall), so I put them in there.

After rebooting, I get the expected behavior from the "ip route add ... table lan" command. I'm not sure what the magic bullet was, but it is working for the moment, so I will mark this thread as solved.

Don
 
  


Reply

Tags
add, iproute2, lenny, route, table



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
quagga, bgp default routes not installed in linux routing table saiyen2002 Linux - Networking 0 12-08-2010 03:12 PM
using netlink to get routes from a specific routing table fzansari Linux - Networking 0 05-04-2009 12:51 PM
access paging table memory using another page table via MMU? valpa Linux - Kernel 8 08-26-2008 03:26 PM
MySQL :: Table in query adds significant delay lackluster Programming 7 07-10-2004 03:48 AM
How to import MS ACCESS Table including OLE filed into the MySQL Table ? myunicom Linux - General 1 11-28-2003 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration