[Administrative] [CentOS] [NetworkManager] NetworkManager (ii)

Source: Internet
Author: User

Engineering Documents:

Https://wiki.gnome.org/Projects/NetworkManager

RH Admin Manual:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/

NMCLI User manual:

Https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-network_ Config_using_nmcli

After basic understanding, see help directly. The main is to understand Connect,device, and so on these concepts.

[Email protected] j]# NMCLI Help

Next, do an example to try:

Add a tap device:

[[email protected] j]# nmcli connection NAME UUID TYPE DEVICE ens33 E46 72331-0638-4db8-b818-d6ff50f901af802-3-Ethernet ENS33 [[email protected] jcloud]# nmcli Connection Add type Tun mode TAP ifname tap-NLB Con-name tap-NLB AutoConnect Yes save yesconnection'TAP-NLB'(b3e1db65-4821-4139-95f5-9cba4035ee08) successfully added. [[email protected] j]# nmcli connection NAME UUID TYPE DEVICE ens33 e4 672331-0638-4db8-b818-d6ff50f901af802-3-Ethernet ENS33 Tap-NLB b3e1db65-4821-4139-95f5-9cba4035ee08 Tun tap-NLB [[email protected] j]#

The generated configuration file is here:

[Email protected] j]# cat/etc/networkmanager/system-connections/tap-NLB [connection]id=tap-nlbuuid =b3e1db65-4821-4139-95f5-9cba4035ee08type=tuninterface-name= tap-nlbpermissions=[Tun]mode=2[Ipv4]dns-search=Method=  Auto[ipv6]addr-gen-mode=stable-privacydns-search=method=auto

To modify the DHCP that disables tap:

[Email protected] ~]# NMCLI connection Modify TAP-NLB Ipv4.method link-local

To remove a tap connection device:

[[email protected] ~]# NMCLI Connection Delete tap-'tap-nlb' (b3e1db65-4821 -4139-95f5-9cba4035ee08) successfully deleted.

The device is automatically added or removed when connected to Up/down and can be viewed with NMCLI device.

Another example is to add a bridge to the external network:

1. To add a network bridge:

[[Email protected]~]# nmcli Connection Add type BRIDGE ifname br-ext AutoConnect Yes save Yes Connection'Bridge-br-ext'(e886ae77-3a2c-4c93-aee0-4dea8b4d12a8) successfully added. [[Email protected]~]# nmcli Connection showname UUID TYPE DEVICE Bridge-br-ext E886ae77-3a2c-4c93-aee0-4dea8b4d12a8 Bridge br-ext ens33 e4672331-0638-4db8-b818-d6ff50f901af802-3-Ethernet ENS33 [[email protected]~]# nmcli devicedevice TYPE State CONNECTION Ens33 Ethernet connected Ens33 BR-ext Bridge connecting (getting IP configuration) bridge-br-ext lo Loopback unmanaged--

2. Increase slave

[Email protected] ~]# nmcli connection Add type Bridge-slave ifname ens33 master Br-ext

3. Switch the connection from the NIC to bridge

[[email protected] jcloud]# NMCLI connection down Ens33[[email protected] jcloud]# nmcli connection up bridge-sla Ve-ens33

4. Erase the principle of connect

5. Reboot test

6 successes. NetworkManager learned to use it.

[[Email protected] ~]# IP Link1: Lo: <LOOPBACK,UP,LOWER_UP> MTU65536Qdisc Noqueue State UNKNOWN mode DEFAULT Qlen1Link/loopbackxx:xx:xx:xx:xx:xxBrdxx:xx:xx:xx:xx:xx2: Ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU theQdisc Pfifo_fast Master Br-ext State up mode DEFAULT Qlen +Link/etherxx: 0c: in: 2F:CF: +BRD FF:FF:FF:FF:FF:FF3:Br-ext:<BROADCAST,MULTICAST,UP,LOWER_UP> MTU theQdisc Noqueue State up mode DEFAULT Qlen +Link/etherxx: 0c: in: 2F:CF: +BRD Ff:ff:ff:ff:ff:ff[[email protected]~]# IP Addr1: Lo: <LOOPBACK,UP,LOWER_UP> MTU65536Qdisc Noqueue State UNKNOWN Qlen1Link/loopbackxx:xx:xx:xx:xx:xxBrdxx:xx:xx:xx:xx:xxinet127.0.0.1/8Scope host lo valid_lft forever Preferred_lft Forever Inet6::1/ -Scope host Valid_lft forever Preferred_lft forever2: Ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU theQdisc Pfifo_fast Master Br-ext State up Qlen +Link/etherxx: 0c: in: 2F:CF: +BRD FF:FF:FF:FF:FF:FF3: Br-ext: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU theQdisc Noqueue State up Qlen +Link/etherxx: 0c: in: 2F:CF: +BRD ff:ff:ff:ff:ff:ff inet192.168.50.128/24Brd192.168.50.255ScopeGlobal Dynamicbr-ext valid_lft 1771sec preferred_lft 1771sec inet6 fe80::1ecf:c3cc:4ff6:ef29/ -scope link Valid_lft forever preferred_lft forever[[email protected]~]# brctl Showbridge name Bridge ID STP enabled INTERFACESBR-ext8000.000C292FCF32 YesEns33

Other than that:

The NMCLI tap device is invisible in the Nmtui. and cannot be edited. So the preferred or nmcli.

[Administrative] [CentOS] [NetworkManager] NetworkManager (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.