2

I have a macpro with two 802.3(en0 and en1) interfaces and wifi(en2).

I have created AX88x72A interface(en11) for my Ethernet over USB device.

I have following internet sharing settings:

enter image description here

This creates the bridge100 interface with IP of 172.16.42.1 which bridges all checked interfaces: Ethernet1(en0), Ethernet2(en1) and AX88x72A(en11)

I want the following:

  • bridge100 with static ip 172.16.42.1 with only Ethernet2(en1) and AX88x72A(en11) to share internet connection with all devices connected to that interfaces.

  • en0 to have static ip 192.168.2.1 and also share the internet connection with devices connected to this interface.

  • Both bridge100 and en0 has to have dhcp(or bootp) running so they give out the ip addresses to connected devices

I am not sure, maybe I can create two bridges somehow... Please give me some advices... I know I should be able to achieve this somehow... Thank you.

EDIT:

Seems like the bridge100 is a very special bridge.

Although I have en0 with static IP 192.168.2.1, I still can not find a way to share internet on this interface without adding it to bridge100 by checking it in Preferences > Sharing > Internet Sharing

However, when I add en0 to Internet Sharing (technically to bridge100), the only accessible ip is 172.16.42.1 - address of bridge which is set in /Library/Preferences/SystemConfiguration/com.apple.nat.plist, ignoring the GUI settings for Ethernet 1 (en0): enter image description here

It seems like impossible to have multiple bridged interfaces with 2 different ip addresses for internet sharing on MacOS. Please correct me if I am wrong.

1 Answer 1

2

The only solution I have found so far is the following:

  • add all three physical interfaces (en0, en1 and en11) to bridge100 in GUI (Preferences > Sharing > Internet Sharing)
  • Alter the file /Library/Preferences/SystemConfiguration/com.apple.nat.plist using defaults commands:

    $ sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberStart 172.16.42.0

    $ sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberEnd 172.16.42.254

    $ sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkMask 255.255.255.0

  • Start bridge100 with the ip 172.16.42.1:

    $ sudo ifconfig bridge100 172.16.42.1 netmask 255.255.255.0 up

  • And add alias (second ip) to bridge100: $ sudo ifconfig bridge100 alias 192.168.2.1

In this case our bridge100 will have 2 ip addresses but of course it will act as a dhcp only with range 172.16.42.0/24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .