0

I have a problem with my configuration of GRE Tunnels, it is very strange because the transfer of packets works without problems ICMP, TCP but when I try to send UDP the tunnel only works for an average of 5 minutes and all packets fall.

Here my tunnel configuration:

Server A

ip tunnel add gre1 mode gre local IPA remote BACKENDIP ttl 255

ip addr add 192.168.1.1/30 dev gre1 ip link set gre1 up

iptables -t nat -A PREROUTING -p udp -j DNAT --to-destination 192.168.1.2

Server B

ip tunnel add gre2 mode gre local IPB remote BACKENDIP ttl 255

ip addr add 192.168.2.1/30 dev gre2 ip link set gre2 up

iptables -t nat -A PREROUTING -p udp -j DNAT --to-destination 192.168.2.2

Server BACKEND

ip tunnel add gre1 mode gre local BACKENDIP remote IPA ttl 255

ip addr add 192.168.1.2/30 dev gre1

ip link set gre1 up

ip route add 0/0 via 192.168.1.1 dev gre1 table 1

ip rule add fwmark 1 lookup 1 pref 1

ip tunnel add gre2 mode gre local BACKENDIP remote IPB ttl 255

ip addr add 192.168.2.2/30 dev gre2

ip link set gre2 up

ip route add 0/0 via 192.168.2.1 dev gre2 table 2

ip rule add fwmark 2 lookup 2 pref 2

iptables -t nat -A PREROUTING -i gre+ -p udp -j DNAT --to-destination BACKENDIP

iptables -t mangle -A PREROUTING -m conntrack --ctstate NEW -i gre1 -j CONNMARK --set-mark 0x1

iptables -t mangle -A PREROUTING -m conntrack --ctstate NEW -i gre2 -j CONNMARK --set-mark 0x2

iptables -t mangle -A OUTPUT -j CONNMARK --restore-mark iptables -t filter -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -t filter -A INPUT -p udp -j ACCEPT

What am I doing wrong? I contacted my provider to make sure they were not their problems but they tell me that they allow the GRE traffic that is some configuration that I am doing wrong.

Why do I get packets loss?

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.