Server rentals :: NFOservers.com

Forums

All times are UTC - 8 hours



Author Message
PostPosted: Sun May 13, 2012 7:08 am 
Offline
A semi-regular
A semi-regular

Joined: Wed Jan 26, 2011 2:43 pm
Posts: 27
Edge100x wrote:
Does a tcpdump process monitoring eth0 tell you that any traffic is going out? If so, does it have the correct source IP (your external IP instead of an internal one)?


I did a tcpdump on eth0 while connecting and attempting to ping google(74.125.227.146 in this case), I can see the traffic using my correct source address, ie my real ip for my home connection. I am not sure what is stopping it from being returned to the tunnel?

I also included a ufw log that show the tun0 adapter being allowed and packets sent to eth0.

I really appreciate your (or any else's) assistance!


Paul

EDIT: Can't seem to find the pm option?! So I will email you the logs John


Top
 Profile  
 
PostPosted: Fri May 18, 2012 10:38 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
Searching for information on this tonight, I found consistent advice that this:

Code:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source <public IP of the server>

needs to be replaced with:

Code:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

It's not clear why, buy it seems that SNAT is needed for OpenVZ, and MASQUERADE is needed for Xen.


Top
 Profile  
 
PostPosted: Sat May 19, 2012 6:48 pm 
Offline
A semi-regular
A semi-regular

Joined: Wed Jan 26, 2011 2:43 pm
Posts: 27
Tried removing the SNAT rules and entering the MASQUERADE rule but the same problem, no forwarding seems to be happening :-(


Top
 Profile  
 
PostPosted: Sun May 20, 2012 7:25 pm 
Offline
New to forums
New to forums

Joined: Sun May 20, 2012 7:21 pm
Posts: 1
I'm having the same issue. I have even copied the same configuration I use on other xen vps servers which works fine there. I have tried two different nfoservers vps servers and neither work. Something is wrong at the host level.

OpenVpn connects, packets hit the proper iptables rules and everything seems to be fine except nothing comes back through tun0 and TX packets are at 0.


Top
 Profile  
 
PostPosted: Sun May 20, 2012 10:58 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
paulg1981's tcpdump data showed that:

* The request was arriving to the VDS properly via its tunnel and the virtual network adapter
* The OS was making the request to the external site properly via the virtual network adapter (using its correct public IP)
* The external site's response was arriving properly via the virtual network adapter
* The response was *not* going back out over tun0 to the OpenVPN client. In fact, the OS inside the domU was responding that the TTL was being exceeded in-transit.

Since tun0 is an internal network construct, this suggests that the forwarding path is broken somehow in the domU (but the dom0 is working fine).

My next step in troubleshooting this for him is to try to replicate the problem myself, and then do more extensive dumps and tests.


Top
 Profile  
 
PostPosted: Mon May 21, 2012 12:49 am 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
Ok, I spent some time testing and determined the problem. Enter this line for a quick fix -- you'll see everything suddenly start working as it should:

Code:
iptables -t mangle -A PREROUTING -i eth0 -j TTL --ttl-inc 1

The problem was stemming from the fact that we set the TTL to 2 on all inbound packets, in order to prevent routing loops (which can happen if the customer turns off his VDS, causing inbound packets suddenly start bouncing around). Such loops can amplify the effects of DDoS attacks. As a result of the low TTL, your VDS was discarding the inbound packets instead of forwarding them to the VPN client. Raising the TTL by one is enough to take care of this.

I will also look into whether it would be feasible to remove our TTL-reducing rule by finding another way to mitigate the DDoS threat.


Top
 Profile  
 
PostPosted: Mon May 21, 2012 10:13 am 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
I've changed the ruleset so that the workaround I gave in my last post should no longer be needed. OpenVPN should now work out of the box with standard setup instructions.


Top
 Profile  
 
PostPosted: Thu Jun 28, 2012 2:09 pm 
Offline
A semi-regular
A semi-regular

Joined: Wed Jan 26, 2011 2:43 pm
Posts: 27
Thanks again for all your investigation in this issue. I can confirm that openvpn works out of the box now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 8 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
It is currently Sat May 18, 2013 10:50 am
Powered by phpBB® Forum Software © phpBB Group