LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-14-2012, 02:46 PM   #1
highland7
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Rep: Reputation: Disabled
RT_Tables and VRF simulation inside host


Hello
I use software to simulate routers, that software creates two interfaces in system for each of two interfaces of the router.
That interfaces are routed interfaces via which i can communicate with simulated router.
Lets call that interfaces:
netio0 - linux ip address 172.16.10.1, router: 172.16.10.10
netio1 - linux ip address 172.16.11.1, router: 172.16.11.10

i wanted to send packet thru that router, but normally of course when i send packet from 172.16.10.1 to 172.16.11.1 it would never be send via any of interfaces because these are locally configured interfaces (or the response problem even for static routing entries) So i used:

echo 1 VRF1 >> /etc/iproute2/rt_tables
echo 2 VRF2 >> /etc/iproute2/rt_tables
ip route add default via 172.16.10.10 dev netio0 table VRF1
ip route add default via 172.16.11.10 dev netio1 table VRF2

And created rules which for the traffic from one side to another use specific RT_Table:
ip rule add from 172.16.10.0/24 table VRF1
ip rule add from 172.16.11.0/24 table VRF2

And it works, but only partially.
Traffic from 172.16.10.1 to 172.16.11.10 (other interface of router) works fine.
Traffic from 172.16.10.1 to 172.16.11.1 is sent through router and i can sniff it on other side (netio1), but linux system never respond to that traffic.

It looks like linux kernel limitation to me: it will discard the packet from one of it's interfaces to another.
Could you confirm ?

Do you have any way to simulate VRFs on Linux ? I need independent routing tables which are really separated (like on cisco/juniper routers which are based on ...linux).

Thanks,
 
Old 11-19-2012, 04:29 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,058

Rep: Reputation: 88
You need to use VLAN interface plus ip tool to simulate VRF.
 
Old 11-20-2012, 04:08 AM   #3
highland7
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
As you see i am using ip tool to simulate VRF and it's working for me but with some limitations.
"VLAN interface " - do you mean 802.1q ?
adding 802.1q would not change anything, still i would need to accept and respond to packet from other logical interface (instead of physical interface) - and in fact i already use logical (not physical interfaces).
 
Old 11-20-2012, 03:08 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,058

Rep: Reputation: 88
My point is that the traffic can send out but system doesn't respond the incoming traffic because the VLAN isn't used.
 
Old 11-21-2012, 01:01 AM   #5
highland7
LQ Newbie
 
Registered: Nov 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
but why whould it respond if VLAN is used ?
It's just another interface. Right now it's also in another interface (netio interface).
And just to clarify: speaking VLAN you mean 802.1q ?

Thanks
 
Old 11-26-2012, 03:36 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,058

Rep: Reputation: 88
Yes, VLAN is 802.1q.
For IP rule, I think you should use iff instead of from. Please execute "ip route list VRF2" and "ip rule show".

Your:
ip rule add from 172.16.10.0/24 table VRF1
ip rule add from 172.16.11.0/24 table VRF2

Should be
ip rule add iif netio0 table VRF1
ip rule add iif netio1 table VRF2
 
  


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
Traffic Control in a vrf-patched kernel baraka Linux - Networking 0 08-29-2011 01:13 PM
NS2 network simulation problem:Change queue parameters dynamically during simulation raeisy Linux - Networking 1 11-21-2010 12:30 PM
How to resolve windows host name inside a local network. not_found Linux - Networking 3 08-26-2009 11:36 AM
How can I remove entries from /etc/iproute2/rt_tables ??? tkmbe Linux - Networking 0 01-23-2008 07:28 PM
iptables inside client to inside host with outside DNS or IP - Help! linuxhelp2 Linux - Networking 1 10-15-2005 07:19 AM


All times are GMT -5. The time now is 11:54 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration