[运维|网络] 搭建Open vSwitch网桥及OVS常用操作
mkdir websudo docker build -t meedu-nginx .
·
openEuler
系统环境
系统:openEuler 20.3 LTS
平台:amd64
参考文献
安装Open vSwitch
yum install -y openvswitch
systemctl start openvswitch
systemctl enable openvswitch
创建网桥
- 创建网桥
# 创建Open vSwitch网桥br0
ovs-vsctl add-br br0
# 将物理网卡eth0添加到br0
ovs-vsctl add-port br0 eno1
ovs-vsctl show
- 为网桥配置静态IP地址
修改eno1网卡配置
编辑/etc/sysconfig/network-scripts/ifcfg-eno
文件,用以下内容覆盖原内容
DEVICE="eno1"
ONBOOT="yes"
NM_CONTROLLED="no"
创建br0
配置文件
vim /etc/sysconfig/network-scripts/ifcfg-br0
写入以下内容
TYPE="Ethernet"
DEVICE="br0"
ONBOOT=yes
NETBOOT=yes
BOOTPROTO=static
NM_CONTROLLED="no"
IPADDR=192.168.1.120
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=114.114.114.114
DNS2=223.5.5.5
## ipv6配置
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=fe80::160/64
重启网络
systemctl restart network
debian
系统环境
系统:debian 10.7
平台:amd64
安装Open vSwitch
apt install openvswitch-switch
systemctl start openvswitch-switch
systemctl enable openvswitch-switch
创建网桥
- 创建网桥
# 创建Open vSwitch网桥br0
ovs-vsctl add-br br0
# 将物理网卡eth0添加到br0
ovs-vsctl add-port br0 eno1
ovs-vsctl show
- 为网桥配置静态IP地址
修改eno1网卡配置
编辑/etc/network/interfaces
文件,将eno1网卡修改如下
# The primary network interface
allow-hotplug eno1
iface eno1 inet manual
# This is an autoconfigured IPv6 interface
iface eno1 inet6 manual
并末尾添加br0
的ip地址配置
# br
auto br0
iface br0 inet static
address 192.168.1.120
broadcast 192.168.1.255
netmask 255.255.255.0
gateway 192.168.1.1
# IPv6
iface br0 inet6 static
address fe80::160
netmask 64
gateway fe80::1
重启网络
systemctl restart network
更多推荐
已为社区贡献1条内容
所有评论(0)