网络

ubuntu配置聚合

· 358 字 · 约 1 分钟

vi /etc/netplan/00-installer-config.yaml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This is the network config written by 'subiquity'
network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: no
      optional: true
    ens35:
      dhcp4: no
      optional: true
    ens36:
      dhcp4: no
      optional: true
    ens37:
      dhcp4: no
      optional: true

  bonds:
    bond0:
      dhcp4: no
      optional: no
      addresses: [172.16.201.53/24]
      gateway4: 172.16.201.254
      nameservers:
        addresses: [172.16.10.9]
      interfaces:
        - ens33
        - ens35
        - ens36
        - ens37
      parameters:
        mode: balance-rr # mode=0 (轮询模式)
        mii-monitor-interval: 100
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
root@nbuclient03:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 06:c9:3f:a1:ef:c3 brd ff:ff:ff:ff:ff:ff
3: ens35: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 06:c9:3f:a1:ef:c3 brd ff:ff:ff:ff:ff:ff
4: ens36: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 06:c9:3f:a1:ef:c3 brd ff:ff:ff:ff:ff:ff
5: ens37: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether 06:c9:3f:a1:ef:c3 brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 06:c9:3f:a1:ef:c3 brd ff:ff:ff:ff:ff:ff
    inet 172.16.201.53/24 brd 172.16.201.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::4c9:3fff:fea1:efc3/64 scope link
       valid_lft forever preferred_lft forever

root@nbuclient03:~# ethtool bond0
Settings for bond0:
	Supported ports: [ ]
	Supported link modes:   Not reported
	Supported pause frame use: No
	Supports auto-negotiation: No
	Supported FEC modes: Not reported
	Advertised link modes:  Not reported
	Advertised pause frame use: No
	Advertised auto-negotiation: No
	Advertised FEC modes: Not reported
	Speed: 40000Mb/s
	Duplex: Full
	Port: Other
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: off
	Link detected: yes
root@nbuclient03:~#