用nmcli命令进行桥接配置
发布时间:2019-10-08 09:13:24
作者:ynkulusi
# nmcli connection add type bridge con-name bridge0 ifname bridge0
ipv4配置方式
# nmcli connection modify bridge0 ipv4.addresses '192.0.2.1/24'
# nmcli connection modify bridge0 ipv4.gateway '192.0.2.254'
# nmcli connection modify bridge0 ipv4.dns '192.0.2.253'
# nmcli connection modify bridge0 ipv4.method manual
ipv6配置方式
# nmcli connection modify bridge0 ipv6.addresses '2001:db8::1/32'
# nmcli connection modify bridge0 ipv6.gateway '2001:db8::fffe'
# nmcli connection modify bridge0 ipv6.dns '2001:db8::fffd'
# nmcli connection modify bridge0 ipv6.method manual
将bridge0的生成树协议(STP)优先级设置为16384
# nmcli connection modify bridge0 bridge.priority '16384'
把enp7s0和enp8s0添加到bridge0连接
# nmcli connection add type ethernet slave-type bridge con-name bridge0-port1 ifname
enp7s0 master bridge0
# nmcli connection add type ethernet slave-type bridge con-name bridge0-port2 ifname
enp8s0 master bridge0
激活桥接
# nmcli connection up bridge0
查看桥接设备信息
# nmcli device
DEVICE TYPE STATE CONNECTION
...
62enp7s0 ethernet connected bridge0-port1
enp8s0 ethernet connected bridge0-port2
启用激活从设备命令
# nmcli connection modify bridge0 connection.autoconnect-slaves 1
重启激活网桥
# nmcli connection up bridge0
查看桥接信息
# bridge link show bridge0
3: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master bridge0 state
orwarding priority 32 cost 100
4: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master bridge0 state
istening priority 32 cost 100
ipv4配置方式
# nmcli connection modify bridge0 ipv4.addresses '192.0.2.1/24'
# nmcli connection modify bridge0 ipv4.gateway '192.0.2.254'
# nmcli connection modify bridge0 ipv4.dns '192.0.2.253'
# nmcli connection modify bridge0 ipv4.method manual
ipv6配置方式
# nmcli connection modify bridge0 ipv6.addresses '2001:db8::1/32'
# nmcli connection modify bridge0 ipv6.gateway '2001:db8::fffe'
# nmcli connection modify bridge0 ipv6.dns '2001:db8::fffd'
# nmcli connection modify bridge0 ipv6.method manual
将bridge0的生成树协议(STP)优先级设置为16384
# nmcli connection modify bridge0 bridge.priority '16384'
把enp7s0和enp8s0添加到bridge0连接
# nmcli connection add type ethernet slave-type bridge con-name bridge0-port1 ifname
enp7s0 master bridge0
# nmcli connection add type ethernet slave-type bridge con-name bridge0-port2 ifname
enp8s0 master bridge0
激活桥接
# nmcli connection up bridge0
查看桥接设备信息
# nmcli device
DEVICE TYPE STATE CONNECTION
...
62enp7s0 ethernet connected bridge0-port1
enp8s0 ethernet connected bridge0-port2
启用激活从设备命令
# nmcli connection modify bridge0 connection.autoconnect-slaves 1
重启激活网桥
# nmcli connection up bridge0
查看桥接信息
# bridge link show bridge0
3: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master bridge0 state
orwarding priority 32 cost 100
4: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master bridge0 state
istening priority 32 cost 100
分类:network
评论数:0
阅读数:876