Linux 版本
“Ubuntu 20.04.4 LTS(GNU/Linux 5.4.0-122-通用 x86_64)”
KVM 版本
软件包:qemu-system-x86
版本:1:4.2-3ubuntu6.23
优先级:可选
部分:杂项
来源:qemu
起源:Ubuntu
主机上的网络配置
network:
version: 2
renderer: networkd
ethernets:
enp0s31f6:
dhcp4: false
dhcp6: false
bridges:
br0:
interfaces: [enp0s31f6]
addresses: [x.x.28.243/32]
routes:
- on-link: true
to: 0.0.0.0/0
via: x.x.28.193
gateway6: fe80::1
parameters:
stp: false
forward-delay: 0
dhcp4: no
dhcp6: no
version: 2
主机上的 IP 添加
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
link/ether 90:1b:0e:fa:70:6d brd ff:ff:ff:ff:ff:ff
3: enp0s31f6.4002@enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 90:1b:0e:fa:70:6d brd ff:ff:ff:ff:ff:ff
inet 192.168.9.209/24 brd 192.168.9.255 scope global noprefixroute enp0s31f6.4002
valid_lft forever preferred_lft forever
inet6 fe80::9477:6a8c:e1b6:b3a7/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: virbr2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.110.1/24 brd 192.168.110.255 scope global noprefixroute virbr2
valid_lft forever preferred_lft forever
inet6 fe80::40ca:cfff:fe2e:76c2/64 scope link
valid_lft forever preferred_lft forever
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 02:c5:79:5e:ef:c5 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global noprefixroute virbr0
valid_lft forever preferred_lft forever
inet6 fe80::c5:79ff:fe5e:efc5/64 scope link
valid_lft forever preferred_lft forever
6: virbr1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:4a:eb:65 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.1/24 brd 192.168.100.255 scope global virbr1
valid_lft forever preferred_lft forever
7: virbr1-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr1 state DOWN group default qlen 1000
link/ether 52:54:00:4a:eb:65 brd ff:ff:ff:ff:ff:ff
10: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 90:1b:0e:fa:70:6d brd ff:ff:ff:ff:ff:ff
inet x.x.28.243/32 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::3087:19ff:fe98:e699/64 scope link
valid_lft forever preferred_lft forever
11: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:02:37:3b brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe02:373b/64 scope link
valid_lft forever preferred_lft forever
KVM虚拟机
IP 地址 xx28.247/26
网关 xx28.193
VM 只能 ping 通自己的 IP(xx28.247),但无法 ping 通主机 IP(xx28.193)及其网关(xx28.193)。另一方面,主机可以 ping 通网关 ip(xx28.193),但不能 ping 通 VM IP(xx28.247)。