Traffic through subinterfaces - Networking

This is a discussion on Traffic through subinterfaces - Networking ; 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 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Traffic through subinterfaces

  1. Traffic through subinterfaces

    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

  2. Re: Traffic through subinterfaces

    Hello,

    ppogoda@gmail.com 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.

  3. Re: Traffic through subinterfaces

    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

  4. Re: Traffic through subinterfaces

    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 to Thread