28

How can I bridge two wired ethernet interfaces on Mac OS X (e.g. the current MacPro comes with two ethernet ports)?

Googling turned up (e.g. this Apple forum post and this openvpn post) that this is fairly easy on Linux (using the brctl command) and under Windows (via Network Connections > right-click > Bridge Connections), but how is it done under Mac OS X?

BTW: There also doesn't seem to be a macport for brctl ('port search brctl' didn't turn up any results)

Note: I don't want to have 'internet sharing', which creates a new network (by handing out network addresses in a new range). I want to really 'bridge' two interfaces so to keep the same network subnet.

Chealion
  • 26,327
Rabarberski
  • 8,800

2 Answers2

31

As of Mountain Lion, you can configure bridges using ifconfig:

sudo ifconfig bridge0 create
sudo ifconfig bridge0 addm en0 addm en1
sudo ifconfig bridge0 up

See man ifconfig for more options.

It doesn't work well with wifi interfaces however due to how they handle lookups.

7

If you want to build a real Ethernet bridge (Layer 2 bridge) on Mac OS X, answer is, you simply can't without third-party software. That's just the way it is, there is nothing in the kernel or in userspace to do this.

The only software I know capable of doing this is IPNetRouterX, which is not free. Never tried it myself.