LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-10-2010, 03:19 AM   #1
medized
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, 03:40 AM   #2
SuperJediWombat!
Member
 
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:
Code:
ifconfig
ip route
iptables-save
 
Old 05-10-2010, 04:10 AM   #3
medized
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.


Code:
ifconfig

eth0      Link encap:Ethernet  HWaddr 00:1b:24:58:d9:3e  
          inet adr:213.100.46.180  Bcast:213.100.46.191             Masque:255.255.255.192
          adr inet6: fe80::21b:24ff:fe58:d93e/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          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:127.0.0.1  Masque:255.0.0.0
          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)
Code:
ip route :

213.100.46.128/26 dev eth0  proto kernel  scope link  src 213.100.46.180  metric 1 
169.254.0.0/16 dev eth0  scope link  metric 1000 
default via 213.100.46.129 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, 02:45 AM   #4
TimothyEBaldwin
Member
 
Registered: Mar 2009
Posts: 249

Rep: Reputation: 27
Quote:
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?

Quote:
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, 04:12 AM   #5
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 321

Rep: Reputation: 33
May be something like this

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

where 192.168.0.2 is the address of the address of eth0:0
 
  


Reply



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

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

All times are GMT -5. The time now is 02:36 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