OpenVPN Support Forum
Community Support Forum
Linux ifconfig failed: external program exited with error
Linux ifconfig failed: external program exited with error
Post by toddinpal » Tue Dec 09, 2014 3:56 pm
I’m trying to set up Raspbian to access my server and I’m getting the following error:
Linux ifconfig failed: external program exited with error status: 1
Here is my client.conf file:
client
topology subnet
dev tun
port 1194
proto udp
remote somesite.domain 1194
#nobind
ca /etc/openvpn/ca.crt
cert /etc/openvpn/pi.crt
key /etc/openvpn/pi.key
comp-lzo
persist-key
persist-tun
verb 3
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
script-security 3 system
And this is what’s in the daemon.log:
Dec 9 09:48:38 raspberrypi ovpn-client[17553]: OpenVPN 2.2.1 arm-linux-gnueabihf [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Dec 1 2014
Dec 9 09:48:38 raspberrypi ovpn-client[17553]: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Dec 9 09:48:38 raspberrypi ovpn-client[17553]: NOTE: the current —script-security setting may allow this configuration to call user-defined scripts
Dec 9 09:48:38 raspberrypi ovpn-client[17553]: NOTE: —script-security method=’system’ is deprecated due to the fact that passed parameters will be subject to shell expansion
Dec 9 09:48:41 raspberrypi ovpn-client[17553]: WARNING: this configuration may cache passwords in memory — use the auth-nocache option to prevent this
Dec 9 09:48:41 raspberrypi ovpn-client[17553]: LZO compression initialized
Dec 9 09:48:41 raspberrypi ovpn-client[17553]: Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Dec 9 09:48:41 raspberrypi ovpn-client[17553]: Socket Buffers: R=[163840->131072] S=[163840->131072]
Dec 9 09:48:41 raspberrypi ovpn-client[17553]: Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Dec 9 09:48:41 raspberrypi ovpn-client[17553]: Local Options hash (VER=V4): ‘41690919’
Dec 9 09:48:41 raspberrypi ovpn-client[17553]: Expected Remote Options hash (VER=V4): ‘530fdded’
Dec 9 09:48:41 raspberrypi ovpn-client[17618]: UDPv4 link local (bound): [undef]
Dec 9 09:48:41 raspberrypi ovpn-client[17618]: UDPv4 link remote: [AF_INET]192.210.237.161:1194
Dec 9 09:48:41 raspberrypi ovpn-client[17618]: TLS: Initial packet from [AF_INET]192.210.237.161:1194, sid=f63a68ff 82e8da7e
Dec 9 09:48:41 raspberrypi ovpn-client[17618]: VERIFY OK: depth=1, /CN=scottlittle.me
Dec 9 09:48:41 raspberrypi ovpn-client[17618]: VERIFY OK: depth=0, /CN=server
Dec 9 09:48:43 raspberrypi ovpn-client[17618]: Data Channel Encrypt: Cipher ‘BF-CBC’ initialized with 128 bit key
Dec 9 09:48:43 raspberrypi ovpn-client[17618]: Data Channel Encrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Dec 9 09:48:43 raspberrypi ovpn-client[17618]: Data Channel Decrypt: Cipher ‘BF-CBC’ initialized with 128 bit key
Dec 9 09:48:43 raspberrypi ovpn-client[17618]: Data Channel Decrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Dec 9 09:48:43 raspberrypi ovpn-client[17618]: Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Dec 9 09:48:43 raspberrypi ovpn-client[17618]: [server] Peer Connection Initiated with [AF_INET]192.210.237.161:1194
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: SENT CONTROL [server]: ‘PUSH_REQUEST’ (status=1)
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: PUSH: Received control message: ‘PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 120,ifconfig 10.8.0.20 10.8.0.1’
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: OPTIONS IMPORT: timers and/or timeouts modified
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: OPTIONS IMPORT: —ifconfig/up options modified
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: OPTIONS IMPORT: route options modified
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: OPTIONS IMPORT: route-related options modified
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: OPTIONS IMPORT: —ip-win32 and/or —dhcp-option options modified
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: ROUTE default_gateway=192.168.42.10
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: TUN/TAP device tun0 opened
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: TUN/TAP TX queue length set to 100
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: /sbin/ifconfig tun0 10.8.0.20 netmask 10.8.0.1 mtu 1500 broadcast 255.255.255.254
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: Linux ifconfig failed: external program exited with error status: 1
Dec 9 09:48:45 raspberrypi ovpn-client[17618]: Exiting
Dec 9 09:48:45 raspberrypi ifplugd(tun0)[16271]: Exiting.
I’ve been unable to find out how to debug the «ifconfig failed» message. Any help would be appreciated.
ошибки в маршрутизации openvpn
Здравствуйте. Поднимаю openvpn. Клиент подключается по впн к серверу, видит локальную сеть за сервером. А сервер в свою очередь сеть за клиентом не видит (а очень хочется чтоб видел). Преследуемая цель — пользователи обоих сетей видят сети друг друга. конфиг сервера.
на чём сидит клиент?
оба сервера на убунту сервер 16.04
А на клиента перенаправление трафика разрешено?
форвардинг в /etc/sysctl.conf раскоментирован.
мля, опять клиент не является маршрутом по умолчанию для своей сети и очередной идиот ноет, что у него не работает.
ну спасибо на добром слове, сам то ты все сразу умел?
Начнём с того, что иптаблесы никакие не нужны. Нужно, чтобы умели оба маршрутизовать (net.ipv4.ip_forward) и чтобы были прописаны маршруты. Причём на клиент маршруты до сети сервака пушатся через конфиг у тебя, а на сервере маршрута до сети клиента нет. Не знаю, можно ли это через конфиги сделать, но можешь создать статический маршрут до сети клиента через VPN адрес клиента.
Хорошо, а что говорит ip r на сервере? Если там маршрут есть, то поставь на клиенте tcpdump и посмотри, доходят ли пакеты. Если доходят — посмотри на физическом интерфейсе, уходят ли, может быть так, что они уходят, но не возвращаются. Дальше уже в зависимости от того, что увидишь
на клиенте ничего не дропается, ufw пока отключил. маршрутизация у обоих включена. При добавление маршрута
Хочу поправится, клиент действительно не является шлюзом в своей сети, поэтому цель пока чтобы и клиент и сервер видели именно по тунелю не только тунельные ip друг друга (10.8.0.1,10.8.0.2), но и физические (10.27.1.5,10.2.1.5). На данный момент это может пока только клиент.
В логе openvpn что-нибудь есть? У тебя, насколько я помню документацию, сейчас подключение идёт не как нормальная подсеть, а как peer-to-peer. Соответственно, 10.8.0.2 — это адрес пира, которому сервер посылает данные, а у клиента должен быть .3 (там у них где-то таблица разрешённых адресов была, лень гуглить). Попробуй перенастроить клиент на другой адрес
помоему в логах ничего криминального. Да, ifconfig мне подсказывает что peer-to-peer
Ты, кстати, можешь сделать нормальную подсеть, сделав dev tap, а не tun
Ты на клиенте добавляешь? 10.8.0.2 — это что, ип сервера? Вроде он с .1 начинает.
Чтобы видеть сеть за клиентом, этот клиент должен являться маршрутизатором в своей сети. Хотя бы для сети той, что за сервером.
Лучше начни с того, что расскажие какие ипы по впн и в локалке у клиента и сервера. И какая таблица маршрутизации на каждом.
к сожалению не заработало. Попробовал в конфигах серва и клиента поменять tun на tap соединение вообще перестало происходить (правильно я понял ? только это менять в конфигах, остальное остается без изменений?)
тунельный ip 10.8.0.1
тунельный ip 10.8.0.4 (теперь уже, до момента когда мне XMs посоветовал его поменять был 10.8.0.2)
если речь о том когда я пытался добавить
Чтобы видеть сеть за клиентом, этот клиент должен являться маршрутизатором в своей сети. Хотя бы для сети той, что за сервером.
это отдельная песня как я буду заворачивать приходящий трафик на клиента в сеть, ее я буду реализовывать сам. Пока моя задача видеть пинговать с обоих серверов друг друга как по ip тунельным так и по физическим реальным адресам
OpenVPN Support Forum
Community Support Forum
[SOLVED] Linux ifconfig failed: external program exited
[SOLVED] Linux ifconfig failed: external program exited
Post by damog » Fri Apr 26, 2013 7:34 pm
To start, I’ll say that I’m a bit new in this VPN thing, and my problem is probably a stupid question, and easy to solve, but anyway, I’m here to learn, so I’ll go on.
My university offers a VPN service to access de local net, and I’d like to use this service to create what I read is called ‘tunnel’ and thus gain access, via ssh, to the computer in my office, so I can work from home (or really from anywhere).
Thing is, from my university web, they give certain instructions in order to connect via VPN. The instructions may be a bit simple, and there are no solutions for possible problems, buuut.
The first thing they’re saying is that I need to download two files: one config file, and one certificate.
And then, once the VPN is installed in my laptop, I have to enter the following command (I’m using Ubuntu 12.04):
Obviously, where it says ‘config file’ and ‘certificate file’ I substitute the path and the name of the files (although, just to make things easier, I go inside the directory where this files are, and I simply write the files’ names).
Well, once I enter the previous command, I get the following output:
Fri Apr 26 21:10:47 2013 WARNING: Make sure you understand the semantics of —tls-remote before using it (see the man page).
Fri Apr 26 21:10:47 2013 NOTE: OpenVPN 2.1 requires ‘—script-security 2’ or higher to call user-defined scripts or executables
Fri Apr 26 21:10:47 2013 LZO compression initialized
Fri Apr 26 21:10:47 2013 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Fri Apr 26 21:10:47 2013 Socket Buffers: R=[229376->131072] S=[229376->131072]
Fri Apr 26 21:10:47 2013 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Fri Apr 26 21:10:47 2013 Local Options hash (VER=V4): ‘41690919’
Fri Apr 26 21:10:47 2013 Expected Remote Options hash (VER=V4): ‘530fdded’
Fri Apr 26 21:10:47 2013 UDPv4 link local: [undef]
Fri Apr 26 21:10:47 2013 UDPv4 link remote: [AF_INET]130.206.31.230:1194
Fri Apr 26 21:10:47 2013 TLS: Initial packet from [AF_INET]130.206.31.230:1194, sid=a0bbf5f9 e6845359
Fri Apr 26 21:10:48 2013 VERIFY OK: depth=2, /CN=UIB_CA/ST=IB/C=ES/emailAddress=xcti@uib.es/O=Universitat_de_les_Illes_Balears/OU=CTI_Centre_de_Tecnologies_de_la_Informaci_xC3_xB3
Fri Apr 26 21:10:48 2013 VERIFY OK: depth=1, /CN=UIB_Network_CA/ST=IB/C=ES/emailAddress=xcti@uib.es/O=UIB/OU=CTI_Area_de_Xarxes_i_Comunicacions
Fri Apr 26 21:10:48 2013 Validating certificate key usage
Fri Apr 26 21:10:48 2013 ++ Certificate has key usage 00a0, expects 00a0
Fri Apr 26 21:10:48 2013 VERIFY KU OK
Fri Apr 26 21:10:48 2013 Validating certificate extended key usage
Fri Apr 26 21:10:48 2013 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Fri Apr 26 21:10:48 2013 VERIFY EKU OK
Fri Apr 26 21:10:48 2013 VERIFY X509NAME OK: /CN=sonvich.uib.es/O=UIB/C=ES
Fri Apr 26 21:10:48 2013 VERIFY OK: depth=0, /CN=sonvich.uib.es/O=UIB/C=ES
Fri Apr 26 21:10:48 2013 Data Channel Encrypt: Cipher ‘BF-CBC’ initialized with 128 bit key
Fri Apr 26 21:10:48 2013 Data Channel Encrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Fri Apr 26 21:10:48 2013 Data Channel Decrypt: Cipher ‘BF-CBC’ initialized with 128 bit key
Fri Apr 26 21:10:48 2013 Data Channel Decrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Fri Apr 26 21:10:48 2013 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Fri Apr 26 21:10:48 2013 [sonvich.uib.es] Peer Connection Initiated with [AF_INET]130.206.31.230:1194
Fri Apr 26 21:10:50 2013 SENT CONTROL [sonvich.uib.es]: ‘PUSH_REQUEST’ (status=1)
Fri Apr 26 21:10:50 2013 PUSH: Received control message: ‘PUSH_REPLY,route-gateway 10.150.0.13,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 130.206.33.1,ping 10,ping-restart 60,ifconfig 10.150.98.6 255.255.0.0’
Fri Apr 26 21:10:50 2013 OPTIONS IMPORT: timers and/or timeouts modified
Fri Apr 26 21:10:50 2013 OPTIONS IMPORT: —ifconfig/up options modified
Fri Apr 26 21:10:50 2013 OPTIONS IMPORT: route options modified
Fri Apr 26 21:10:50 2013 OPTIONS IMPORT: route-related options modified
Fri Apr 26 21:10:50 2013 OPTIONS IMPORT: —ip-win32 and/or —dhcp-option options modified
Fri Apr 26 21:10:50 2013 ROUTE default_gateway=192.168.1.1
Fri Apr 26 21:10:50 2013 Note: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
Fri Apr 26 21:10:50 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Apr 26 21:10:50 2013 /sbin/ifconfig 10.150.98.6 netmask 255.255.0.0 mtu 1500 broadcast 10.150.255.255
SIOCSIFADDR: Permission denied
: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: Permission denied
SIOCSIFMTU: Operation not permitted
SIOCSIFBRDADDR: Permission denied
: ERROR while getting interface flags: No such device
Fri Apr 26 21:10:50 2013 Linux ifconfig failed: external program exited with error status: 255
Fri Apr 26 21:10:50 2013 Exiting
And it goes back to the prompt.
And, to say truth, I’m as lost as an octopus in a garage (as we say in Spain), because I don’t have any idea about where the problem could be.
EDIT: Sorry I wrote it in Spanish! I dont know why but my head messed up and made me think this was a Spanish forum. xD