7,540
edits
Changes
KVM
,→Manage KVM
==Manage networks==
===List all===
List all the running networks:
<pre>
# virsh net-list
docker-machines active yes yes
</pre>
With the --a switch, the non running networks will be listed as well.
<pre>
</pre>
<pre># virsh net-list --all Name State Autostart Persistent---------------------------------------------------------- default active yes yes docker-machines active yes yes docker-network inactive no yes</pre> Start the new network and make it auto start default: # virsh net-start docker-network# virsh net-autostart defaultdocker-network</pre> Check the new network: It should be listed among the interfaces: <pre># ifconfigvirbrDocker: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.123.1 netmask 255.255.255.0 broadcast 192.168.123.255 ...</pre> Lets check it in the virsh interactive shell, with the '''net-dumpxml''' command: <pre># virshWelcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # virsh# net-dumpxml docker-network<network> <name>docker-network</name> <uuid>fe2dd1e8-c32f-469c-b4ca-4338a0acfac5</uuid> <forward mode='nat'> <nat> <port start='1024' end='65535'/> </nat> </forward> <bridge name='virbrDocker' stp='on' delay='0'/> <mac address='52:54:00:9f:ff:ba'/> <ip address='192.168.123.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.123.2' end='192.168.123.254'/> </dhcp> </ip> <ip family='ipv6' address='2001:db8:ca2:2::1' prefix='64'> </ip></network>
</pre>