How do I use a Mac as switch (or bridge two interfaces)

4

2

I need to put a wired device (Blue-ray player), on my home wireless network's subnet, via the mac's wifi connection, as there is no wired connections upstairs.

To be more clear, what I'd like is:

BlueRay ---(ethernet)---> Mac ---(wifi)---> Home Router [192.168.1.1]
[192.168.1.3]        [192.168.1.4]                         |
                                                      (ethernet)
                                                           |
                                                           v
                                         Media Server PC [192.168.1.5]

Basically I want to bridge ethernet over to the wifi network. And 'Internet Sharing' won't do as it creates a second subnet [192.168.2.x]

Can this be done ?

Jamo

Posted 2012-05-05T05:30:19.453

Reputation: 141

Answers

1

You just need to enable IP forwarding on your Mac. Which can be done via the following command (you might need to restart your mac/networking interface for changes to take effect):

sysctl -w net.inet.ip.forwarding=1

More info: How do I enable IP-forwarding in MacOS X?

TjWallas

Posted 2012-05-05T05:30:19.453

Reputation: 463

1

As of Mountain Lion, it might work to configure a bridge using ifconfig:

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

See man ifconfig for more options.

James

Posted 2012-05-05T05:30:19.453

Reputation: 463