Getting Started with Linux (network configuration)

Getting the Linux network management and network configuration

Network management

  NetworkManager, the system is automatically connected to a network provider and detection configuration, NetworkManager for wireless and wired networks can be managed, especially for wireless networks, NetworkManager automatically selected known wireless network, and can be switched to the most reliable network. NetworkManager was originally developed by Red Hat, is now hosted by the GNOME project.

  The default NetworkManager provides networking services is a dynamic network control and configuration daemon, it attempts to keep network equipment and connection is active when it is available. NetworkManager services are managed by systemd, after NetworkManager daemon is started, it will automatically connect to any available system has already been configured connection. Any network connection or configuration is required to configure the connection by nmcli command.

Network management three methods:

a user interface at the interface 1. Text nmtui

2. Command Line Settings nmcli

3. GUI provided nm-connection-editor


NetworkManger

  Linux systems are generally installed by default NetworkManager, if not the first installation can be installed.

installation

1) Installation

# yum install NetworkManager

2) Start

# systemctl start NetworkManager

# systemctl enable NetworkManager

3) status View

# systemctl status NetworkManager

Profile distribution

  NetworkManager connection types can be used for the following: Ethernet, VLAN, bridges, aggregated link group, Wi-Fi, mobile broadband (such as a mobile network 3G) and IP-over-InfiniBand. In these connection types, the network can be configured NetworkManager alias, IP address, static router, the DNS information, and the VPN connection, and many specific connection parameters.

  NIC configuration files and scripts stored in / etc / sysconfig / directory. Except for most network configuration information is stored here, VPN, mobile and broadband PPPoE configuration, which is stored in / etc / NetworkManager / subdirectory

Manually modify the network card configuration file Why not take effect immediately?
When editing ifcfg file in Red Hat Enterprise Linux 7, NetworkManager does not automatically aware of the change, the need to provide notice

# nmcli Connection reload
# nmcli the Load CON / etc / sysconfig / Network-scripts / ifcfg-ifname


nmtui command

nmtui configuration commands to the interactive network

If you can not find this command is available which nmcli appear This is the command where the path, and then use the rpm - nmtui view this command qf / usr / bin / which is present in the package, talk to find the package installed will be able to use the command nmtui the

After configuration is complete ifconfig command can be used to view the network configuration information

Or ip add show can also view the network configuration information, this command displays the information will be detailed than the ifconfig

nmcli command

nmcli OPTIONS OBJECT { COMMAND | help }

OPTIONS

-t[erse] terse output #简洁的输出

-p[retty] pretty output #漂亮的输出

-m[ode] tabular|multiline output mode #输出模式

-c[olors] auto|yes|no whether to use colors in output #是否在输出中使用颜色

-f[ields] |all|common specify fields to output #指定要输出的字段

-e[scape] yes|no escape columns separators in values #值中的列分隔符

-a[sk] ask for missing parameters #询问缺少的参数

-s[how-secrets] allow displaying passwords #允许显示密码

-w[ait] set timeout waiting for finishing operations #设置超时等待完成操作

-v[ersion] show program version #显示程序版本

-h[elp] print this help #打印帮助



OBJECT

g[eneral] NetworkManager’s general status and operations #网络管理的一般状况及操作

n[etworking] overall networking control #网络开启与禁用

r[adio] NetworkManager radio switches #无线网络开关

c[onnection] NetworkManager’s connections #网络连接管理

d[evice] devices managed by NetworkManager #设备管理

a[gent] NetworkManager secret agent or polkit agent #安装代理

m[onitor] monitor NetworkManager changes #监控NetworkManager 的改动,每当 NetworkManager 出现改动时打印一行信息。

There are commonly used in object: Connection , Device , General

1) Device Management nmcli device

nmcli device {command}

show 显示所有网络连接详细信息

status 显示网络连接状态

disconnect 禁用某个网络连接

connect 启动某个网络连接

monitor 监控某个连接的NetworkManager操作

set 设置设备为自动连接或者是否受NetworkManager管理

2) Set General nmcli general

nmcli general {command}

status 状态

hostname 设置计算机名

permissions 权限

logging [level ] [domains ]  日志

View Log command journalctl

3) the network connection configuration nmcli connection

nmcli connection {command}

show 显示某个连接的详细信息

up 激活某个连接

down 取消激活某个连接

add 增加一个连接

modify 修改一个连接

delete 删除一个链接

monitor 监控某个练级的networkmanager操作

reload 重载配置文件

load 重载某个连接的配置文件

clone 克隆连接

edit 交互修改连接


Guess you like

Origin www.cnblogs.com/aqiao/p/11706846.html