Ok, here is the host commands showing the current network config, switching wlan and then restoring network connectivity for the VM.
Question is: how can I avoid loss of network connectivity in the VM?
Or if unavoidable, how can I automate restoring it in a clean way?
To clarify: virbr1/vnet0/192.168.200.0 is the public NAT network of the VMs
Code:
root@job2 ~
# ip addr show dev wlan0
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:26:c7:3c:e8:1c brd ff:ff:ff:ff:ff:ff
inet 192.168.11.101/24 brd 192.168.11.255 scope global wlan0
root@job2 ~
# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
virbr1 8000.fe54004530b0 yes vnet0
virbr2 8000.fe5400845bbc yes vnet1
root@job2 ~
# ip addr show dev virbr1
23: virbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether fe:54:00:45:30:b0 brd ff:ff:ff:ff:ff:ff
inet 192.168.200.1/24 brd 192.168.200.255 scope global virbr1
root@job2 ~
# iptables -L -t nat | grep 192.168
MASQUERADE tcp -- 192.168.200.0/24 !192.168.200.0/24 masq ports: 1024-65535
MASQUERADE udp -- 192.168.200.0/24 !192.168.200.0/24 masq ports: 1024-65535
MASQUERADE all -- 192.168.200.0/24 !192.168.200.0/24
root@job2 ~
# iptables -L | grep 192.168
ACCEPT all -- anywhere 192.168.200.0/24 state RELATED,ESTABLISHED
ACCEPT all -- 192.168.200.0/24 anywhere
root@job2 ~
# ssh jobv1 ping -c 2 www.suse.de
Password:
PING turing.suse.de (195.135.220.3) 56(84) bytes of data.
64 bytes from turing.suse.de (195.135.220.3): icmp_req=1 ttl=48 time=86.9 ms
64 bytes from turing.suse.de (195.135.220.3): icmp_req=2 ttl=48 time=64.9 ms
--- turing.suse.de ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 64.966/75.964/86.963/11.001 ms
root@job2 ~
# grep jobv1 /etc/hosts
192.168.200.11 jobv1
root@job2 ~
# nmcli con up uuid 'ad9289e1-e87b-48e1-86e5-6c7d13a282c3'
Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/15
state: activated
Connection activated
root@job2 ~
# nmcli con up uuid '53049bf2-15c8-4c4f-a921-8af4a03facf8'
Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/16
state: activated
Connection activated
root@job2 ~
# ssh jobv1 ping -c 2 www.suse.de
Password:
PING turing.suse.de (195.135.220.3) 56(84) bytes of data.
--- turing.suse.de ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1000ms
root@job2 ~
# iptables -L | grep 192.168
root@job2 ~
# iptables -L -t nat | grep 192.168
root@job2 ~
# ip addr show dev virbr1
23: virbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether fe:54:00:45:30:b0 brd ff:ff:ff:ff:ff:ff
inet 192.168.200.1/24 brd 192.168.200.255 scope global virbr1
root@job2 ~
# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
virbr1 8000.fe54004530b0 yes vnet0
virbr2 8000.fe5400845bbc yes vnet1
root@job2 ~
# virsh net-destroy public
Network public destroyed
root@job2 ~
# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
virbr2 8000.fe5400845bbc yes vnet1
root@job2 ~
# virsh net-start public
Network public started
root@job2 ~
# brctl show
bridge name bridge id STP enabled interfaces
virbr0 8000.000000000000 yes
virbr1 8000.000000000000 yes
virbr2 8000.fe5400845bbc yes vnet1
root@job2 ~
# iptables -L -t nat | grep 192.168
MASQUERADE tcp -- 192.168.200.0/24 !192.168.200.0/24 masq ports: 1024-65535
MASQUERADE udp -- 192.168.200.0/24 !192.168.200.0/24 masq ports: 1024-65535
MASQUERADE all -- 192.168.200.0/24 !192.168.200.0/24
root@job2 ~
# iptables -L | grep 192.168
ACCEPT all -- anywhere 192.168.200.0/24 state RELATED,ESTABLISHED
ACCEPT all -- 192.168.200.0/24 anywhere
root@job2 ~
# brctl addif virbr1 vnet0
root@job2 ~
# ssh jobv1 ping -c 2 www.suse.de
Password:
PING turing.suse.de (195.135.220.3) 56(84) bytes of data.
64 bytes from turing.suse.de (195.135.220.3): icmp_req=1 ttl=48 time=66.9 ms
64 bytes from turing.suse.de (195.135.220.3): icmp_req=2 ttl=48 time=92.9 ms
--- turing.suse.de ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 66.935/79.924/92.913/12.989 ms
Bookmarks