LinuxQuestions.org
Visit Jeremy's Blog.
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 08-13-2009, 12:06 PM   #1
docawk
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Rep: Reputation: 0
iproute2 - eth1 'RTNETLINK answers: Invalid argument'


I just added another NIC to a machine that I want to connect to a different LAN area. Usually I never had problems setting up routing via iproute2 utilities.
The newly added NIC has eth1 assigned via udev (in boot process eth0 is assigned, but I need that interface name to be associated to the existing internet bound 100mBit line)

I am running Debian 'lenny' with kernel 2.6.30.3 (quite all network options compiled in).

Setting up the interface via /etc/network/interfaces
Code:
iface eth0 inet static
        address XXX.XXX.250.188
        netmask 255.255.255.248
        network XXX.XXX.250.184
        broadcast XXX.XXX.250.191
        gateway XXX.XXX.250.186

auto eth1
iface eth1 inet static
        address 192.168.11.11
        netmask 255.255.255.0
        network 192.168.11.0
        broadcast 192.168.11.255
works fine and shows in 'ip route' properly

XXX.XXX.250.184/29 dev eth0 proto kernel scope link src XXX.XXX.250.188
192.168.11.0/24 dev eth1 proto kernel scope link src 192.168.11.11
default via XXX.XXX.250.186 dev eth0

The way I want to act is introducing the default gateway on eth0 in the main routing table and set up a separate tabel for routing packets destinated to LAN.

Code:
/sbin/ip route flush table main
/sbin/ip route add XXX.XXX.250.186 dev eth0 src XXX.XXX.250.189
/sbin/ip route add 192.168.11.11 dev eth1 src 192.168.11.9
RTNETLINK answers: Invalid argument
/sbin/ip route add default via XXX.XXX.250.186 dev eth0
/sbin/ip route flush cache
So it seems to me to iproute2 eth1 is not valid.
Anybody a suggestion?

Thanks
 
Old 08-13-2009, 02:37 PM   #2
docawk
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Problem solved. My fault.

wrong way to use ip route. Should add destination with source address on interface, not mixed up.

Code:
/sbin/ip route add XXX.XXX.250.184/29 dev eth0 src XXX.XXX.250.189
/sbin/ip route add 192.168.11.0/24 dev eth1 src 192.168.11.11
/sbin/ip route add default via XXX.XXX.250.186 dev eth0
/sbin/ip route flush cache
works fine;-)

Thanks anyways.
 
Old 09-24-2009, 08:34 AM   #3
mgautam
LQ Newbie
 
Registered: Jun 2009
Posts: 8

Rep: Reputation: 0
Can't add a default route via ip utility

Hi,

I am facing a similar problem. I am using ip utility on Linux 2.6.26 to create a default route. A simple configuration like below is giving me error -RTNETLINK answers: No such process

machine-1
eth0:192.168.1.2

machine-2
eth0:192.168.1.1
eth1: 172.1.1.1

I want to ping 172.1.1.1 from 192.168.1.2 via ip rules only. Main routing table does not contain any entry. Here are the commands that I give on machine-1:

Code:
ip rule add from 192.168.1.2 iif lo table eth0tbl
ip rule add to 192.168.1.2 iif eth0 table eth0tbl
Added route to eth0tbl -
Code:
ip route add 192.168.1.0/24 dev eth0 table eth0tbl
This succeeds.

Now I am trying to add default gw to eth0tbl.
Code:
ip route add default via 192.168.1.1 dev eth0 table eth0tbl
RTNETLINK answers: No such process
I have tried adding default route to the main table but gives same error.
Code:
ip route add default via 192.168.1.1 dev eth0
RTNETLINK answers: No such process
I am not sure what am I doing wrong. Could you help me locate the problem.

Many thanks

Last edited by mgautam; 09-25-2009 at 04:39 AM.
 
Old 09-25-2009, 08:25 AM   #4
mgautam
LQ Newbie
 
Registered: Jun 2009
Posts: 8

Rep: Reputation: 0
Problem solved -

I was flushing the Main table before creating the default gateway.

Perform all the operations first, to enable the gateway reachable via the host network route entry. Then add the default gateway entry in the table you want. And lastly flush the Main and the cache tables.

Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] RTNETLINK answers: File exists - Error when doing ifup on alias (eth1:1) on RHEL5 MensaWater Linux - Networking 17 04-12-2015 07:32 AM
RTNETLINK answers: Invalid argument rebel Linux - Newbie 1 04-24-2011 10:52 PM
fedora core 4, RTNETLINK: Invalid argument? silex_88 Linux - Networking 2 08-26-2005 01:41 AM
RTNETLINK answers: Invalid argument j-me Linux - Networking 1 04-23-2004 03:38 AM
eth0 and eth1 RTNETLINK answers: File existslike RT trouble....need some helpHello pierrot Linux - Networking 0 08-09-2003 03:23 PM

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

All times are GMT -5. The time now is 07:31 PM.

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