Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've set up openvpn using tun. I can ping both ways between client & server. But I can't ping from the client to 8.8.4.4 (as a test).

I've added nat with:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

But things don't appear to route from the tun0 interface to eth0.

tcpdump on tun0 shows that packets are coming in (in this case ping to 8.8.4.4 as a test):

12:21:55.956564 IP 10.8.0.10 > google-public-dns-b.google.com: ICMP echo request, id 512, seq 17153, length 40

But tcpdump on eth0 doesn't show anything other than my ssh traffic.

I have a ping looping from the vpn client, and I see that in my tcpdump on tun0, but I don't see anything "google" in my tcpdump on eth0.

Any thoughts? I can run this ping fine from the openvpn host. iptables are empty except for the MASQUERADE action, with defaults to accept.

share|improve this question
    
I agree with poige. Paste routes, iptables rules, tcpdump on eth0, openvpn configs. –  3molo Jul 14 '11 at 6:01
add comment

3 Answers

up vote 1 down vote accepted

Aha, it was step #1 in this guide on configuring linux as a router... turn on IP Forwarding.

http://www.cyberciti.biz/tips/linux-as-router-for-dsl-t1-line-etc.html

share|improve this answer
add comment

Iptables -A FORWARD -j ACCEPT?

share|improve this answer
    
Policy is accept by default: Chain FORWARD (policy ACCEPT) –  davidparks21 Jul 14 '11 at 5:56
add comment

Why -j MASQUERADE @ -o eth0 if you're talking bout I've set up openvpn using tun?

You need to verify you've got: routing (forwarding, actually) enabled (sysctl), routing is properly set-up (needed routes are installed), NAT is properly set-up if it's needed.

share|improve this answer
1  
Because he intend to SNAT vpn clients -> internet? –  3molo Jul 14 '11 at 5:49
    
I'm guessing I'm missing a route here. What do I need to do to route traffic out the default gateway? I'm confused here because I already have a default route, so I am assuming that any packet that comes in destine for an external address will be forwarded to the default gateway. –  davidparks21 Jul 14 '11 at 5:57
    
Have you verified you have forwarding enabled?… –  poige Jul 14 '11 at 15:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.