Home  >  Article  >  System Tutorial  >  Quickly configure the network and master the Linux system

Quickly configure the network and master the Linux system

王林
王林forward
2024-02-10 09:30:13717browse

In the modern information society, the Internet has become an indispensable part of people's life and work. In Linux systems, network configuration often requires the use of some commands and tools, which may be difficult for novices. Today, we will introduce you to several common Linux network configuration tools to help you complete network configuration quickly and efficiently.

Quickly configure the network and master the Linux system

This article introduces RHEL8 network services and network configuration tools, as well as network firewall and rule management tools.

NetworkManager network management tool

NetworkManager provides RHEL8 network services. Each network device is associated with a NetworkManager device, and the configuration of the network device is saved in the NetworkManager connection.
NetworkManager provides a D-Bus API interface to configure and manage the network, and GUI/TUI/CLI tools to configure the network.

Install NetworkManager

$ yum install NetworkManager

Open NetworkManager

$ systemctl enable NetworkManager

Start NetworkManager

$ systemctl start NetworkManager

View NetworkManager status

$ systemctl status NetworkManager

Network Configuration Tool

RHEL8 provides three network configuration tools, namely

nmcli 命令行界面
nmtui 简单TUI界面
nm-connection-editor 图形界面
network dispatcher特性支持根据网络状态来运行相关脚本,脚本存放在目

录/etc/NetworkManager/dispatcher.d/中

网络配置文件存放在/etc/sysconfig/network-scripts/目录中,默认不提供default脚本,在RHEL8中使用

ifup/ifdown来开启和关闭指定网络。在修改网络配置后不会立即生效,需要重启网路或reload


$ nmcli connection reload

List network devices

$ nmcli device

List network connections

$ nmcli connection

Display overall status

$ nmcli general status

Set DNS

$ nmcli con mod conn-name ipv4.dns "8.8.8.8 8.8.4.4"


$ nmcli -p con show conn-name

Start interactive interface

$ nmcli con edit

Firewall management module nftables

Media Access Control Security(MACsec)是一种网络传输加密认证技术。
IPsec工作在网络层(2)
SSL工作在应用层(7)
MACsec工作在数据链路层(2)

RHEL8中使用nftables作为firewall后端取代了原来的iptables,nftables提供了包过滤分类功能并集成了多种工

具,并进行了许多改进,比如同时支持IPv4/IPv6,自动处理规则,支持debug等等。

与iptables类似,nftables使用表来保存网络链。网络链(chains)包含对每个行为的规则。nft工具取代了之前网

络包过滤框架中的所有组件。libnftnl库可以用来与nftables API通过libnml在低层网络层交互。

在RHEL8中,nftables作为firewall默认后端。尽管nftables后端与之前防火墙配置iptables后端后向兼容,你仍

然可以切换防火墙后端到iptables。需要将配置文件/etc/firewalld/firewalld.conf中FirewallBackend选项

配置成iptables。

nftables规则模块的影响可以通过nft命令列出规则列表。由于nftables规则设置中增加了表,链和规则的划分,在操

作时需要注意影响。

This article introduces several common Linux network configuration tools, including ifconfig, iproute2, Netplan, etc. While each tool has its pros and cons, they all help you easily configure and manage your network connections. Of course, which tool you choose depends on your specific needs and skill level. Using these tools, you can complete network configuration more easily and master the Linux system.

The above is the detailed content of Quickly configure the network and master the Linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:lxlinux.net. If there is any infringement, please contact admin@php.cn delete