User defined/static utun device name

Got a problem with Viscosity or need help? Ask here!

bip

Posts: 4
Joined: Sun Oct 02, 2016 9:59 pm

Post by bip » Sun Oct 09, 2016 10:47 am
Hi,

for some reasons the name of my utun device cycles between utun0 and utun4. It seems like OSX has it's own
utunX devices running. I have already checked that Back to My Mac is deactivated. Since I'm referring to the VPN device in my firewall, the rules sometimes do not match the correct utun device. According to this URL it should be possible to define a user specific utun device: http://unix.stackexchange.com/questions ... evice-name
But adding the dev command to the OpenVPN config in the Advanced tab does not work. I guess it gets overruled by the dev command which Viscosity writes into the config file. Any idea what I can do to always have the same utun device name for my VPN connection?

Cheers
bip

edit: OSX El Capitan

James

User avatar
Posts: 2318
Joined: Thu Sep 04, 2008 9:27 pm

Post by James » Thu Oct 13, 2016 11:05 am
Hi bip,

I'm afraid it's not possible to have a hardcoded adapter name, at least not with utun devices. Your best bet is to parse the output of something like ifconfig to get the utun interface you're after, for example by looking at the IP address assigned to it. macOS's utun interfaces all appear to be IPv6 only, so simply looking for a utun interface with an IPv4 address may be another option.

Cheers,
James
Web: https://www.sparklabs.com
Support: https://www.sparklabs.com/support
Twitter: https://twitter.com/sparklabs

SpookyCow

Posts: 22
Joined: Thu Oct 29, 2015 6:30 am

Post by SpookyCow » Wed Dec 07, 2016 8:44 am
What is the command line code to run to look at these interfaces? Since upgrading to 10.12.x my VPN connection drops no matter what server I'm on and it's not on a set timetable. Never had my VPN disconnect on it's own unless I rebooted the router or the Internet went out, neither of these are the cause.

Code: Select all
Dec 05 03:39:23: Viscosity Mac 1.6.6 (1358)
Dec 05 03:39:24: Viscosity OpenVPN Engine Started
Dec 05 03:39:24: Running on Mac OS X 10.12.1
Dec 05 03:39:24: ---------
Dec 05 03:39:24: Checking reachability status of connection...
Dec 05 03:39:24: Connection is reachable. Starting connection attempt.
Dec 05 03:39:27: OpenVPN 2.3.12 x86_64-apple-darwin [SSL (OpenSSL)] [LZO] [PKCS11] [MH] [IPv6] built on Aug 24 2016
Dec 05 03:39:27: library versions: OpenSSL 1.0.2h  3 May 2016, LZO 2.09
Dec 05 03:39:30: UDPv4 link local: [undef]
Dec 05 03:39:30: UDPv4 link remote: [AF_INET]IP ADDRESS REMOVED:1197
Dec 05 03:39:30: [071d57e0be9ccce934593d8bb964d18c] Peer Connection Initiated with [AF_INET]IP ADDRESS REMOVED:1197
Dec 05 03:39:33: Opening utun (connect(AF_SYS_CONTROL)): Resource busy
Dec 05 03:39:33: Opened utun device utun1
Dec 05 03:39:33: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Dec 05 03:39:33: /sbin/ifconfig utun1 delete
Dec 05 03:39:33: NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
Dec 05 03:39:33: /sbin/ifconfig utun1 IP ADDRESS REMOVED mtu 1500 netmask 255.255.255.255 up
Dec 05 03:39:33: Initialization Sequence Completed
Dec 05 03:39:33: DNS mode set to: Off
Dec 05 04:34:25: write UDPv4: No buffer space available (code=55)
Dec 05 04:34:25: Disconnecting due to "No buffer space available" errors.
Dec 05 04:34:25: write UDPv4: No buffer space available (code=55)
Dec 05 04:34:26: SIGTERM[hard,] received, process exiting
Code: Select all
Dec 05 00:53:01: Viscosity Mac 1.6.8b1 (1365)
Dec 05 00:53:01: Viscosity OpenVPN Engine Started
Dec 05 00:53:01: Running on Mac OS X 10.12.1
Dec 05 00:53:01: ---------
Dec 05 00:53:01: Checking reachability status of connection...
Dec 05 00:53:01: Connection is reachable. Starting connection attempt.
Dec 05 00:53:01: OpenVPN 2.3.13 x86_64-apple-darwin [SSL (OpenSSL)] [LZO] [PKCS11] [MH] [IPv6] built on Nov  4 2016
Dec 05 00:53:01: library versions: OpenSSL 1.0.2j  26 Sep 2016, LZO 2.09
Dec 05 00:53:04: UDPv4 link local: [undef]
Dec 05 00:53:04: UDPv4 link remote: [AF_INET]IP ADDRESS REMOVED:1197
Dec 05 00:53:05: [79a9a608ea687cb1698310c83e4e772c] Peer Connection Initiated with [AF_INET]IP ADDRESS REMOVED:1197
Dec 05 00:53:08: Opening utun (connect(AF_SYS_CONTROL)): Resource busy
Dec 05 00:53:08: Opened utun device utun1
Dec 05 00:53:08: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Dec 05 00:53:08: /sbin/ifconfig utun1 delete
Dec 05 00:53:08: NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
Dec 05 00:53:08: /sbin/ifconfig utun1 IP ADDRESS REMOVED mtu 1500 netmask 255.255.255.255 up
Dec 05 00:53:08: Initialization Sequence Completed
Dec 05 00:53:08: DNS mode set to: Off
Dec 05 01:37:04: write UDPv4: No buffer space available (code=55)
Dec 05 01:37:04: Disconnecting due to "No buffer space available" errors.
Dec 05 01:37:04: write UDPv4: No buffer space available (code=55)
Dec 05 01:37:04: SIGTERM[hard,] received, process exiting
I performed ifconfig -a and the only utun interfaces I've seen is 0 and 1.
DNS is set to off since I'm using DNSCrypt.
3 posts Page 1 of 1