tamilmad
This is my first post in this forum. I recently installed openvpn in openwrt 18.06 in ASUS RT-AC58U.
1. My public ip is xx:xxx:xxx:xxx which is a static ip provided by my ISP.
2. The IP of my ASUS AC58c is 192.168.2.1
3. My Computer LAN Ip is 192.168.2.7
4. VPN Server IP is 10.8.0.1 and the IP of the VPN Client (my computer through Windows TAP adapter VP) is 10.8.0.3)
5. My vpnserver conf file is as below
# Install packages
opkg update
opkg install openvpn-openssl
# Generate TLS PSK
EASYRSA_PKI="/etc/easy-rsa/pki"
openvpn --genkey --secret "${EASYRSA_PKI}/tc.pem"
# Configuration parameters
VPN_DEV="$(uci get firewall.@zone[0].device)"
VPN_POOL="10.8.0.0 255.255.255.0"
VPN_DNS="${VPN_POOL%.* *}.1"
VPN_DOMAIN="$(uci get dhcp.@dnsmasq[0].domain)"
EASYRSA_PKI="/etc/easy-rsa/pki"
DH_KEY="$(cat "${EASYRSA_PKI}/dh.pem")"
TC_KEY="$(sed -e "/^#/d;/^\w/N;s/\n//" "${EASYRSA_PKI}/tc.pem")"
CA_CERT="$(openssl x509 -in "${EASYRSA_PKI}/ca.crt")"
NL=$'\n'
# Configure VPN server
grep -l -r -e "TLS Web Server Authentication" "${EASYRSA_PKI}/issued" \
| sed -e "s/^.*\///;s/\.\w*$//" \
| while read VPN_ID
do
VPN_CONF="/etc/openvpn/${VPN_ID}.conf"
VPN_CERT="$(openssl x509 -in "${EASYRSA_PKI}/issued/${VPN_ID}.crt")"
VPN_KEY="$(cat "${EASYRSA_PKI}/private/${VPN_ID}.key")"
cat << EOF > "${VPN_CONF}"
verb 3
user nobody
group nogroup
dev ${VPN_DEV}
port 1194
proto udp
server ${VPN_POOL}
topology subnet
keepalive 10 120
persist-tun
persist-key
push "dhcp-option DNS ${VPN_DNS}"
push "dhcp-option DOMAIN ${VPN_DOMAIN}"
push "redirect-gateway def1"
push "persist-tun"
push "persist-key"
<dh>${NL}${DH_KEY}${NL}</dh>
<tls-crypt>${NL}${TC_KEY}${NL}</tls-crypt>
<ca>${NL}${CA_CERT}${NL}</ca>
<cert>${NL}${VPN_CERT}${NL}</cert>
<key>${NL}${VPN_KEY}${NL}</key>
EOF
chmod "u=rw,g=,o=" "${VPN_CONF}"
done
service openvpn restart
6: My Vpnclient configuration file is as below
verb 5
dev tun
nobind
client
redirect-gateway def1
remote xx.230.xx.xxx 1194 udp
float
auth-nocache
remote-cert-tls server
<tls-crypt>
-----BEGIN OpenVPN Static key V1-----
xxxx
-----END OpenVPN Static key V1-----
</tls-crypt>
<ca>
-----BEGIN CERTIFICATE-----
xx
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
xxx
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
xxx
-----END PRIVATE KEY-----
</key>
user nobody
group nogroup
dev tun0
7: In the CCD folder the vpnclient file has the following details
ifconfig-push 192.168.8.2 255.255.255.0
ifconfig-ipv6-push fdf1:7610:d152:3a9c::2/64
iroute 192.168.100.0 255.255.255.0
8. I am able to ping VPN Server 10.8.0.1 from my computer and I am able to ping 10.8.2.3 from the the server
9 Internet is working fine.
10. The route Print from Windows 10 is as below
C:\WINDOWS\system32>route print
===========================================================================
Interface List
17...00 ff b6 53 3f 32 ......TAP-Windows Adapter V9
18...00 0f 0f 60 11 c1 ......Realtek RTL8188FTV Wireless LAN 802.11n USB 2.0 Network Adapter
10...02 0f 0f 60 11 c1 ......Microsoft Wi-Fi Direct Virtual Adapter
4...00 0f 0f 60 11 c1 ......Microsoft Wi-Fi Direct Virtual Adapter #2
5...00 d8 61 31 0a 35 ......Realtek PCIe GBE Family Controller
9...00 ff 36 06 3c 9a ......Kaspersky Security Data Escort Adapter
1...........................Software Loopback Interface 1
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.2.1 192.168.2.7 35
0.0.0.0 128.0.0.0 10.8.0.1 10.8.0.3 259
10.8.0.0 255.255.255.0 On-link 10.8.0.3 259
10.8.0.3 255.255.255.255 On-link 10.8.0.3 259
10.8.0.255 255.255.255.255 On-link 10.8.0.3 259
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
128.0.0.0 128.0.0.0 10.8.0.1 10.8.0.3 259
192.168.2.0 255.255.255.0 On-link 192.168.2.7 291
192.168.2.1 255.255.255.255 192.168.2.1 192.168.2.7 291
192.168.2.7 255.255.255.255 On-link 192.168.2.7 291
192.168.2.255 255.255.255.255 On-link 192.168.2.7 291
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 10.8.0.3 259
224.0.0.0 240.0.0.0 On-link 192.168.2.7 291
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 10.8.0.3 259
255.255.255.255 255.255.255.255 On-link 192.168.2.7 291
===========================================================================
Persistent Routes:
None
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
1 331 ::1/128 On-link
5 291 fdb5:39cd:1ddc::/48 fe80::42b0:76ff:fe58:c858
5 291 fdb5:39cd:1ddc::/64 On-link
5 291 fdb5:39cd:1ddc::7/128 On-link
5 291 fdb5:39cd:1ddc:0:2162:a2a:5c04:a11/128
On-link
5 291 fdb5:39cd:1ddc:0:242f:336b:77e4:cb55/128
On-link
17 259 fe80::/64 On-link
5 291 fe80::/64 On-link
5 291 fe80::2162:a2a:5c04:a11/128
On-link
17 259 fe80::c913:f45d:7f7b:5ea2/128
On-link
1 331 ff00::/8 On-link
17 259 ff00::/8 On-link
5 291 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
====================================================================
11: Route -n from vpnserver terminal is as below.
root@OpenWrt:/etc/openvpn# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 103.206.8.74 0.0.0.0 UG 0 0 0 pppoe-wan
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
103.206.8.74 0.0.0.0 255.255.255.255 UH 0 0 0 pppoe-wan
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan
12. Trace route of openwrt.org from vpnserver terminal is as below
root@OpenWrt:/etc/openvpn# traceroute openvpn.org
traceroute to openvpn.org (104.16.184.48), 30 hops max, 38 byte packets
1 103.206.8.74 (103.206.8.74) 0.903 ms 1.314 ms 1.231 ms
2 * * *
3 103.38.129.22 (103.38.129.22) 2.857 ms 1.493 ms 1.661 ms
4 * * *
5 14.143.172.17.static-Kolkatta.vsnl.net.in (14.143.172.17) 2.008 ms 1.489 ms 1.761 ms
6 172.23.78.238 (172.23.78.238) 33.567 ms 28.901 ms 33.056 ms
7 14.142.22.202.static-Mumbai.vsnl.net.in (14.142.22.202) 35.004 ms 35.213 ms 29.446 ms
8 * * *
9 220.227.70.97 (220.227.70.97) 34.847 ms 34.499 ms 40.082 ms
10 104.16.184.48 (104.16.184.48) 52.115 ms 34.127 ms 34.125 ms
root@OpenWrt:/etc/openvpn#
13. Trace route of openwrt.org from windows 10 command prompt with vpn connected is as below
C:\WINDOWS\system32>tracert openwrt.org
Tracing route to openwrt.org [139.59.209.225]
over a maximum of 30 hops:
1 1 ms 1 ms 1 ms 10.8.0.1
2 2 ms 1 ms 2 ms 103.206.8.74
3 4 ms * * 103.38.129.65
4 3 ms 2 ms 2 ms 14.143.172.17.static-Kolkatta.vsnl.net.in [14.143.172.17]
5 32 ms 33 ms 33 ms 172.23.183.134
6 37 ms 32 ms 32 ms ix-ae-0-100.tcore1.mlv-mumbai.as6453.net [180.87.38.5]
7 166 ms 166 ms 163 ms if-ae-5-2.tcore1.wyn-marseille.as6453.net [80.231.217.29]
8 164 ms 159 ms 163 ms if-ae-2-2.tcore2.wyn-marseille.as6453.net [80.231.217.2]
9 163 ms 162 ms 163 ms if-ae-7-2.tcore2.fnm-frankfurt.as6453.net [80.231.200.78]
10 153 ms 151 ms 150 ms if-ae-4-2.tcore1.fr0-frankfurt.as6453.net [195.219.87.18]
11 163 ms 163 ms 189 ms 195.219.50.42
12 * * * Request timed out.
13 170 ms 169 ms 166 ms wiki-01.infra.openwrt.org [139.59.209.225]
Trace complete.
14. Trace route of openvpn.org from windows10 command prompt without vpn connection is as below
C:\WINDOWS\system32>tracert openwrt.org
Tracing route to openwrt.org [139.59.209.225]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms OpenWrt.lan [192.168.2.1]
2 1 ms <1 ms 1 ms 103.206.8.74
3 * * * Request timed out.
4 2 ms 3 ms 2 ms 14.143.172.17.static-Kolkatta.vsnl.net.in [14.143.172.17]
5 29 ms 29 ms 29 ms 172.23.183.134
6 31 ms 30 ms 29 ms ix-ae-0-100.tcore1.mlv-mumbai.as6453.net [180.87.38.5]
7 161 ms 161 ms 161 ms if-ae-5-2.tcore1.wyn-marseille.as6453.net [80.231.217.29]
8 158 ms 160 ms 163 ms if-ae-2-2.tcore2.wyn-marseille.as6453.net [80.231.217.2]
9 156 ms 156 ms 171 ms if-ae-7-2.tcore2.fnm-frankfurt.as6453.net [80.231.200.78]
10 147 ms 146 ms 146 ms if-ae-4-2.tcore1.fr0-frankfurt.as6453.net [195.219.87.18]
11 160 ms 160 ms 162 ms 195.219.50.42
12 * * * Request timed out.
13 164 ms 163 ms 163 ms wiki-01.infra.openwrt.org [139.59.209.225]
Trace complete.
15. Query on my public ip returns actuaally my public ip address without any change.
Can someone guide me further on this.
Thanks