How to create a Bridge in Linux Virualization
nmcli connection show
brctl show
ipv4.addresses 192.168.1.66/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns 8.8.8.8 \
ipv4.method manual \
ipv6.method ignore
nmcli connection add type ethernet ifname ens2f0 master br0
nmcli connection up br0
nmcli connection down ens2f0
nmcli connection up br0
ip addr show br0
nmcli connection show br0
Removing IP from Existing interface
# 1. Delete any IP from ens2f0
sudo nmcli con mod ens2f0 ipv4.method disabled ipv6.method ignore
# 2. Create the bridge
sudo nmcli con add type bridge ifname br0 con-name br0 ipv4.addresses 192.168.1.66/24 ipv4.gateway 192.168.1.1 ipv4.method manual
# 3. Add physical NIC to the bridge
sudo nmcli con add type bridge-slave ifname ens2f0 master br0
# 4. Bring everything up
sudo nmcli con up br0
sudo nmcli con up bridge-slave-ens2f0
nmcli connection show --active
Removing old IP in VM
nano /etc/sysconfig/network-scripts/ifcfg-enp1s0
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
ONBOOT=yes
systemctl restart network
ifdown enp1s0 && sudo ifup enp1s0
sudo nmcli connection down enp1s0 && sudo nmcli connection up enp1s0
systemctl restart network
Comments
Post a Comment