Re: Two NICS with same IP and same client IP

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

 



> On Wed, 2005-02-02 at 05:28, Raphael Jacquot wrote:
>> Hervé wrote:
>> >>having 2 interfaces on the same box with the same IP address
>> >>
>> >>repeat after me :
>> >>
>> >>WILL NOT WORK
>> >
>> >
>> > Well, I can't see why not. Can you explain?
>
> maybe this is easier to grasp:
>
>   $ cd /var/tmp
>   $ mkdir new
>   $ mkdir new
>   mkdir: cannot create directory `new': File exists
>
> you're trying to do the same thing in the kernel.
>
> -j
>
> --
> "Dear Mr. President, there are too many states nowadays, please
>  eliminate three. I am not a crackpot."
>  --The Simpsons
>
Sorry guys, but this is indeed allowed. Your example might be valid if
you're talking MAC addresses and do not bridge the NICs, and even then I'm
not sure.

In my case, the point is to help the routing by modifying the source
address. For example, you give eth0 two addresses: 192.168.100.1 and
192.168.101.1, and eth1: 192.168.100.1 (yes, the same) and 192.168.102.1.

Now if you mangle the source address from 192.168.100.2 to 192.168.101.2
when it comes through eth0 and to 192.168.102.2 when it comes through
eth1, then the routing will work (chose the right interface) for the
reply. All you have to do is to change the addresses back before sending
on the network.

So, I want rules like this:
Prerouting:
- if interface is eth1, change network to 192.168.101.0
- if interface is eth2, change network to 192.168.102.0
Postrouting:
- if network is 192.168.101.0 or 192.168.102.0, then change network to
192.168.100.0

But I don't know how to enter just those rules...

Cheers,
Hervé.




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux