Thank you very much for the time you spend there. Finally, I did something else but that looks close to what you have explained. Now, host1 is in the network vboxnet0 and I have created a second network called vboxnet1 where host2 is and I am using Host-Only for both. Then RP1 has 2 network cards which are vboxnet0 and vboxnet1 in Host-Only as well. I prefer working with Host-Only so I can ssh my VMs but normally if I understood your explanations well the important is to have 2 different networks so I think internal network or not should be the same, could you confirm that?
Now, both host1 and RP1 and host2 and RP1 can ping each other but of course, host1 cannot ping host2. So I added eth1(vboxnet0 network) and eth2(vboxnet1 network) to OVS bridge in RP1 and added a route for host1 saying if you don't know where to send your message go through RP1. Same thing for host2. Here are what
route -n returns for hosts.
Both X.X.57.4 and X.X.58.4 are eth ports of RP1.
Host1(in the network X.X.57.0)
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 X.X.57.4 0.0.0.0 UG 0 0 0 enp0s3
169.X.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp0s3
X.X.57.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
Host2(in the network X.X.58.0)
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 X.X.58.4 0.0.0.0 UG 0 0 0 enp0s3
169.X.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp0s3
X.X.58.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
Finally, in the RP1 VM when you type the following command
sudo ovs-ofctl dump-flows ovsbr0 you get this default entry table.
Code: Select all
cookie=0x0, duration=14.668s, table=0, n_packets=29, n_bytes=4301, priority=0 actions=NORMAL
which means if you get a message from a port send it to all the other ports. So I decided to remove this table with
sudo ovs-ofctl del-flows ovsbr0 and to be more specific(but to be honest it is exactly the same thing). So I added some routes with these commands
sudo ovs-ofctl add-flow ovsbr0 priority=500,in_port=1,actions=output:2 and
sudo ovs-ofctl add-flow ovsbr0 priority=500,in_port=2,actions=output:1 and now when I check the table I get
Code: Select all
cookie=0x0, duration=3.939s, table=0, n_packets=0, n_bytes=0, priority=500,in_port=1 actions=output:2
cookie=0x0, duration=1.098s, table=0, n_packets=0, n_bytes=0, priority=500,in_port=2 actions=output:1
Port1 and port2 are respectively X.X.57.4 and X.X.58.4
However, when Host1 tries to ping Host2 I get host unreachable. Maybe now the problem comes from OVS, could you give me your insight?