Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Trying to configure OpenVPN client on my Ubuntu desktop.

Conf file:

remote 192.168.11.103
#192.168.11.103
#85.249.45.106
#dev-node tap0
dev tap
port 5027
ifconfig 10.9.0.74 10.9.0.73
route 192.168.10.0 255.255.255.0 10.9.0.21
route 192.168.11.0 255.255.255.0 10.9.0.21
route 192.168.12.0 255.255.255.0 10.9.0.21
secret /home/k102/Documents/27-73-74_sergeev2.key
verb 4
tun-mtu 1400
mute 10
auth MD5
cipher DES-CBC
comp-lzo

Command:

sudo openvpn --config 27-73-74_sergeev2.ovpn

But I get this error:

Sun Feb 12 12:27:01 2012 us=30542 /sbin/ifconfig tap0 10.9.0.74 netmask 10.9.0.73 mtu 1400 broadcast 255.255.255.254
SIOCSIFNETMASK: Invalid argument
Sun Feb 12 12:27:01 2012 us=36280 Linux ifconfig failed: external program exited with error status: 1
Sun Feb 12 12:27:01 2012 us=36329 Exiting

I can't figure out what I have to do with it. How can I fix this?

share|improve this question

1 Answer 1

From the OpenVPN manual:

--ifconfig l rn

Set TUN/TAP adapter parameters. l is the IP address of the local VPN endpoint. [...] For TAP devices, rn is the subnet mask of the virtual ethernet segment which is being created or connected to.
[...]
For TAP devices, which provide the ability to create virtual ethernet segments, --ifconfig is used to set an IP address and subnet mask just as a physical ethernet adapter would be similarly configured. If you are attempting to connect to a remote ethernet bridge, the IP address and subnet should be set to values which would be valid on the the bridged ethernet segment (note also that DHCP can be used for the same purpose).

You're configuring a TAP device, so the second parameter of your ifconfig directive should be a subnet mask, not an IP address.

ifconfig 10.9.0.74 255.255.255.0 # or whatever mask you need
share|improve this answer
    
thanks! but how can i set start and end points? i mean what should i do with 10.9.0.73 address? –  k102 Feb 12 '12 at 9:02
1  
I don't understand your question. Start and end points to what? –  Mat Feb 12 '12 at 9:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.