Page 1 of 1

Internet Sharing & OpenVPN/Viscocity?

Posted: Sun Jul 04, 2010 7:12 am
by Katagi
Hello All,

I am trying to share my OpenVPN connection over the Ethernet (VPN is working thru WLAN).

Since there is no tun0 or any other device in the GUI section of Network preferences pane I tried to enable it manually using following commands:

sudo sysctl -w net.inet.ip.forwarding=1
sudo /usr/sbin/natd -l -interface tun0 -use_sockets -same_ports -unregistered_only -dynamic -clamp_mss -enable_natportmap -natportmap_interface en0
sudo ipfw add 01000 divert natd all from any to any via en0
sudo ipfw add 01100 divert natd ip from 10.29.0.0/24 to any via en0
sudo ipfw add 01200 divert natd ip from any to me via en0

(10.29.0.0/24 is my VPN network: inet 10.29.0.6 --> 10.29.0.5 and I want to share it with en0 ethernet).

But it still doesn't work i.e. from my ethernet network I can't ping outside.

Any suggestions?

Regards,
Katagi

Re: Internet Sharing & OpenVPN/Viscocity?

Posted: Sun Jul 04, 2010 8:19 am
by Katagi
Ups. My bad i never read this thread :oops:

Sorry. I just downloaded the first program WaterRoof and simply enable the NAT for tun0 device and it worked right ahead.

Thanks. This question may be closed/deleted.

Re: Internet Sharing & OpenVPN/Viscocity?

Posted: Tue Jun 21, 2011 2:09 pm
by themesser
hi katagi, can you tell how you accomplished that using waterroof ?
i can see my connection to the vpn server in the connection list, but don't know at all what to do in the "NAT setup" but when i click "start NAT" an erro pops up. Is there something to configure ?
thanks

Re: Internet Sharing & OpenVPN/Viscocity?

Posted: Tue Aug 16, 2011 8:58 pm
by dsnetter
Ok, I've got a new twist on this whole thing, and would LOVE it if someone could steer me toward a solution.

Here's one setup that I've gotten working just fine:

Internet connected to my macbookpro's ethernet interface, en0, with an IP assigned by my ISP
OpenVPN connected through this interface, creating the virtual interface, tun0, with an IP that (I believe) Viscosity generates, 10.8.5.22
I want to share my OpenVPN connection over wifi, so I create an ad-hoc network with IP's in the same net, 10.8.5.100-110. My macbookpro uses 10.8.5.100, and this IP shows up as the IP address for interface en1. I then tell all the other devices on the ad-hoc to use 10.8.5.100 as their gateway. I run WaterRoof and start NAT with tun0 as the WAN interface. It all works like a charm.

But, and this one makes me want to do bad things to Steve, my AppleTV will not recognize an ad-hoc network. Won't even let me type in the wifi name manually... it just refuses to see it. Now, it'll see a wifi network created by my macbookpro just fine if it's created using the Internet Connection Sharing features in Mac OSX, but and here's the rub, I can't figure out how to get NAT to work this way.

If I set my Airport up manually (no DHCP) and choose an IP like before, 10.8.5.100, then the Internet Connection Sharing will create this IP for interface en1: 10.0.2.1. I figured I could work with this, and set up all my subnet masks to 255.0.0.0, and hoped NAT would be happy. But it's not. None of my devices can see the internet now.

What to do?

Re: Internet Sharing & OpenVPN/Viscocity?

Posted: Fri Aug 31, 2012 1:08 am
by frriction
can anyone explain me how dsnetter has setup adhoc connection.

I have downloaded waterroof but do not know what to do ahead. :roll:

Re: Internet Sharing & OpenVPN/Viscocity?

Posted: Fri Aug 31, 2012 9:04 pm
by James
Hi frriction,

I recommend you take a look through the posts in the following topic - some users have contributed scripts to automate the setup as well:
http://www.sparklabs.com/forum/viewtopic.php?p=402

Cheers,
James