0. online help
man nmcli [ you can see nmcli-examples(7) on the bottom SEE ALSO section]
man nmcli-examples [search "bond", "team"]
man teamd.config [ search runner ]
man teamd.config [ search runner ]
1. Cheat sheet
preparation:
$ nmcli con delete eth1
$ nmcli con delete eth2
bonding:
$ nmcli con add type bond ifname mybond0 mode active-backup
$ nmcli con add type ethernet ifname eth1 master mybond0
$ nmcli con add type ethernet ifname eth2 master mybond0
teaming:
$ nmcli con add type team con-name Team1 ifname Team1 config '{"runner":{"name":"activebackup"}}}'
$ nmcli con add type ethernet con-name Team1-slave1 ifname eth1 master Team1
$ nmcli con add type ethernet con-name Team1-slave2 ifname eth2 master Team1
2. virtual network device
- The kernel creates a virtual network device whose driver takes advantage of the real physical network device eth0 and eth1 to work.
- Each network device, both physical and virtual, has a name and can be seen in userspace on /sys/class/net.
[root@server1 ~]# ls /sys/class/net/
mybond0 bonding_masters ens10 ens11 eth2 lo
- The kernel support many kinds of virtual network device besides bond/team, such as bridge, tun, tap....
3. What's a "connection" for nmcli?
- In nmcli, a "connection" is actually a profile or configuration for a network device.
- The "connection" name usually share the same name as its configured device. But it's not always true.
- The "connection" name is only visible to nmcli while the device name is seeable/used by all network tools like ip/ifconfig/netstat.
- Usually, there are more network devices than nmcli "connections" as not all devices are managed by NetworkManager.
- For one network device, there may be multi "connections", but only one can be active at the same time. This is very useful for portable computers which have different network setups at home and in the office.
Based on the above, "profile" may be a more meaningful name than "connection".
No comments:
Post a Comment