Linux – connecting (bridging) two networks

bridgelinuxnetworkingppp

I would like to connect (bridge) two networks (ppp0 and eth2).
Normally you would do this with brctl but one of the network-interface is a ppp-device so it won't work (ppp can't transport ppp-frames).
What I could do, is enable ip-forwarding but that is not enough as I want traffic from that ppp-device only go to eth2 and vice versa. NAT is fine. Another problem is that as far as I know you cannot push routing information to ppp-clients?
Any help is appreciated! (solutions that work with windows/mac/android clients would be nice but not absolutely required)

Best Answer

You can't bridge ethernet and PPP because they are different layer two protocols, and incompatible ones at that.

  • PPP, as it's name implies is a direct point to point link. It doesn't know the concept of multiple hosts on the local link.
  • Ethernet on the other hand can have any number (well, lots) of other hosts on the local link.

Reconciling this directly is impossible.

However, there is something else you can do: encapsulate the ethernet packets using an IP-in-IP tunnel between the two PPP endpoints then use brctl to bridge the ethernet and tunnel interfaces.

Read more in the IP-in-IP HOWTO.

Related Question