Hello,
i'm developing a university project using the virtual network lab "Netkit". On a small net some clients can connect to a backend server using a vpn. To start i'm using just one client, i've configured both on client and server openVPN and despite it does not seem to be any error, i can't ping in any way.
On the server i've also tried to
telnet localhost 1194
but i got "connection refused"
the client has ip 202.0.1.11
the server has ip 201.0.3.16
Here's the output of ifconfig tun0 on server
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.1 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 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:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Here's the server.conf file
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/serverBackEnd.crt
key /etc/openvpn/easy-rsa/keys/serverBackEnd.key # This file should be kept secret
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
the server startup config file with the iptable:
ifconfig eth0 201.0.3.16 netmask 255.255.255.0 up
route add default gw 201.0.3.1 dev eth0
/etc/init.d/apache2 start
/etc/init.d/openvpn start
openvpn --mktun --dev tun0
ifconfig tun0 10.8.0.1 netmask 255.255.255.0 up
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -s 200.0.0.0/16 -j DROP
iptables -A INPUT -p tcp --dport 22 -s 200.0.0.0/16 -j DROP
iptables -A INPUT -p tcp --dport 23 -s 200.0.0.0/16 -j DROP
iptables -A INPUT -p tcp --dport 80 -s 201.0.0.0/16 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -s 202.0.0.0/16 -j ACCEPT :?:
iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT
iptables -A FORWARD -d $LANINT -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 202.0.1.11
Here the client "ifconfig tun0" output
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.2 P-t-P:10.8.0.2 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 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:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Here's the client.conf file:
client
dev tun
proto udp
remote 201.0.3.16 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/2.0/keys/ca.crt
cert /etc/openvpn/2.0/keys/pc1MI.crt
key /etc/openvpn/2.0/keys/pc1MI.key
ns-cert-type server
comp-lzo
verb 3
and the client's startup config file:
ifconfig eth0 202.0.1.11 netmask 255.255.255.0 up
route add default gw 202.0.1.1 dev eth0
/etc/init.d/openvpn start
openvpn --mktun --dev tun0
ifconfig tun0 10.8.0.2 netmask 255.255.255.0 up
I've also noticed that both on client and server on the "ifconfig tun0" output command
inet addr:10.8.0.2 P-t-P:10.8.0.2
the ip and the point to point address is the same.
Thank you for any help