Ubuntu18.04设置bond0

发布时间 2023-03-22 21:13:14作者: 技术颜良

Ubuntu18.04设置bond6有两种方法,一是在安装系统的设置网卡聚合,二是修改/etc/netplan/*.yaml这个配置文件。
一,安装系统时设置bond6
1,正常进入Ubuntu18.04的安装界面
在这里插入图片描述
2,选择键盘,不升级Ubuntu系统安装软件。选择网络,选择创建bond:
在这里插入图片描述
在这里插入图片描述
点击创建后会回到网络的设置界面,但是此时bond0是默认关闭的:
在这里插入图片描述
需要点进去设置固定IP:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
接下来就和常规安装Ubuntu没区别了,不再演示。

二,修改/etc/netplan/*.yaml
如果安装系统时没有设置bond,后续可以修改网络配置文件来设置bond:

sudo vim /etc/netplan/50-cloud-init.yaml   #配置文件名不是固定的,文件名后缀你固定为yaml
sudo netplan apply                           #立刻使用修改后的配置文件
  • 1
  • 2

下面一个可以正常使用的配置文件,可以根据实际情况来自行修改(必须注意缩进):

# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    bonds:
        bond0:
            addresses:
            - 192.168.123.101/24
            gateway4: 192.168.123.1
            interfaces:
            - enp74s0f0
            - enp74s0f1
            nameservers:
                addresses:
                - 223.5.5.5
            parameters:
                mode: balance-alb
    ethernets:
        enp74s0f0: {}
        enp74s0f1: {}
    version: 2

 

修改yaml配置文件后使用sudo netplan apply或者重启来载入修改后的配置文件。

 
版权声明:本文为a1561386524原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/a1561386524/article/details/106681394