As I sayed all configs the same as in manual. First server running on port 444, not 443.
But I realize, it can be hard to understand when all comments at another language, so, I copyed listings.
Pinpoint: it is double vpn configuration - myPC <=> vpn server 1.1.1.1 <=> vpn server 2.2.2.2 <=> internet
server1.conf
port 444
local 1.1.1.1
dev tun
proto tcp-server
ifconfig 192.168.1.1 192.168.1.2
tls-server
daemon
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key
dh /etc/openvpn/dh2048.pem
tls-auth /etc/openvpn/tls.key 0
cipher AES-256-CBC
max-clients 1
persist-key
persist-tun
script-security 3
log /dev/null
fast-io
sndbuf 393216
rcvbuf 393216
push "sndbuf 393216"
push "rcvbuf 393216"
tun-mtu 1500
up /etc/openvpn/up.sh
down /etc/openvpn/down.sh
up.sh
#!/bin/bash
LIP=1.1.1.1
/sbin/iptables -t nat -A PREROUTING -p tcp -d $LIP --dport 443 -j DNAT --to-destination 192.168.1.2
/sbin/iptables -t nat -A POSTROUTING -s 192.168.1.2 -j SNAT --to $LIP
down.sh
LIP=1.1.1.1
/sbin/iptables -t nat -D PREROUTING -p tcp -d $LIP --dport 443 -j DNAT --to-destination 192.168.1.2
/sbin/iptables -t nat -D POSTROUTING -s 192.168.1.2 -j SNAT --to $LIP
client.conf on server 2
dev tun0
remote 1.1.1.1
port 444
proto tcp-client
ifconfig 192.168.1.2 192.168.1.1
tls-client
daemon
script-security 3 system
ns-cert-type server
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/cli.crt
key /etc/openvpn/keys/cli.key
dh /etc/openvpn/keys/dh2048.pem
tls-auth /etc/openvpn/keys/tls.key 1
cipher AES-256-CBC
persist-key
persist-tun
log /dev/null
verb 0
up /etc/openvpn/up.sh
down /etc/openvpn/down.sh
fast-io
tun-mtu 1500
up.sh
#!/bin/bash
echo "101 ip_1" >>/etc/iproute2/rt_tables
IP=`which ip`
$IP rule add to 192.168.1.2 table ip_1
$IP rule add from 192.168.1.2 table ip_1
$IP route add default via 192.168.1.1 table ip_1
down.sh
#!/bin/bash
IP=`which ip`
$IP route del default via 192.168.1.1 table ip_1
$IP rule del table ip_1
$IP rule del table ip_1
sed -i '/101 ip_1/d' /etc/iproute2/rt_tables
At this point, when I do "ping 192.168.1.1" it working fine. As manual say it means correct configuration.
trouble in server2.conf
port 443
local 192.168.1.2
proto tcp
dev tun1
server 10.8.0.0 255.255.255.0
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key
dh /etc/openvpn/dh2048.pem
tls-auth /etc/openvpn/tls.key 0
cipher AES-256-CBC
status /dev/null
log-append /dev/null
verb 0
max-clients 30
keepalive 10 120
tls-server
comp-lzo
persist-key
persist-tun
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
fast-io
sndbuf 393216
rcvbuf 393216
push "sndbuf 393216"
push "rcvbuf 393216"
tun-mtu 1500
When I trying to start it I get an error "TCP/UDP: Socket bind failed on local address [AF_INET]192.168.1.2:443: Cannot assign requested address"