[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 2 NICs and the source ip address



Hi,

> have you checked:
> NAT -- network address translation (aka Masquerading)?  
> You will find a lot of helpful information in 

yes, as I mentioned briefly

>> Is there an easy and preferred way to accomplish this goal (which
>> seems to be not that uncommon)? Should I use iproute2 or even
>> iptables/NAT ?

it is possible to use NAT to do that. My question is, however: is it
really necessary to use such a heavyweight tool for such a simple
setup:

1. Host has 2 NICs
2. No forwarding between the two NICs
3. Just ensure that an ip packet leaving the host gets the
   ip address of the corresponding NIC


I'll try some ASCII art:


                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  /                                     \
                 (                 LAN                   )
                  \                                     /
                    ------------------------------------
                   |                                    |
                   |                                    |
             ------------                         ------------
             |   eth0   |                         |    eth0  |
             |          |                         |          |
    host A   |          |                         |          | host B
             |          |    dedicated line       |          |
             |      eth1|-------------------------|eth1      |
             ------------ 10.0.0.1       10.0.0.2 ------------


Isn't point 3. a reasonable demand? It seems natural to me and should
be easy to accomplish, shouldn't it? How do I ensure that the
src ip address of packages running through eth1 of host A is 10.0.0.1?

Thanks for any hint, Thomas




Reply to: