Linux ifconfig inet6 failed external program exited with error status 1

ошибки в маршрутизации 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)

Читайте также:  Sap logon ��� linux

если речь о том когда я пытался добавить

Чтобы видеть сеть за клиентом, этот клиент должен являться маршрутизатором в своей сети. Хотя бы для сети той, что за сервером.

это отдельная песня как я буду заворачивать приходящий трафик на клиента в сеть, ее я буду реализовывать сам. Пока моя задача видеть пинговать с обоих серверов друг друга как по ip тунельным так и по физическим реальным адресам

Источник

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.

Читайте также:  Latest phone with windows

I’ve been unable to find out how to debug the «ifconfig failed» message. Any help would be appreciated.

Источник

OpenVPN Support Forum

Community Support Forum

ERROR: Linux route add command failed: external program exited with error status: 1

ERROR: Linux route add command failed: external program exited with error status: 1

Post by radu » Tue Oct 25, 2016 6:05 pm

I have a configuration that allowed me to route all traffic through VPN for about a year, but after a dd-wrt update I just couldn’t make it work anymore, was failing to add route. Unortunately had a TP-Link when it worked, did a restore to original firmware and they blocked custom firmware; ow new client router also says «Linux route add command failed» but » external program exited with error status: 1″ instead of status: 2, as TP-Link did:

State
Client: CONNECTED SUCCESS
Local Address: 10.1.1.2
Remote Address: 10.1.1.2

Status
VPN Client Stats
TUN/TAP read bytes 17171
TUN/TAP write bytes 0
TCP/UDP read bytes 3735
TCP/UDP write bytes 23022
Auth read bytes 64
pre-compress bytes 7914
post-compress bytes 7988
pre-decompress bytes 0
post-decompress bytes 0

Log
Clientlog:
20161025 20:20:17 I OpenVPN 2.3.12 arm-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Oct 18 2016
20161025 20:20:17 I library versions: OpenSSL 1.0.2j 26 Sep 2016 LZO 2.09
20161025 20:20:17 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:16
20161025 20:20:17 W WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
20161025 20:20:17 W NOTE: the current —script-security setting may allow this configuration to call user-defined scripts
20161025 20:20:17 W WARNING: file ‘/tmp/openvpncl/client.key’ is group or others accessible
20161025 20:20:17 Socket Buffers: R=[87380->87380] S=[16384->16384]
20161025 20:20:17 I Attempting to establish TCP connection with [AF_INET]82.xx.xx.48:443 [nonblock]
20161025 20:20:18 I TCP connection established with [AF_INET]82.xx.xx.48:443
20161025 20:20:18 I TCPv4_CLIENT link local: [undef]
20161025 20:20:18 I TCPv4_CLIENT link remote: [AF_INET]82.xx.xx.48:443
20161025 20:20:18 TLS: Initial packet from [AF_INET]82.xx.xx.48:443 sid=7e483803 e26adfea
20161025 20:20:18 VERIFY OK: depth=1 C=xx ST=xx L=xxx O=Radu OU=HomeServer CN=HomeServer name=HomeServer emailAddress=xx@xx.com
20161025 20:20:18 VERIFY OK: depth=0 C=xx ST=xx L=xx O=Radu OU=HomeServer CN=NightHawk name=NightHawk emailAddress=xx@oxx.com
20161025 20:20:18 NOTE: —mute triggered.
20161025 20:20:18 1 variation(s) on previous 3 message(s) suppressed by —mute
20161025 20:20:18 W WARNING: this cipher’s block size is less than 128 bit (64 bit). Consider using a —cipher with a larger block size.
20161025 20:20:18 Data Channel Encrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
20161025 20:20:18 Data Channel Decrypt: Cipher ‘BF-CBC’ initialized with 128 bit key
20161025 20:20:18 W WARNING: this cipher’s block size is less than 128 bit (64 bit). Consider using a —cipher with a larger block size.
20161025 20:20:18 Data Channel Decrypt: Using 160 bit message hash ‘SHA1’ for HMAC authentication
20161025 20:20:18 Control Channel: TLSv1.2 cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384 1024 bit RSA
20161025 20:20:18 I [NightHawk] Peer Connection Initiated with [AF_INET]82.xx.xx.48:443
20161025 20:20:20 SENT CONTROL [NightHawk]: ‘PUSH_REQUEST’ (status=1)
20161025 20:20:20 PUSH: Received control message: ‘PUSH_REPLY route 192.168.1.1 255.255.255.0 redirect-gateway def1 dhcp-option DNS 193.xx.xx.1 route-gateway 10.1.1.1 topology subnet ping 10 ping-restart 120 socket-flags TCP_NODELAY ifconfig 10.1.1.2 255.255.255.0’
20161025 20:20:20 OPTIONS IMPORT: timers and/or timeouts modified
20161025 20:20:20 NOTE: —mute triggered.
20161025 20:20:20 5 variation(s) on previous 3 message(s) suppressed by —mute
20161025 20:20:20 I TUN/TAP device tun1 opened
20161025 20:20:20 TUN/TAP TX queue length set to 100
20161025 20:20:20 I do_ifconfig tt->ipv6=1 tt->did_ifconfig_ipv6_setup=0
20161025 20:20:20 I /sbin/ifconfig tun1 10.1.1.2 netmask 255.255.255.0 mtu 1500 broadcast 10.1.1.255
20161025 20:20:20 /sbin/route add -net 82.79.46.48 netmask 255.255.255.255 gw 192.168.0.1
20161025 20:20:20 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.1.1.1
20161025 20:20:20 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 10.1.1.1
20161025 20:20:20 /sbin/route add -net 192.168.1.1 netmask 255.255.255.0 gw 10.1.1.1
20161025 20:20:20 W ERROR: Linux route add command failed: external program exited with error status: 1
20161025 20:20:20 I Initialization Sequence Completed
20161025 20:20:22 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:16
20161025 20:20:22 D MANAGEMENT: CMD ‘state’
20161025 20:20:22 MANAGEMENT: Client disconnected

Читайте также:  Не идет установка mac os

This would be the server log:
20161025 20:20:17 I TCP connection established with [AF_INET]95.xx.xx.1:60182
20161025 20:20:18 95.91.250.1:60182 TLS: Initial packet from [AF_INET]95.xx.xx.1:60182 sid=ca05dfea e5bb0e4e
20161025 20:20:18 95.91.250.1:60182 VERIFY OK: depth=1 C=xx ST=xx L=xx O=Radu OU=HomeServer CN=HomeServer name=HomeServer emailAddress=xx@xx.com
20161025 20:20:18 95.91.250.1:60182 VERIFY OK: depth=0 C=xx ST=xx L=xx O=Radu OU=HomeServer CN=Archer name=Archer emailAddress=xx@xx.com
20161025 20:20:18 95.91.250.1:60182 NOTE: —mute triggered.
20161025 20:20:18 95.91.250.1:60182 5 variation(s) on previous 3 message(s) suppressed by —mute
20161025 20:20:18 I 95.91.250.1:60182 [Archer] Peer Connection Initiated with [AF_INET]95.xx.xx.1:60182
20161025 20:20:18 I Archer/95.xx.xx.1:60182 MULTI_sva: pool returned IPv4=10.1.1.2 IPv6=(Not enabled)
20161025 20:20:18 Archer/95.xx.xx.1:60182 OPTIONS IMPORT: reading client specific options from: /tmp/openvpn_cc_044afbfeb0c46a9ca6edba6296966941.tmp
20161025 20:20:18 Archer/95.xx.xx.1:60182 MULTI: Learn: 10.1.1.2 -> Archer/95.xx.xx.1:60182
20161025 20:20:18 Archer/95.xx.xx.1:60182 MULTI: primary virtual IP for Archer/95.xx.xx.1:60182: 10.1.1.2
20161025 20:20:20 Archer/95.xx.xx.1:60182 PUSH: Received control message: ‘PUSH_REQUEST’
20161025 20:20:20 I Archer/95.xx.xx.1:60182 send_push_reply(): safe_cap=940
20161025 20:20:20 Archer/95.xx.xx.1:60182 SENT CONTROL [Archer]: ‘PUSH_REPLY route 192.168.1.1 255.255.255.0 redirect-gateway def1 dhcp-option DNS 193.xx.xx.1 route-gateway 10.1.1.1 topology subnet ping 10 ping-restart 120 socket-flags TCP_NODELAY ifconfig 10.1.1.2 255.255.255.0’ (status=1)

Here are the configs (firewall and IP v6 off):

SERVER CONFIG (Home Location router); LAN IP: 192.168.1.1

Start Type: System
Config as: Server
Server Mode: Router (TUN)
Network: 10.1.1.0
Netmask: 255.255.255.0
Port: 443
Tunnel Protocol: TCP
Encryptions Cipher: Blowfish CBC
Hash Algorithm: SHA1
Advanced Options: Disable

Additional Config:
push «route 192.168.1.0 255.255.255.0»
push «dhcp-option DNS [provider dns]»
push «dhcp-option DNS [2nd provider dns]»
push «redirect-gateway def1»
server 10.1.1.0 255.255.255.0
dev tun0
proto tcp-server
keepalive 10 120
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem

CLIENT CONFIG (roaming location router); LAN IP: 192.168.2.1

Server IP/Name: [ddns link]
Port: 443
Tunnel Device: TUN
Tunnel Protocol: TCP
Encryption Cipher: Blowfish CBC
Hash Algorithm: SHA1
Advanced Options: Disable

Источник

Оцените статью