Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-10-2010, 04:19 AM   #1
LQ Newbie
Registered: May 2010
Posts: 7

Rep: Reputation: 0
Routing Traffic to a Virtual Network Interface

Hello all,

I am currently working on a project in my university to enhance quality of VoIP communications in a WLAN (I'm not going further with details, not the purpose of this post). For this work, I am looking for a way to route specific traffic from a physical interface to virtual interface. Not all the traffic must be forwarded (actually just the RTP traffic). The virtual interface should perform some actions on the packets received, before sending them to an other interface.

eth0 --> eth0:0 --> eth1

The problem is that I don't know how to select the packet to be transmitted from eth0 to eth0:0.

Many thanks for your precious advices and idea !
Old 05-10-2010, 04:40 AM   #2
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Are you using NAT? What are the IP addresses of your interfaces?

Your question does not really make a lot of sense, can you be more specific?

Also, run these commands and post the output here:
ip route
Old 05-10-2010, 05:10 AM   #3
LQ Newbie
Registered: May 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I am not using NAT, and not even set up the virtual interface yet.
I just have one simple internet connection, linked to my eth0 interface.
I am more looking for general tips to start conceiving the implementation.


eth0      Link encap:Ethernet  HWaddr 00:1b:24:58:d9:3e  
          inet adr:  Bcast:             Masque:
          adr inet6: fe80::21b:24ff:fe58:d93e/64 Scope:Lien
          Packets reçus:6028 erreurs:0 :0 overruns:0 frame:0
          TX packets:5632 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:5445567 (5.4 MB) Octets transmis:952514 (952.5 KB)
          Interruption:29 Adresse de base:0xe000 

lo        Link encap:Boucle locale  
          inet adr:  Masque:
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0 
          Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
ip route : dev eth0  proto kernel  scope link  src  metric 1 dev eth0  scope link  metric 1000 
default via dev eth0  proto static
I can try to be clearer:

I want my device to act like an intelligent bridge. It will receive packets on the eth0 interface. If the packet is an RTP flow, with a specific IP destination address, it will be sent to a virtual network interface. if not, the packet will be delivered normally.

In the virtual interface, all the RTP frames will be aggregated into one big multiplexed frame, before being sent to the second network interface.

Thanks for your patience guys !!
Old 05-21-2010, 03:45 AM   #4
Registered: Mar 2009
Posts: 249

Rep: Reputation: 27
Originally Posted by medized View Post
eth0 --> eth0:0 --> eth1
eth0:0 isn't a virtual interface - that is silly. Perhaps you are thinking of tun0 etc?

The problem is that I don't know how to select the packet to be transmitted from eth0 to eth0:0.
Use iptables to mark the packet then ip rule to select a routing table.
Old 05-21-2010, 05:12 AM   #5
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 295

Rep: Reputation: 31
May be something like this

/sbin/iptables -t nat -A PREROUTING -p udp --dport 10000:20000 -i eth0 -j DNAT --to

where is the address of the address of eth0:0


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
Routing traffic from one interface to another Vaelek Linux - Networking 10 05-07-2009 11:39 PM
routing over virtual interface noir911 Linux - Server 1 02-23-2009 11:47 AM
traffic has to go through the virtual interface ip address pudhiyavan Linux - Networking 2 03-27-2008 05:35 AM
Network Traffic Stats on virtual interface santhosh rao Linux - Newbie 2 02-14-2008 04:33 AM
routing traffic from one interface to another a550ee Linux - Networking 0 07-08-2007 04:28 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:08 AM.

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