

Sudo defaults write /Library/Preferences/SystemConfiguration/ NAT -dict-add SharingNetworkMask 255.255.255.0 Sudo defaults write /Library/Preferences/SystemConfiguration/ NAT -dict-add SharingNetworkNumberEnd 192.168.22.254 (you can replace the first two IP Ranges as needed) sudo defaults write /Library/Preferences/SystemConfiguration/ NAT -dict-add SharingNetworkNumberStart 192.168.22.1 To change the range that macOS uses, first turn off internet sharing, and quit System Preferences, then enter the following commands into the terminal: This can be problematic if you are trying to log in to another network over VPN that uses the same IP Address range, or you have some other conflict.

MacOS Defaults to using 192.168.0.xxx as the DHCP range when you use the Internet Sharing feature to share (for example) an ethernet connection over WiFi. Both apps should also allow you to enable NAT (step 2/3)Īs an expansion of samh's answer, and to answer the question in the comment from Frozen Flame, here is how you can use Internet Sharing, and also control which IP address range is used: Change default DHCP IP Range for macOS Internet Sharing Now use pfctl to add rules or get a pfctl-GUI like IceFloor or Murus to configure your firewall.
#HOW TO SETUP USB ETHERNET MAC MAC#
Now configure a static route on your router:ġ92.168.1.0/24 (the internal network) -> 192.168.0.2 (Mac mini IP-address of the external interface connected to the router)Įnable the DHCP-service on your Mac mini gateway: Sudo pfctl -f /Path/to/file/nat-rules -e #starts pfctl and loads the rules from the nat-rules file Sudo pfctl -F all #flushes all pfctl rules Save the file and now start pfctl using the rule from the file we have created earlier: sudo pfctl -d #disables pfctl Create a file called "nat-rules" with the following content: nat on en0 from en1 to any -> (en0) In order to do NAT you have to create a pfctl rule. Mac mini gateway: en0: 192.168.0.2/24 gateway 192.168.0.1 en1: 192.168.1.2/24įirst you have to enable forwarding on your Mac computer with following commands: sudo sysctl -w .forwarding=1 I assume the following IP-adresses/netmasks: Router: 192.168.0.1/24 OS X Yosemite doesn’t have support for natd binary or ipfw anymore.
#HOW TO SETUP USB ETHERNET MAC HOW TO#
Maybe someone can still give details on how to enable firewall or control the components involved? The server.app DHCP is turned off now, because it cannot be assigned to the internal network adapter. However, I have no control over the DHCP addresses given by the server, firewall, user access, etc. What do I have to configure, so machines from the internal network get internet access?Īdditionally: How can I setup a firewall to control outside access?Īs hinted, Internet Sharing worked in giving access to the internal network. The help function is just as helpful as the Apple features website. Unfortunately, the server app doesn't show any settings for gateway, NAT, bridging, firewall. I installed the server.app and got the DHCP service running, so machines in the internal network get IP addresses assigned. Internet access is possible from the Mac Mini over this adapter. The MAC_GW is a Mac Mini (OS X Yosemite) with an USB ethernet adapter. Maybe it is easier than I think, but I cannot get it to work.

There seemed to be a Gateway Setup Assistant, but the Wikipedia link only goes to the server app now. It should be possible, but I searched for a day and cannot get a decent HowTo.
