Skip to content
Mac OS X Internet Sharing
Got a problem with Viscosity or need help? Ask here!
Hi Bullitt,
You're right, Internet Sharing won't help you in this instance. You'll need to create a wireless network (from the Mac OS X's Wi-Fi menu icon), and then using something like WaterRoof to share the VPN connection (tun0, tap0, or whatever it may be called).
You'll probably need to give the Mac Mini a static IP on the wireless interface, and then give all other machines connected to its wireless network a static IP addresses in the same range, with the router/gateway set to the Mac Mini's IP.
I'm afraid I don't know of any guides or tutorials for exactly what you are trying to do.
Cheers,
James
You're right, Internet Sharing won't help you in this instance. You'll need to create a wireless network (from the Mac OS X's Wi-Fi menu icon), and then using something like WaterRoof to share the VPN connection (tun0, tap0, or whatever it may be called).
You'll probably need to give the Mac Mini a static IP on the wireless interface, and then give all other machines connected to its wireless network a static IP addresses in the same range, with the router/gateway set to the Mac Mini's IP.
I'm afraid I don't know of any guides or tutorials for exactly what you are trying to do.
Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Bluesky: https://bsky.app/profile/sparklabs.com
Support: https://www.sparklabs.com/support
Bluesky: https://bsky.app/profile/sparklabs.com
Old thread but I thought I should post anyway since It appears that someone else but me might find It useful.
I've found a way to manually share a VPN'd connection, I tested sharing my Ethernet connection via Wi-Fi and It worked well.
I couldn't find a way to do It directly through the "Internet Sharing" preference pane, so stuff like DHCP isn't working, and I haven't bothered looking for a way to fix It since I rarely use this setup and when I do It's for sharing with only 1-3 PCs at most, but manually setting IPs works, so that's a start
1. First thing to do is to set a fixed IP for the Wi-Fi interface, for example, I used the following configuration:
3. Now open "/etc/pf.conf" and add the line:
- 10.168.1.0/24 is the same IP range as the Wi-Fi interface, if you changed It to something else, change here accordingly.
- XX.XX.XX.XX is the "Client IP" found following instruction number 2. Mine always change when reconnecting, so I have to repeat this step each time.
- A workaround for the issue above is to use a line like this instead:
Place the line as shown below. The pf.conf file will look like this:
I've found a way to manually share a VPN'd connection, I tested sharing my Ethernet connection via Wi-Fi and It worked well.
I couldn't find a way to do It directly through the "Internet Sharing" preference pane, so stuff like DHCP isn't working, and I haven't bothered looking for a way to fix It since I rarely use this setup and when I do It's for sharing with only 1-3 PCs at most, but manually setting IPs works, so that's a start
1. First thing to do is to set a fixed IP for the Wi-Fi interface, for example, I used the following configuration:
Code: Select all
2. Now connect to your VPN, go to Viscosity's details window and note down the "Client IP" address. I'll call It XX.XX.XX.XX.IPv4 Address: 10.168.1.10
Subnet Mask: 255.255.0.0
Router: 10.168.1.254
DNS Server: 8.8.8.8 (any DNS of your choice will work)
3. Now open "/etc/pf.conf" and add the line:
Code: Select all
- I only tested with tun0, but tap0 should probably work too.nat pass on tun0 from 10.168.1.0/24 to any -> XX.XX.XX.XX
- 10.168.1.0/24 is the same IP range as the Wi-Fi interface, if you changed It to something else, change here accordingly.
- XX.XX.XX.XX is the "Client IP" found following instruction number 2. Mine always change when reconnecting, so I have to repeat this step each time.
- A workaround for the issue above is to use a line like this instead:
Code: Select all
- This way It will find out the "Client IP" automatically, but there's a catch: this line can't be present in pf.conf at startup because tun/tap is only loaded when Viscosity is opened, thus pfctl will fail to read pf.conf, since tun/tap don't exist (yet).nat pass on tun0 from 10.168.1.0/24 to any -> (tun0)
Place the line as shown below. The pf.conf file will look like this:
Code: Select all
4. Add the line and save, open the Terminal and run:scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
nat pass on tun0 from 10.168.1.0/24 to any -> XX.XX.XX.XX
rdr-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
Code: Select all
6. All done, now when connecting any devices, manually set them like this:sudo pfctl -F all && sudo pfctl -f /etc/pf.conf
sudo sysctl -w net.inet.ip.forwarding=1
Code: Select all
Hope It helps IPv4 Address: 10.168.1.XX (any IP between 1-254, except whatever you've set in IPv4 Address above, like .10)
Subnet Mask: 255.255.0.0
Router: 10.168.1.10 (same as "IPv4 Address" from instruction 1.)
DNS1: 8.8.8.8 (same as instruction 1)