3

I'm quite new to both network and open vswitch, I'm not sure whether this question is more relevant to open vswitch(ovs) or gre.

belows are ovs settint commands. There are two hosts. Each host has two bridge br1 and br2. br2 has the gre tunnel interface which has ip of br1 as its remote end point.

host A

sudo ifconfig eth1 0
sudo ovs-vsctl add-br br1
sudo ovs-vsctl add-br br2
sudo ovs-vsctl add-port br1 eth0
sudo ifconfig br1 192.168.1.155 netmask 255.255.255.0
sudo ifconfig br2 10.1.1.1 netmask 255.255.255.0
sudo ovs-vsctl add-port br2 gre0 -- set interface gre0 type=gre options:remote_ip=192.168.1.152

hostB

sudo ifconfig eth1 0
sudo ovs-vsctl add-br br1
sudo ovs-vsctl add-br br2
sudo ovs-vsctl add-port br1 eth0
sudo ifconfig br1 192.168.1.152 netmask 255.255.255.0
sudo ifconfig br2 10.1.1.2 netmask 255.255.255.0
sudo ovs-vsctl add-port br2 gre0 -- set interface gre0 type=gre options:remote_ip=192.168.1.155

How does GRE traffic find their way after arrive its remote end point?. It looks like that there are no connection between br1 and br2 at the same host. I could understand how traffic from br2 at host A go through br1 at host B. But I couldn't understand traffic finds way to br2 at host B from br1 at host B(gre destination).

2

You must note that in host b you have given br1 an ip address 192.168.1.152. So whether you like it or not your tunnel terminates on br1. In openvswitch the bridge itself is an interface. So that explains your question.

If you had not done so and created only an interface in br2 called gre0 and connected to remote_ip 192.168.1.155, you should create a veth pair and attach br1 and br2.

Note that while using gre it is enough that any one of your interface in the machine have an ip address. That interface need not at all be added to your bridges. As long as your bridges have an endpoint they will be able to receive the packets from that tunnel.

Hope it helps.

Your Answer

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

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