The host machine .net. Ipv4. Ip_forward=1 this has been a 1,
Host machine and virtual machine firewall are closed
To the host machine in the virtual network adapter to delete only reset the line
With virsh net - destroy the default
With virsh net - undefine default
Service libvirtd restart
With virsh net - start the default
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The gateway address is: 192.168.122.1 (internal network IP host machine)
The virtual machine ifcfg - eth0 file configuration below
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.122.10
GATEWAY=192.168.122.1
NETMASK=255.255.255.0
[root @ vm - 10 log] # ping baidu.com
Ping: baidu.com: Name or service not known
The virtual machine:
[root @ vm - 10 log] # add
1: lo: & lt; The LOOPBACK, UP, LOWER_UP & gt; Mtu 65536 qdisc noqueue state UNKNOWN group, the default qlen 1000
The 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: eth0: & lt; BROADCAST and MULTICAST, the UP, LOWER_UP & gt; Mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
The link/Mr 52:54:00:26:8 9:10 BRD ff: ff: ff: ff: ff: ff
Inet 192.168.122.10/24 BRD 192.168.122.255 scope global eth0
Valid_lft forever preferred_lft forever
Inet6 fe80: : 5054: ff: fe26:8910/64 scope link
Valid_lft forever preferred_lft forever
The virtual machine:
[root @ vm - 10 log] # the route
The Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
The default gateway 0.0.0.0 UG 0 0 0 eth0
The link - local 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
CodePudding user response:
Have found problem:First stop hosting the firewall, then start the service libvirtd restart
Would have a normal
Online said libvirtd and firewalls have conflict, I estimate is,
In order to prevent the people run into the pit,
CodePudding user response:
Learning to learn