0

I have 2 VM in KVM, and 2 network default and new

1 use defaut network:(virbr0)

192.168.122.0/24
IP: 192.168.122.152.
fowarding: NAT

the other use new network:(virbr1)

192.168.124.0/24
IP: 192.168.124.182
fowarding: NAT

Both have empty iptables rule and ufw inactive

From both VM I can ping to the host and the internet, also host can ping to VM too.

quanlm@quanlm-laptop:/home/quan$ ping 192.168.122.152
PING 192.168.122.152 (192.168.122.152) 56(84) bytes of data.
64 bytes from 192.168.122.152: icmp_seq=1 ttl=64 time=0.596 ms


quanlm@quanlm-laptop:/home/quan$ ping 192.168.124.182
PING 192.168.124.182 (192.168.124.182) 56(84) bytes of data.
64 bytes from 192.168.124.182: icmp_seq=1 ttl=64 time=0.509 ms

But in the VM use defaut network, I can ping the new network

root@test:~# ping 192.168.124.1
PING 192.168.124.1 (192.168.124.1) 56(84) bytes of data.
64 bytes from 192.168.124.1: icmp_seq=1 ttl=64 time=0.165 ms
64 bytes from 192.168.124.1: icmp_seq=2 ttl=64 time=0.551 ms

but not the others VM using new network

root@test:~# ping 192.168.124.182
PING 192.168.124.182 (192.168.124.182) 56(84) bytes of data.
From 192.168.122.1 icmp_seq=1 Destination Port Unreachable
From 192.168.122.1 icmp_seq=2 Destination Port Unreachable
From 192.168.122.1 icmp_seq=3 Destination Port Unreachable

But also the VM using new network can ping directly the default network VM

root@test2:~# ping 192.168.122.152
PING 192.168.122.152 (192.168.122.152) 56(84) bytes of data.
64 bytes from 192.168.122.152: icmp_seq=1 ttl=63 time=1.30 ms
64 bytes from 192.168.122.152: icmp_seq=2 ttl=63 time=1.10 ms

Trace route on default VM

root@test:~# traceroute 192.168.124.182
traceroute to 192.168.124.182 (192.168.124.182), 30 hops max, 60 byte packets
 1  quanlm-laptop (192.168.122.1)  0.565 ms  0.446 ms  0.440 ms
 2  quanlm-laptop (192.168.122.1)  0.454 ms  0.551 ms  0.441 ms

Traceroute in new VM

root@test2:~# traceroute 192.168.122.152
traceroute to 192.168.122.152 (192.168.122.152), 30 hops max, 60 byte packets
 1  quanlm-laptop (192.168.124.1)  0.459 ms  0.455 ms  0.453 ms
 2  test.192.168.124.1 (192.168.122.152)  1.234 ms  1.383 ms  1.782 ms

Host route:

quanlm@quanlm-laptop:/home/quan$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    600    0        0 wlo1
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 wlo1
172.16.161.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
192.168.48.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8
192.168.64.0    0.0.0.0         255.255.240.0   U     600    0        0 wlo1
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
192.168.124.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr1

The question is how to make 1st VM default can ping to 2nd VM new?

Lê Minh Quân
  • 301
  • 2
  • 13

0 Answers0