Ubuntu18.04設置bond6

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                           #立刻使用修改後的配置文件

下面一個可以正常使用的配置文件,可以根據實際情況來自行修改(必須注意縮進):

# 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或者重啓來載入修改後的配置文件。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章