New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How to do port fowarding through a GRE tunnel?
I have a DDoS protected IP at OVH, let's say its called server A and has the ip 1.2.3.4.
I have a non-protected Server B with the ip 3.4.5.6.
I setup a GRE tunnel between them.
What iptables or ip route rules do I need so I can open up a UDP server on Server B and have it accept and reply from 1.2.3.4 at port 5555 on Server A?
Comments
Take a look at this post from @jordynegen11:
[HOWTO] Tunnel DDoS protected OVH IP to VM's in other datacenter
Hi Bob,
Hi Bob,
This HOWTO is only when you want to tunnel a IP block to another server with virtual machines.
If you want to tunnel only 1 IP to your server: https://wiki.buyvm.net/doku.php/gre_tunnel
Hi thank you, I looked at the buyvm guide already but it only does port forwarding for TCP as you can see here.
I would like to know how to do it for UDP.
That will portforward all trafic (both TCP and UDP)
iptables -A FORWARD -d 192.168.168.2 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
To forward TCP/80
iptables -A FORWARD -d 192.168.168.2 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
To forward UDP/80
iptables -A FORWARD -d 192.168.168.2 -p udp -m udp --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
also do not forget about nat table
But how can the UDP have a state? I thought it was stateless?
just remove
-m state --state NEW,ESTABLISHED,RELATED