gabberhead
hi đ
i think this is not a big problem, but i am stucked. i googled lot of things, but nothing worked. i have following configuration:
Futro S400 as OpenVPN server with local ip (eth0) 192.168.0.8. on the same futro i have 2 instances of openvpn running. 1 as server and one as client.
the config of the server is (the certification files i have in the config written. but not shown here):
local 192.168.0.8
port 11226
proto udp
dev tun
tls-auth ta.key 0
topology subnet
server 192.168.123.0 255.255.255.0
push "route 192.168.0.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 192.168.0.1"
push "dhcp-option WINS 192.168.0.1"
push "dhcp-option NTP 192.168.0.1"
client-config-dir /home/gabberhead/ccd
comp-lzo
plugin /usr/lib/openvpn/openvpn-auth-pam.so login
user gabberhead terrorcorp
group openvpn
client-to-client
max-clients 5
keepalive 10 60
cipher AES-256-CBC
tls-cipher AES256-SHA
auth SHA256
persist-key
persist-tun
float
status openvpn-status.log
log openvpn.log
verb 3
mute 15
to this server configuration i can connect with my smartphone and windows 7 comp as clients without any problem. all traffic is going through the openvpn server (tun0) and i have internet access.
this is not the problem. here comes the problem now ^^
now i registered an account at vpntunnel.se and have put the config files etc. to the same folder where the server.conf file is. i named this config client.conf
both configs (server.conf and client.conf) are starting without problem and on my futro i get the vpn ip from vpntunnel.se and i have internet access.
my networkcard have eth0, the server.conf is getting tun0 and the client.conf is getting tun1
i also can connect to the server over the server.conf with my smartphone and my win7 comp. the connection is succesfull but i have no internet connection on them. i can not load any site over my smartphone and win7 comp.
before i add the vpntunnel.se configs all my traffic was succesfully going through tun0.
now my question is:
how can i route the complete traffic which goes over tun0 before, now through tun1 to get the vpn ip from vpntunnel.se for my smartphone and my win7 comp and also of course the possibility to browse the internet?
here arre some config stuff which is prbaly needed for helping me đ
ifconfig:
eth0 Link encap:Ethernet Hardware Adresse 00:90:dc:a3:5a:71
inet Adresse:192.168.0.8 Bcast:192.168.0.255 Maske:255.255.255.0
inet6-Adresse: fe80::290:dcff:fea3:5a71/64 GĂÂźltigkeitsbereich:Verbindung
UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
RX-Pakete:15854 Fehler:0 Verloren:0 Ăberläufe:0 Fenster:0
TX-Pakete:23859 Fehler:0 Verloren:0 Ăberläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX-Bytes:3436501 (3.4 MB) TX-Bytes:18964714 (18.9 MB)
lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
inet6-Adresse: ::1/128 GĂÂźltigkeitsbereich:Maschine
UP LOOPBACK RUNNING MTU:65536 Metrik:1
RX-Pakete:0 Fehler:0 Verloren:0 Ăberläufe:0 Fenster:0
TX-Pakete:0 Fehler:0 Verloren:0 Ăberläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX-Bytes:0 (0.0 B) TX-Bytes:0 (0.0 B)
tun0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:192.168.123.1 P-z-P:192.168.123.1 Maske:255.255.255.0
UP PUNKTZUPUNKT RUNNING NOARP MULTICAST MTU:1500 Metrik:1
RX-Pakete:174 Fehler:0 Verloren:0 Ăberläufe:0 Fenster:0
TX-Pakete:218 Fehler:0 Verloren:0 Ăberläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:100
RX-Bytes:18434 (18.4 KB) TX-Bytes:19629 (19.6 KB)
tun1 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet Adresse:5.254.141.88 P-z-P:5.254.141.88 Maske:255.255.255.224
UP PUNKTZUPUNKT RUNNING NOARP MULTICAST MTU:1500 Metrik:1
RX-Pakete:4985 Fehler:0 Verloren:0 Ăberläufe:0 Fenster:0
TX-Pakete:5089 Fehler:0 Verloren:0 Ăberläufe:0 Träger:0
Kollisionen:0 Sendewarteschlangenlänge:100
RX-Bytes:512455 (512.4 KB) TX-Bytes:330396 (330.3 KB)
netstat -nr:
Kernel-IP-Routentabelle
Ziel Router Genmask Flags MSS Fenster irtt Iface
0.0.0.0 5.254.141.65 128.0.0.0 UG 0 0 0 tun1
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
5.254.141.64 0.0.0.0 255.255.255.224 U 0 0 0 tun1
128.0.0.0 5.254.141.65 128.0.0.0 UG 0 0 0 tun1
178.73.212.245 192.168.0.1 255.255.255.255 UGH 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.123.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
ip route show:
0.0.0.0/1 via 5.254.141.65 dev tun1
default via 192.168.0.1 dev eth0 metric 100
5.254.141.64/27 dev tun1 proto kernel scope link src 5.254.141.88
128.0.0.0/1 via 5.254.141.65 dev tun1
178.73.212.245 via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.8
192.168.123.0/24 dev tun0 proto kernel scope link src 192.168.123.1
iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 1050 packets, 248K bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 222 packets, 19138 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 49 packets, 3203 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 55 packets, 3515 bytes)
pkts bytes target prot opt in out source destination
15 838 MASQUERADE all -- any eth0 192.168.123.0/24 anywhere
gabberhead
now i am a step further. i have added
iptables -t nat -A POSTROUTING -o tun1 -j MASQUERADE
now i can connect from win7 comp to the openvpn server and i get the vpn ip from vpntunnel. this is like it should be
now i have only one last problem. the connection from my smartphone is not working
in the log i see he is trying to connect to the ip adress of the vpntunnel.se ip and not to my local ip of my server 192.168.0.8.
in the log of my win7 comp when he connects i see he is connecting right to 192.168.0.8 and port 11226.
in the config of the win7 comp i have: remote 192.168.0.8 11226
but on my smartphone i am not connecting through the ip adress 192.168.0.8 11226
this is what i have in the config of my smartphone:
remote xxxxxxx.dyndns.org 11226
and this is the problem. when i use this address he is trying to connect to the right port but to the wrong ip (the external vpntunnel.se ip) not the right 192.168.0.8 like my win7 comp is doing.
what can i do to tell my smartphone to connect to the right ip adress 192.168.0.8 via xxxx.dyndns.org and not to the external ip?
gabberhead
thanx for your answer. but my smartphone is definitely connecting to the the ip from vpntunnel.se. and the right port 11226. i see it in the log on my smartphone. when i start openvpn without vpntunnel.se, my smartphone connects succesfully to my server using remote xxx.dyndns.org 11226 in the config. when i start openvpn together with vpntunnel.se he tries to connect to the ip of vpntunnel.se using the right port.
this is my config from my smartphone:
client
dev tun
proto udp
remote xxxxx.dyndns.org 11226
nobind
ns-cert-type server
persist-key
persist-tun
tls-auth ta.key 1
cipher AES-256-CBC
tls-cipher TLS-RSA-WITH-AES-256-CBC-SHA
auth SHA256
auth-nocache
auth-user-pass
comp-lzo
float
verb 3
with this config i CAN connect to my server without running vpntunnel.se. if vpntunnel.se is also running he don't connect because he tries to connect to the ip of vpntunnel.se
when i using this config on my smartphone and i am connected to my wlan:
client
dev tun
proto udp
remote 192.168.0.8 11226
nobind
ns-cert-type server
persist-key
persist-tun
tls-auth ta.key 1
cipher AES-256-CBC
tls-cipher TLS-RSA-WITH-AES-256-CBC-SHA
auth SHA256
auth-nocache
auth-user-pass
comp-lzo
float
verb 3
i can connect to my server and the traffic is going through the vpn tunnel of vpntunnel.se.
the dyndns of my server is updating through ddclient if iam connected trough vpntunnel.se.