Mac Address and DHCP IP Address

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

Jimmo04

Posts: 2
Joined: Fri Nov 21, 2008 9:12 am

Post by Jimmo04 » Fri Nov 21, 2008 9:20 am
Hello,

Is there a way to set a static MAC address on the tap0 so that I don't end up clogging up the DHCP Pool each time I connect?

Also, why is the tap0 adapter getting TWO IP addresses from the openvpn server? Viscosity reports 192.168.0.150 only in the GUI.
Code: Select all
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet 192.168.0.150 netmask 0xffffff00 broadcast 192.168.0.255
	inet 192.168.0.169 netmask 0xffffff00 broadcast 192.168.0.255
	ether 2e:8e:65:00:66:2c 
	open (pid 1535)
Thanks for any suggestion!

James

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

Post by James » Sat Nov 22, 2008 3:55 pm
Hi Jimmo04,

You should be able to set your MAC address using the "lladdr" command.

Normally every time a OpenVPN connects it will assign a random MAC address to the tap interface. To change this, edit your connection and click the Advanced tab. On a new line in the commands box add the command "lladdr xx:xx:xx:xx:xx:xx" (without quotes), where xx:xx:xx:xx:xx:xx should be replaced with your desired MAC address.

As for two IP addresses, check the Advanced commands section and see if a second address is also being set using the ifconfig command.

Cheers
James
James Bekkema
Viscosity Developer

Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs

cjstone

Posts: 4
Joined: Wed Dec 10, 2008 6:02 am

Post by cjstone » Wed Dec 10, 2008 6:07 am
James wrote:
Hi Jimmo04,

As for two IP addresses, check the Advanced commands section and see if a second address is also being set using the ifconfig command.

Cheers
James

I'm also seeing two IP addresses:
Code: Select all
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 172.24.42.1 netmask 0xffff0000 broadcast 172.24.255.255
        inet 172.24.31.179 netmask 0xffff0000 broadcast 172.24.255.255
        ether e6:50:b8:56:4a:14 
        open (pid 3065)
And can trace them to be from these sources:

172.24.42.1 is the first from the pool set up on the server with:
Code: Select all
server-bridge 172.24.20.202  255.255.0.0 172.24.42.1 172.24.42.254
172.24.31.179 is from our regular DHCP server on the LAN (which I don't want to accept IPs from).

Is this likely a server side issue or client side? I'm building the server as well, so can make any needed changes there as well.

My client config looks like this:
Code: Select all
#-- Config Auto Generated By Viscosity --#

#viscosity startonopen false
#viscosity dnssupport true
#viscosity name test
route-gateway 192.168.50.2
pull
comp-lzo
remote 192.168.50.2 1194
persist-key
ca ca.crt
proto udp
dev tap
persist-tun
cert cert.crt
tls-client
key key.key
remote-cert-tls server
route-delay 3
Thanks,

--Chris

cjstone

Posts: 4
Joined: Wed Dec 10, 2008 6:02 am

Post by cjstone » Wed Dec 10, 2008 7:20 am
For what it's worth, I don't see two IP's when using the identical config file in TunnelBlick, so I'm thinking it's a client-side issue. Not that I want to keep using Tunnleblick instead of Viscocity :-)

James

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

Post by James » Wed Dec 10, 2008 1:42 pm
Hi Guys,

Version 1.0 of Viscosity always turns on DHCP for TAP interfaces. In the instance of two IPs I'd say one is coming from the DHCP server, and one is being pushed by the OpenVPN server (i.e. the "server-bridge" command is being used server side). In these instances you probably don't want to use the IP address being handed out by the DHCP server. To stop this, download the latest build of Viscosity, edit your connection, and untick the "Enable DHCP" option under the General tab:

You can grab the latest build from:
http://www.viscosityvpn.com/forum/viewt ... p?f=7&t=34

Cheers
James
James Bekkema
Viscosity Developer

Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs

Guest


Post by Guest » Thu Dec 11, 2008 8:08 am
Awesome! Yeah, I found that yesterday after I posted (should have looked a little more).

Thanks!


--Chris
6 posts Page 1 of 1