[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: topology does work on mac osx with a manual work arround (was Re: [Openvpn-users] topology subnet 2.1beta7 mac osx - ifconfig: ioctl (SIOCAIFADDR): Destination address required


  • Subject: Re: topology does work on mac osx with a manual work arround (was Re: [Openvpn-users] topology subnet 2.1beta7 mac osx - ifconfig: ioctl (SIOCAIFADDR): Destination address required
  • From: Mathias Sundman <mathias@xxxxxxxxxx>
  • Date: Thu, 1 Dec 2005 12:05:54 +0100 (CET)

On Wed, 30 Nov 2005, Mathias Sundman wrote:

On Wed, 30 Nov 2005, Mathias Sundman wrote:

On Wed, 30 Nov 2005, Jon Bendtsen wrote:

Sundman from #openvpn had some suggestions and they appears to be working.
i had to remove the pull/client statement from the client.conf and run this manually
sudo ifconfig tun0 192.168.123.253/24 192.168.123.253
sudo route add -net 192.168.123.0 192.168.123.253 255.255.255.0


It does work.
I can ping, and if i add a route to the network beyond the VPN network i can
ping and surf on those hosts as well
sudo route add -net 192.168.119.0 192.168.123.34 255.255.255.0


So topology does work on mac OSX.

My last patch had a typo, attached is a working one. Jon has verified that the patch does work on macOSX.


The tun interface now gets its IP and mask set, but to reach the whole subnet assigned to the tun interface he still had to add a route as above:

route add -net 192.168.123.0 192.168.123.253 255.255.255.0

So, the question is, should we make OpenVPN always add a network route for the "local network" assigned to the tun interface when in --dev tun, --topology subnet mode on macOSX, or is it up to the user to push such a route?

How does other OSs work? If we push such a route, we don't want to break other OSs...

I did some testing on linux and found that the network route is added automatically by the kernel (or ifconfig) when a tun interface is assigned a netmask.


So it seems to me like we should make OpenVPN add this route automatically when in subnet mode on macOSX.

Should we do this from inside do_ifconfig() or somewhere else? Is there any function already available in OpenVPN to return the network address from an IP address and subnet mask so we know what value to use for the route addition, or do I have to write that as well?

Or should we perhaps consider this a bug in the tun implementation on macOSX that should rather be fixed there, than worked around in OpenVPN?

//Mathias

--
_____________________________________________________________
Mathias Sundman                  (^)   ASCII Ribbon Campaign
OpenVPN GUI for Windows           X    NO HTML/RTF in e-mail
http://openvpn.se/               / \   NO Word docs in e-mail

____________________________________________
Openvpn-users mailing list
Openvpn-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/openvpn-users