I would like to use monitoring software installed in an Ubuntu VM to manage the network emulated into GNS3, which is also installed in the Ubuntu VM.
Interfaces in my VM are:
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:01:73:bd:8e txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.221.143 netmask 255.255.255.0 broadcast 192.168.221.255
inet6 fe80::5f6a:96d3:65b9:4fe0 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:96:7f:80 txqueuelen 1000 (Ethernet)
RX packets 408 bytes 440051 (440.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 303 bytes 35261 (35.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 166 bytes 16050 (16.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 166 bytes 16050 (16.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:f8:73:7f txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
The network in GNS3 has two routers with this topology:
I am using the virtual bridge interface, virbr0:192.168.122.1, to connect the two routers R1 and R2 with the VM Ubuntu. The cloud in the topology represents the connection with the Ubuntu VM host.
I am using the OSPF routing protocol in R1 and R2.
The routing table of R1:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.122.1 to network 0.0.0.0
C 192.168.122.0/24 is directly connected, GigabitEthernet0/0
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 10.0.0.2/32 [110/2] via 10.1.1.2, 00:11:04, GigabitEthernet1/0
C 10.1.1.0/24 is directly connected, GigabitEthernet1/0
C 10.0.0.1/32 is directly connected, Loopback0
S* 0.0.0.0/0 [1/0] via 192.168.122.1
The routing table of R2:
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 10.1.1.1 to network 0.0.0.0
S 192.168.122.0/24 [1/0] via 10.1.1.1
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.0.0.2/32 is directly connected, Loopback0
C 10.1.1.0/24 is directly connected, GigabitEthernet0/0
O 10.0.0.1/32 [110/2] via 10.1.1.1, 00:32:36, GigabitEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 10.1.1.1, 00:32:36, GigabitEthernet0/0
Communication between R1 and R2 is working. For example, they can PING each other's loopback interfaces.
R1 can PING to the virbr0 interface, 192.168.122.1. R2 can PING to g0/0 of R1 with IP 192.168.122.2, but it can not PING to virbr0 IP 192.168.122.1.
In the Ubuntu VM host, the routes are:
$ ip route
default via 192.168.221.2 dev ens33 proto dhcp metric 100
169.254.0.0/16 dev ens33 scope link metric 1000
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
192.168.221.0/24 dev ens33 proto kernel scope link src 192.168.221.143 metric 100
From the Ubuntu VM I can PING loopback interfaces of R1 and R2 but only if I set the output interface:
$ ping -I virbr0 10.0.0.2
PING 10.0.0.2 (10.0.0.2) from 192.168.122.1 virbr0: 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=254 time=50.6 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=254 time=29.2 ms
It looks like the Ubuntu VM receives the PING requests from router R2 (Lo: 10.0.0.2) but it does not know which interface to use to return the PING replies.
Besides, the PING requests from the Ubuntu VM also have the same problem. I have to indicate the interface to use un the PING requests.
I can add a static route through virbr0:
IP route add 10.0.0.0/24 via 192.168.122.1 dev virbr0
But this is a solution that can only work in this particular network and not in a general scenario with different IP assignation. Also, with this solution in this particular network, I would have to PING from R2 indicating the source IP 10.0.0.2, which is not desired.
I would like to integrate the best possible Ubuntu VM in the GNS3 network so that the VM could behave as directly connected to interface g0/0 of R1.
I do not know if it is possible to use the OSPF routing protocol also in the Ubuntu VM, and it will solve the communication problem between the VM and the routers.
