I'm connected via ssh to a remote Debian GNU/Linux 7 (wheezy) server. I've installed OpenVPN on that server, and the configuration and credentials for a OpenVPN client. If I establish the VPN connection from Debian GNU/Linux 7 (wheezy), I lose my ssh connection. No ping. Please help me.
ifconfig:
eth0 Link encap:Ethernet HWaddr 6c:62:6d:xx:xx:xx
inet addr:46.4.xxx.145 Bcast:46.4.xxx.159 Mask:255.255.255.224
inet6 addr: fe80::6e62:6dff:fed5:5800/64 Scope:Link
inet6 addr: 2a01:4f8:141:40c::2/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1531 errors:0 dropped:0 overruns:0 frame:0
TX packets:1292 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:144334 (140.9 KiB) TX bytes:400326 (390.9 KiB)
Interrupt:42 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
network:
auto eth0
iface eth0 inet static
address 46.4.xxx.145
broadcast 46.4.xxx.159
netmask 255.255.255.224
gateway 46.4.xxx.129
# default route to access subnet
up route add -net 46.4.xxx.128 netmask 255.255.255.224 gw 46.4.xxx.129 eth0
pre-up iptables-restore < /etc/ip_rulles.lst
post-down iptables-save > /etc/ip_rulles.lst
/etc/ip_rulles.lst:
# Generated by iptables-save v1.4.14 on Wed Aug 13 00:58:10 2014
*filter
:INPUT ACCEPT [2838:229297]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2464:528236]
:fail2ban-SSH - [0:0]
-A INPUT -p tcp -m tcp --dport 22 -j fail2ban-SSH
-A INPUT -p tcp -m tcp --dport 22 -j fail2ban-SSH
-A INPUT -p tcp -m tcp --dport 22 -j fail2ban-SSH
-A INPUT -p tcp -m tcp --dport 22 -j fail2ban-SSH
-A fail2ban-SSH -j RETURN
-A fail2ban-SSH -j RETURN
-A fail2ban-SSH -j RETURN
COMMIT
# Completed on Wed Aug 13 00:58:10 2014
# Generated by iptables-save v1.4.14 on Wed Aug 13 00:58:10 2014
*nat
:PREROUTING ACCEPT [10:580]
:INPUT ACCEPT [10:580]
:OUTPUT ACCEPT [30:1800]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Wed Aug 13 00:58:10 2014
# Generated by iptables-save v1.4.14 on Wed Aug 13 00:58:10 2014
*mangle
:PREROUTING ACCEPT [2838:229297]
:INPUT ACCEPT [2838:229297]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2466:528358]
:POSTROUTING ACCEPT [2466:528358]
COMMIT
# Completed on Wed Aug 13 00:58:10 2014
route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default static.129.107. 0.0.0.0 UG 0 0 0 eth0
46.4.xxx.128 static.129.107. 255.255.255.224 UG 0 0 0 eth0
46.4.xxx.128 * 255.255.255.224 U 0 0 0 eth0
openvpn.conf:
dev tun
client
proto tcp
remote 46.165.xxx.xxx 1723
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/.key/ca.crt
dh /etc/openvpn/.key/dh1024.pem
cert /etc/openvpn/.key/client.crt
key /etc/openvpn/.key/client.key
;tls-auth /etc/openvpn/.tls/ta.key 1
ns-cert-type server
push "route 46.4.xxx.145 255.255.255.255"
cipher AES-256-CBC
auth SHA512
comp-lzo
verb 4
mute 20
user openvpn
group openvpn
log-append /var/log/openvpn/openvpn_client.log
status /var/log/openvpn/status_client.log
After
service openvpn start
on client (Debian GNU/Linux 7 (wheezy)), i lose my ssh connection and no more ping to the client. When i stop openvpn server and reboot client(Debian GNU/Linux 7 (wheezy)), ssh establish success and ping working...
how to keep accessible the services that run on the interface eth0, after connecting to the VPN server?