Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Using nmcli commands to manage network in RedHat / CentOS 7.x     - Ubuntu 15.04 / CentOS 7.0 to set custom boot (Linux)

- xCAT line installation on CentOS 6.X (Linux)

- fcntl file locking function add (Programming)

- CentOS 6.5 start ActiveMQ being given to solve (Server)

- Through the source code to install MySQL 5.6.26 under CentOS6 (Database)

- Spacewalk Linux system configuration and installation (Linux)

- ARM runtime environment built from scratch using QEMU emulator (Linux)

- Use HugePages optimize memory performance (Database)

- Shorewall firewall settings under Ubuntu (Linux)

- Hadoop 2.7.1 Installation and Configuration under RedHat Linux 6.5 (Server)

- 7 JavaScript interview questions (Programming)

- Zookeeper Rights Management and Quota Management (Server)

- Use XtraBackup be physical standby database MySQL (Database)

- It is time to upgrade your gulp 4.0 (Programming)

- Install Java 8 on Ubuntu using PPA (Linux)

- Oracle () trunc function usage (Database)

- Oracle Database Restore (Database)

- ThinkPad X201i installation notes Debian 7.5 (Linux)

- Git uses a standard process (Linux)

- When Vim create Python scripts, vim autocomplete interpreter and encoding method (Programming)

 
         
  Using nmcli commands to manage network in RedHat / CentOS 7.x
     
  Add Date : 2017-01-08      
         
         
         
  Red Hat Enterprise Linux 7 and CentOS 7 default network services provided by NetworkManager, which is the guardian of the process control and dynamic configuration of the network, which is used to keep the current network equipment and connection in working condition, but also supports the traditional type of configuration ifcfg file.

NetworkManager can be used for the following types of connections: Ethernet, VLANS, Bridges, Bonds, Teams, Wi-Fi, mobile boradband (mobile 3G) and IP-over-InfiniBand. For these types of networks, NetworkManager can configure their network aliases, IP address, static routing, DNS, VPN connections, and many other special parameters.

You can use the command-line tool to control nmcli NetworkManager.

nmcli Usage

# Nmcli [OPTIONS] OBJECT {COMMAND | help}
We can TAB key to complete the command, when you forget the syntax of the command just press TAB you can see the list of options.

Some examples of the use of nmcli:

# Nmcli general status
This command will NetworkManager all states are printed.

# Nmcli connection show
Show all connections.

# Nmcli connection show -a
Display only currently active connections.

# Nmcli device status
Lists NetworkManager identified a list of devices and their status.

Start / stop network interfaces

Use nmcli tool to start or stop network interfaces, and the ifconfig up / down is the same.

Use the following command to stop an interface:

# Nmcli device disconnect eno16777736
The following command to enable the interface:

# Nmcli device connect eno16777736
Add a static IP Ethernet connections

The following command to add a static IP address for Ethernet connection:

# Nmcli connection add type ethernet con-name NAME_OF_CONNECTION ifname interface-name ip4 IP_ADDRESS gw4 GW_ADDRESS
Change NAME_OF_CONNECTION, IP_ADDRESS, GW_ADDRESS parameter (if not the gateway, then you can omit the last part) according to your desired configuration.

# Nmcli connection add type ethernet con-name NEW ifname eno16777736 ip4 192.168.1.141 gw4 192.168.1.1
Use the following command to set the DNS server:

# Nmcli connection modify NEW ipv4.dns "8.8.8.8 8.8.4.4"
The following command starts a new Ethernet connection:

# Nmcli connection up NEW ifname eno16777736
Check the configuration of the new connection:

# Nmcli -p connection show NEW

Add a new connection using DHCP

Add a new connection that uses DHCP to automatically assign IP address, gateway, DNS, etc., you have to do is to command line ip / gw address part removed on the line, DHCP automatically assigns these parameters.

Example, in the eno 16777736 configure a device called a DHCP connection NEW_DHCP

# Nmcli connection add type ethernet con-name NEW_DHCP ifname eno16777736
     
         
         
         
  More:      
 
- Windows environment Android Studio v1.0 Installation Guide (Linux)
- Zypper command for SUSE Linux package management (Linux)
- CentOS installation pycurl (Linux)
- Linux netstat command to get started (Linux)
- MySQL5.7 implement virtual column expression index (Database)
- redis main building and disaster recovery from a cluster deployment (Database)
- Boot-Repair Tool - repair of frequent start-up problems (Linux)
- Prevent security threats caused Rootkit (Linux)
- GoldenGate update is missing (Database)
- Add a custom encryption algorithm in OpenSSL (Linux)
- MySQL primary and secondary replicate data inconsistencies (Database)
- Setting Linux desktop environment, achieve HiDPI display support (Linux)
- Django how to generate content in non-HTML formats (Programming)
- Change the kernel boot sequence after CentOS 7 kernel upgrade (Linux)
- CentOS 6.0 system security level (Linux)
- Debian SSD ext4 4K aligned (Linux)
- Installation and Configuration rsync server under CentOS 6.3 (Server)
- To configure Samba to share files with Windows under CentOS (Linux)
- MySQL database master never solve the synchronization method (Database)
- XP virtual machine under VirtualBox solve occupy 100% CPU problem (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.