Re: linux bridging problem: how to emulate 2 separate interfaces on a single one?

Linux Advanced Routing and Traffic Control

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

 



On Fri, 01 Jul 2005 20:37:44 +0200
Antonio Pinizzotto <antonio.pinizzotto@xxxxxxxxxx> wrote:

> Stephen Hemminger wrote:
> > On Fri, 01 Jul 2005 11:59:08 +0200
> > Antonio Pinizzotto <antonio.pinizzotto@xxxxxxxxxx> wrote:
> > 
> > 
> >>Hi all.
> >>
> >>I would need to use a single physical interface on a Linux box to manage 
> >>two different IP addresses (belonging to two separate logical subnets) 
> >>with two different MAC address. (I need to emulate te presence of two 
> >>separate physical interfaceses for a PC on the same LAN, at layer 2 and 
> >>layer 3).
> >>
> >>Is it possible to use the linux ethernet bridging code and two tap 
> >>interfaces for this purpose?
> >>
...
> Below I tried to draw a clearer picture.
> The first one is what I would like to get.
> The second one is what I have.
> 
> 
> LAN______________________________________________
>                          |
>                          | eth0 (no IP)
>     _____________________|________________________
>    |                     |          Linux Box (PC)|
>    |             ________|________                |
>    |            |                 |               |
>    |            |       br0       |               |
>    |            |     (no IP)     |               |
>    |            |_________________|               |
>    |           tap0  |        | tap1              |
>    | 192.168.40.1/24 |        | 192.168.30.1/24   |
>    |           MAC_0 |        | MAC_1             |
>    |              ___|________|____               |
>    |             |                 |              |
>    |             | OS TCP-IP stack |              |
>    |             |                 |              |
>    |             |_________________|              |
>    |                 | | | |                      |
>    |                 | | | |                      |
>    |                Processes                     |
>    |                                              |
>    |                                              |
>    |______________________________________________|
> 
> 
> I would need the first picture to be equivalent to the next one:
> 
> 
>   LAN_____________________________________________
>                eth0  |        | eth1
>      192.168.40.1/24 |        | 192.168.30.1/24
>                MAC_0 |        | MAC_1
>     _________________|________|___________________
>    |                 |        |     Linux Box (PC)|
>    |              ___|________|____               |
>    |             |                 |              |
>    |             | OS TCP-IP stack |              |
>    |             |                 |              |
>    |             |_________________|              |
>    |                 | | | |                      |
>    |                 | | | |                      |
>    |                Processes                     |
>    |                                              |
>    |                                              |
>    |______________________________________________|


It should work if the tap interface looks sufficiently like Ethernet.
You probably need filter rules to make sure and drop packets intended for
the other network get dropped and to prevent broadcast leakage.

Wouldn't a cheap ethernet hub and two ethernet interfaces do
the same thing?
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux