S
S
Strunin Andrey2016-01-27 15:14:07
linux
Strunin Andrey, 2016-01-27 15:14:07

Local GRE tunnel?

It is necessary to start up traffic between two network cards located on the same host through the GRE tunnel.
I do it like this:

ip link add neta type gretap local {ip1} remote {ip2} ttl 255
ip addr add {fake_ip1} dev neta
ip link set neta up
iptables -I INPUT -p gre -s {ip2} -j ACCEPT


ip link add netb type gretap local {ip2} remote {ip1} ttl 255
ip addr add {fake_ip2} dev netb
ip link set netb up
iptables -I INPUT -p gre -s {ip1} -j ACCEPT

However, alas, traffic does not go. Firewall is off. What can be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cool Admin, 2016-01-27
@ifaustrue

I think the problem is in the network stack of the OS, it sees that the address is on the same host and processes it somehow, not delivering it to the required GRE daemon driver (or delivering them in both cases from the same src address). Or the GRE daemon cannot work in this mode and cannot handle the situation when packets come to it from both ends of the tunnel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question