Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Using nmcli commands to manage network in RedHat / CentOS 7.x     - About Python default character set (Linux)

- Linux System Getting Started Learning: On Linux how to convert text files to PDF (Linux)

- Transfer files to Windows and Linux (Linux)

- NET Developers need to know some Linux commands (Linux)

- Installation and use the telnet command under CentOS 6.x (Linux)

- Dynamic programming Android (Programming)

- RedHat Performance Tuning (Server)

- How do I switch from NetworkManager to systemd-network on Linux (Linux)

- AWR Report (Database)

- Git use and interpretation of common commands (Linux)

- Use nice, cpulimit and cgroups limit cpu usage (Linux)

- Java memory mechanism Description (Programming)

- Job achieve automation in Ubuntu 14.04 - Using Cron (Linux)

- MongoDB polymerization being given (Database)

- Linux System Getting Started Learning: DeVeDe installed on Linux to create a video DVD (Linux)

- OpenGL Superb Learning Notes - Vertex Shader example (Programming)

- MySQL multi-master multi-cluster deployment uses alive Galera (Database)

- Ubuntu system grub repair method (Linux)

- MySQL Tutorial: Using tpcc-mysql pressure measurement (Database)

- Netfilter / Iptables Comments (Linux)

 
         
  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:      
 
- Spring-depth understanding of the various annotations (Programming)
- Linux systems use IP masquerading anti-hacker (Linux)
- Whisker Menu 1.4.3 Install menu Linux (Linux)
- Linux server network penetration testing (Linux)
- CentOS Nginx achieve 3 virtual machine load balancing (Server)
- RHEL6.5 replace local YUM source (Linux)
- Installation Flow N Play- interface stylized video player on Ubuntu (Linux)
- Ubuntu rights management common commands (Linux)
- Linux POST fstab configuration file read-only variable can not be modified problem (Linux)
- Getting Started with Linux system to learn: How to compress JPEG images on the command line (Linux)
- The Linux firewall is configured to use proxy (Linux)
- Create the container and run the application Docker (Server)
- Setting the RedHat9 Intrusion Detection System (Linux)
- Production Environment MongoDB Fragmentation and Cluster Solution (Database)
- Linux yum command Detailed (Linux)
- Static member variable modified (Programming)
- Infinispan 8 new Redis cache storage implementation (Linux)
- Hutchison DG standby database CPU consumption reached bottleneck repair (Database)
- Compare Dalvik virtual machine and the JVM (Linux)
- Use Python to perform system commands common usage (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.