SIOCSIFNETMASK: Argumento inválido usando o OpenVPN no Ubuntu

1

Tentando configurar o cliente OpenVPN no meu desktop Ubuntu.

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

Comando:

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

Mas recebo este erro:

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

Eu não consigo descobrir o que tenho a ver com isso. Como posso consertar isso?

    
por k102 12.02.2012 / 09:40

1 resposta

1

Do manual do OpenVPN:

--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).

Você está configurando um dispositivo TAP, então o segundo parâmetro da diretiva ifconfig deve ser uma máscara de sub-rede, não um endereço IP.

ifconfig 10.9.0.74 255.255.255.0 # or whatever mask you need
    
por 12.02.2012 / 09:58