I have some problems connecting a Playstation to my VPN via another PC.
Hardware: PC that should route incoming traffic from the Playstation to VPN: eth0 - connected to the internet eth1 - connected with my Playstation. here's a DHCP-server listening and giving the Playstation an ip ppp0 - active vpn (pptpd) connection (just used for his own network, so eth0 doesn't use it)
IP's: eth1 - 192.168.1.1 ppp0 - 192.168.0.150 - gw = 192.168.0.1
IP of the Playstation connected at eth1 of the PC: 192.168.1.131
Now I tried different things:
1) iptables with ppp0 activated also for eth0, so eth1 is just communicating with eth0.
iptables -F iptables -X iptables -t nat -F #echo "1" > /proc/sys/net/ipv4/ip_forward sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE iptables -A FORWARD -o ppp0 -s 192.168.0.0/16 -m conntrack --ctstate NEW -j ACCEPT iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT service dnsmasq restart iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --dports 80,443,5223 -j DNAT --to-destination 192.168.1.131 iptables -A FORWARD -i eth0 -d 192.168.1.131 -p tcp -m multiport --dports 80,443,5223 -j ACCEPT iptables -t nat -A PREROUTING -i eth0 -p udp -m multiport --dports 3478,3479,3658 -j DNAT --to-destination 192.168.1.131 iptables -A FORWARD -i eth0 -d 192.168.1.131 -p tcp -m multiport --dports 3478,3479,3658 -j ACCEPT
This try was succesful for http. So the Playstation says about http://cmyip.com that I'm surfing with the IP of the VPN. But other ports like the UDP aren't forwarded.
2) Trying routing:
route del default route add -host <VPNServer> gw <ORGINAL-GW-OF-eth0) route add -net default gw 192.168.0.1
So this works also fine, but just for eth0. After this i have the following route-Table:
Kernel-IP-Routentabelle Ziel Router Genmask Flags Metric Ref Use Iface default 192.168.0.1 0.0.0.0 UG 0 0 0 ppp0 p000.yellow.fas romeo.EROS.UniB 255.255.255.255 UGH 0 0 0 eth0 p000.yellow.fas romeo.EROS.UniB 255.255.255.255 UGH 0 0 0 eth0 p000.yellow.fas romeo.EROS.UniB 255.255.255.255 UGH 0 0 0 eth0 188.8.131.52 * 255.255.255.0 U 1 0 0 eth0 link-local * 255.255.0.0 U 1000 0 0 eth0 192.168.0.1 * 255.255.255.255 UH 0 0 0 ppp0 192.168.1.0 * 255.255.255.0 U 1 0 0 eth1
(note: some IP's and hostnames are changed because of security)
So the connection about eth0 is also working, but I don't know how to route incoming traffic of eth1 to ppp0.
Can anyone help me, pls? Goal should be to connect via PS3 to VPN and use PlaystationNetwork. I don't think there's a limition of my VPN-Hoster, because all ports get opened when used internal (VPN-server is also not a service from third, it's my own dedicated server)
Addition: Sry for my bad english and pls tell me if I forgot to give you importend details.