Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pyed | I set up my server, and now I'm connected, but I couldn't get the routing part right
- catphish | i'm not overly familiar with the "route" command, but something like this for a tun interface: route add -host 78.24.191.177 dev tun0
- pyed | catphish, after adding this route, I can't open the routed address anymore
- pyed | can't even ping the routed address
- catphish | pyed: that's not very surprising
- catphish | pyed: there are loads of reasons why pakets wouldnt come back to you
- catphish | the solution is more complicated and depends on whether you have public IPs or NAT, and whether you have set up correct reserve routes and NAT rules at the openvpn serverable
- catphish | assuming your openvpn uses a private IP range, you're sending a ping with a private source address
- catphish | the openvpn server can respond to that private address, so that's ok
- catphish | but to send that ping out to th internet, it will likely need to NAT it
- pyed | hmm
- catphish | which it may not be configured to do for vpn traffic
- pyed | I'll take another look at my server config
- catphish | openvpn doesn't imply any kind of network setup
- pyed | catphish, could you take a look at this: https://wiki.archlinux.org/index.php/OpenVPN#Routing_traffic_through_the_server
- catphish | is the server running on openwrt?
- pyed | no, it's running on arch
- pyed | archlinux
- catphish | this is the important part:
- catphish | iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o enp1s0 -j MASQUERADE
- catphish | you need a rule that NATs from your VPN range to your WAN interface
- catphish | if you've done that, it should work
- catphish | also, you need to ensure ip forwarding is enabled
- pyed | it's working !!
- pyed | thank you so much
- catphish | cool :)
- catphish | what was the problem?
- pyed | all I had to do is 'echo 1 > /proc/sys/net/ipv4/ip_forward'
- pyed | and do the iptables command, but I changed the 'enp1s0' to 'eth0' because that's my interface name
- pyed | now I just 'route add -host IP_ADDRESS dev tun0' on openwrt, and it's working as expected
Advertisement
Add Comment
Please, Sign In to add comment