Networking Forums

Networking Forums > Computer Networking > Linux Networking > Traffic through subinterfaces

Reply
Thread Tools Display Modes

Traffic through subinterfaces

 
 
ppogoda@gmail.com
Guest
Posts: n/a

 
      12-10-2007, 09:35 AM
Hello
I have one physical interface eth0 with subinterfaces. All adresses of
interfaces are from the same network. I have a serivce that listen on
one of subinterfaces eth0:2 with ip 192.168.0.10 and everything is ok
but the outgoing traffic from this service is via eth0 ip address
192.168.0.1. I want that this service to use eth0:2 ip address instead
eth0 ip address.Is it possible to achive it without using iptables?

Best regards
 
Reply With Quote
 
 
 
 
Pascal Hambourg
Guest
Posts: n/a

 
      12-10-2007, 09:53 AM
Hello,

(E-Mail Removed) a écrit :
> I have one physical interface eth0 with subinterfaces. All adresses of
> interfaces are from the same network. I have a serivce that listen on
> one of subinterfaces eth0:2 with ip 192.168.0.10 and everything is ok
> but the outgoing traffic from this service is via eth0 ip address
> 192.168.0.1.


Note : these are not subinterfaces but "IP aliases", i.e. multiple IP
addresses on a single interface.

> I want that this service to use eth0:2 ip address instead
> eth0 ip address.Is it possible to achive it without using iptables?


This may be possible through a configuration option of that service.

Otherwise, it may be possible to define that specific address as the
"primary" address on the interface, but this will be a system-wide
setting. If the outgoing communications are destined only to well-known
addresses, it may be possible to set specific routes to these
destinations using a specific default source address. But again, this is
a system-wide setting.
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      12-12-2007, 11:56 PM
On Dec 10, 2:35 am, ppog...@gmail.com wrote:

> I have one physical interface eth0 with subinterfaces. All adresses of
> interfaces are from the same network. I have a serivce that listen on
> one of subinterfaces eth0:2 with ip 192.168.0.10 and everything is ok
> but the outgoing traffic from this service is via eth0 ip address
> 192.168.0.1. I want that this service to use eth0:2 ip address instead
> eth0 ip address.Is it possible to achive it without using iptables?


What do you mean by "listen on"? What does it mean to listen on an
interface?

What do you mean by "use eth0:2 ip address"? Use it for what?

As the source address for outbound packets? Are we talking TCP or UDP?
Are connections initiated by this machine or the other end?

It's very hard to tell what you're talking about.

DS
 
Reply With Quote
 
Andrew Gideon
Guest
Posts: n/a

 
      12-13-2007, 03:03 PM
On Wed, 12 Dec 2007 16:56:54 -0800, David Schwartz wrote:

> As the source address for outbound packets? Are we talking TCP or UDP?


Given that the service in question is listening on the address(es) of
eth0:2 but responses have a source IP belonging to eth0 (which is how I
interpreted the original question, admittedly), aren't we necessarily
speaking of UDP? I wouldn't think it possible to have this scenario with
TCP.

Am I wrong about that?

If one isn't speaking of responses, then it is possible of course. I'd a
similar situation where an SMTP server was getting connections on one IP
but initiated connections on another. Using ClientPortOptions fixed this.

Bind has "query source" for the same purpose.

- Andrew
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Should traffic control root qdisc & child class limit traffic? Washington Ratso Linux Networking 1 02-25-2011 06:48 PM
Re: Blocked incoming traffic, why possible to get traffic? Char Jackson Network Routers 0 09-13-2010 06:38 PM
ip change on interface with subinterfaces. Pedros Linux Networking 3 12-27-2005 12:59 PM
dhcp for subinterfaces jeroen Linux Networking 1 10-24-2005 10:37 AM
SNAT with multiple mappings: subinterfaces needed? Joe Drago Linux Networking 1 06-15-2004 03:33 PM



1 2 3 4 5 6 7 8 9 10 11