18. linux 网络管理
18.1 网卡命名管理
$# 1. 给linux添加一块网卡(网络适配器) - vMnet11
[root@localhost ~]
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.152 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::f3b3:cb7d:dd78:78ca prefixlen 64 scopeid 0x20<link>
ether 00:50:56:3f:96:8d txqueuelen 1000 (Ethernet)
RX packets 134 bytes 12008 (11.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 98 bytes 14397 (14.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]
1. 有线网卡 eth0/eth1
2. 无线网卡 wlan0/wlan1
3. 本地环回网卡 lo0
前两位 + 设备类型 + 设备索引/哈希值
前两位:
en: Ethernet - 有线
wl: Wireless - 无线
lo: Loopback - 本地环回
设备类型
o: On-board - 板载网卡
s: hotplug Slot - 热插拔网卡
p*s*: PCI / Slot - PCI网卡
哈希值 | 索引值 系统自动判断生成 - dmidecode
eno网卡哈希值
ens网卡索引值
enp*s*[PCI bus id] s[slot id]
eno16777736
ens33
ens37
enp0s3
enp3s0 : 3号pci总线,0号插槽
wlp*s*
wlp3s0
======================================================================================
$# 2. 调整网卡命令规则方式
[root@localhost ~]
6 GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap
rhgb quiet"
[root@localhost ~]
[root@localhost ~]
6 GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet net.ifnames=0 biosdevname=0"
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
18.2 网卡配置文件
[root@localhost ~]
[root@localhost network-scripts]
[root@localhost network-scripts]
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=f5cf366a-83e3-4a3d-94b4-0387601110ac
DEVICE=ens33
ONBOOT=yes
DNS1=192.168.8.2
IPADDR=192.168.8.152
PREFIX=24
GATEWAY=192.168.8.2
======================================================================================
$# 2. 修改配置文件
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
DNS1=192.168.8.2
IPADDR=192.168.8.152
PREFIX=24
GATEWAY=192.168.8.2
[root@localhost network-scripts]
[root@localhost network-scripts]
TYPE=Ethernet
BOOTPROTO=none
NAME=eth1
DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.11.152
PREFIX=24
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost ~]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:3f:96:8d brd ff:ff:ff:ff:ff:ff
inet 192.168.8.152/24 brd 192.168.8.255 scope global eth0
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:8a:3e:f1 brd ff:ff:ff:ff:ff:ff
inet 192.168.11.152/24 brd 192.168.11.255 scope global eth1
[root@localhost ~]
[root@localhost ~]
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.8.2 0.0.0.0 UG 100 0 0 eth0(默认路由)
192.168.8.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0(直连路由)
192.168.11.0 0.0.0.0 255.255.255.0 U 100 0 0 eth1(直连路由)
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[root@localhost ~]
18.3 网络接口管理
$# 1. 网络接口查看
ifconfig
ifconfig -a
ifconfig eth0
ip add show
ip add show dev eth0
ip link
[root@localhost ~]
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.152 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::250:56ff:fe3f:968d prefixlen 64 scopeid 0x20<link>
ether 00:50:56:3f:96:8d txqueuelen 1000 (Ethernet)
RX packets 2006 bytes 139363 (136.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 709 bytes 95425 (93.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: 网卡硬件名称
flags: 网卡标志 - 包含网卡-系列状态 <>
UP: 管理状态UP - 管理员未将网卡关闭 | Master State
BROADCAST: 该接口支持广播消息
MULTICAST: 该接口支持组播消息
UNICAST: 该接口支持单播消息
RUNNING: 网卡线路正常 (网线/光纤/虚拟链接)
mtu(mrt) 1500: 该接口最大传输单元
t: transit 发送
r: receive 接受
inet: IPV4地址 / netmask 子网掩码/ broadcast 广播地址
inet6: IPV6相关信息
ether: MAC地址
txqueuelen: 数据发送缓冲区长度
packets: 包的数量
bytes: 字节数
errors: 错误包总数
dropped: 丢弃包 - 内存不足导致数据丢弃
overruns: 网卡缓冲区溢出导致数据错误-无法处理
frame: 数据帧CRC/FCS序列值校验失败 - 物理信号不稳定导致的传输问题
carrier: 物理设备数据载波絮乱-数据错误
collisions: 物理线路CSMA/CD监听数据冲突
LOWER_UP (网卡线路正常) / NO-CARRIER (网卡线路不正常)
state (管理员设置关闭 or 网络线路异常) down
[root@localhost ~]
$# 1. 网络接口配置文件卸载/加载 - (网卡和配置文件解除关联)
[root@localhost ~]
Device 'eth0' successfully disconnected.
[root@localhost network-scripts]
[root@localhost network-scripts]
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:50:56:3f:96:8d txqueuelen 1000 (Ethernet)
RX packets 392 bytes 46234 (45.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 192 bytes 25891 (25.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
[root@localhost network-scripts]
$# 2. 网络接口开启/关闭
[root@localhost network-scripts]
[root@localhost network-scripts]
eth0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:50:56:3f:96:8d txqueuelen 1000 (Ethernet)
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.152 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::250:56ff:fe3f:968d prefixlen 64 scopeid 0x20<link>
ether 00:50:56:3f:96:8d txqueuelen 1000 (Ethernet)
[root@localhost network-scripts]
======================================================================================
ip link set eth0 down
ip link set eth0 up
======================================================================================
$# 3. 查看网卡硬件详细信息
[root@localhost network-scripts]
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
[root@localhost network-scripts]
18.4 网络服务管理
$# 1. 网络服务
network
NetworkManager.service
centos6 network
centos7 network / NetworkManager.service
centos8 NetworkManager.service
$# 2. 两种的区别
NetworkManager.service 支持多种网络管理办法
GUI
*nmcli (NetworkManager Conmmand Line Interface)
nmtui (NetworkManager Terminal User Interface)
NetworkManager.service 支持管理多种网络类型
有线网络/无线网络/VPN网络/桥接网络 etc..
NetworkManager.service 更加灵活管理网卡与配置文件,真正做到解耦合
$# 3. 建议使用NetworkManager.service
[root@localhost ~]
network.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig network off
Created symlink from /etc/systemd/system/network.service to /dev/null.
[root@localhost ~]
[root@localhost ~]
connect: Network is unreachable
[root@localhost ~]
18.5 nmcli网络管理
nmcli - NetworkManager.service网络服务管理中的一种网络管理工具
$# 1.
[root@localhost ~]
DEVICE TYPE STATE CONNECTION
virbr0 bridge connected virbr0
eth0 ethernet disconnected --
eth1 ethernet disconnected --
lo loopback unmanaged --
virbr0-nic tun unmanaged --
[root@localhost ~]
DEVICE: 网卡设备名称
TYPE: 网卡类型
ethernet
loopback
bridge: 虚拟网桥/虚拟交换机
tun: 虚拟网卡
STATE: 网卡状态
connected: 已经链接到配置文件
disconnected: 未已经链接到配置文件
unmanaged: 未受NetworkManager管理 (添加链接信息进行管理)
CONNECTION: 当前网卡加载到链接信息,网卡配置文件
[root@localhost ~]
NAME UUID TYPE DEVICE
virbr0 cf57cafd-c2b8-49a7-814c-201bad225a00 bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet --
eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 802-3-ethernet --
[root@localhost ~]
NAME - 配置文件信息
UUID - 网卡connection配置文件唯一标识符
TYPE - 网卡类型
DEVICE - 网卡设备名称
$# 2. 网络配置 文件关联
[root@localhost ~]
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)
[root@localhost ~]
[root@localhost ~]
Device 'eth1' successfully activated with '9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04'.
[root@localhost ~]
$# 3. 网络配置 文件断开关联
[root@localhost ~]
Connection 'eth0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)
[root@localhost ~]
Device 'eth1' successfully disconnected.
[root@localhost ~]
$# 4. 网络connection配置文件添加
oot@localhost network-scripts]
[root@localhost network-scripts]
Connection 'static-ip-eth1' (d9b0c44a-9038-4306-9a25-13d491b8cc7e) successfully added.
[root@localhost network-scripts]
[root@localhost network-scripts]
NAME UUID TYPE DEVICE
virbr0 cf57cafd-c2b8-49a7-814c-201bad225a00 bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet --
eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 802-3-ethernet --
static-ip-eth1 d9b0c44a-9038-4306-9a25-13d491b8cc7e 802-3-ethernet --
[root@localhost network-scripts]
ifcfg-eth0 ifcfg-eth1 ifcfg-static-ip-eth1
[root@localhost network-scripts]
[root@localhost network-scripts]
DEVICE TYPE STATE CONNECTION
virbr0 bridge connected virbr0
eth1 ethernet connected eth1
eth0 ethernet disconnected --
lo loopback unmanaged --
virbr0-nic tun unmanaged --
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/17)
[root@localhost network-scripts]
NAME UUID TYPE DEVICE
static-ip-eth1 d9b0c44a-9038-4306-9a25-13d491b8cc7e 802-3-ethernet eth1
virbr0 cf57cafd-c2b8-49a7-814c-201bad225a00 bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet --
eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 802-3-ethernet --
[root@localhost network-scripts]
[root@localhost network-scripts]
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:8a:3e:f1 brd ff:ff:ff:ff:ff:ff
inet 192.168.11.153/24 brd 192.168.11.255 scope global eth1
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection 'static-ip-eth0' (d4adfb0d-7f36-4c4b-b785-8329e0c55dda) successfully added.
[root@localhost network-scripts]
NAME UUID TYPE DEVICE
static-ip-eth1 d9b0c44a-9038-4306-9a25-13d491b8cc7e 802-3-ethernet eth1
virbr0 cf57cafd-c2b8-49a7-814c-201bad225a00 bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet --
eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 802-3-ethernet --
static-ip-eth0 d4adfb0d-7f36-4c4b-b785-8329e0c55dda 802-3-ethernet --
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/18)
[root@localhost network-scripts]
NAME UUID TYPE DEVICE
static-ip-eth0 d4adfb0d-7f36-4c4b-b785-8329e0c55dda 802-3-ethernet eth0
static-ip-eth1 d9b0c44a-9038-4306-9a25-13d491b8cc7e 802-3-ethernet eth1
virbr0 cf57cafd-c2b8-49a7-814c-201bad225a00 bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet --
eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 802-3-ethernet --
[root@localhost network-scripts]
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.153 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::89ed:c926:3e3a:3498 prefixlen 64 scopeid 0x20<link>
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
ifcfg-eth0 ifcfg-eth1 ifcfg-static-ip-eth0 ifcfg-static-ip-eth1
[root@localhost network-scripts]
$# 5. 网络网卡详细信息查看
[root@localhost network-scripts]
[root@localhost network-scripts]
GENERAL.DEVICE: eth0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:50:56:3F:96:8D
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: static-ip-eth0
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/18
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.8.153/24
IP4.GATEWAY: 192.168.8.2
IP6.ADDRESS[1]: fe80::89ed:c926:3e3a:3498/64
IP6.GATEWAY: --
[root@localhost network-scripts]
[root@localhost network-scripts]
Device 'eth0' successfully disconnected.
[root@localhost network-scripts]
GENERAL.DEVICE: eth0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:50:56:3F:96:8D
GENERAL.MTU: 1500
GENERAL.STATE: 30 (disconnected)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
WIRED-PROPERTIES.CARRIER: on
[root@localhost network-scripts]
$# 6. 网络接口开启/关闭
100 (connected)
30 (disconnected)
nmcli connection down
nmcli device disconnect
ifdown
20 (unavailable)
ip link set eth0 down
ifconfig eth0 down
70 (connecting (getting IP configuration))
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
NAME UUID TYPE DEVICE
static-ip-eth1 d9b0c44a-9038-4306-9a25-13d491b8cc7e 802-3-ethernet eth1
virbr0 cf57cafd-c2b8-49a7-814c-201bad225a00 bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet --
eth1 9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04 802-3-ethernet --
static-ip-eth0 d4adfb0d-7f36-4c4b-b785-8329e0c55dda 802-3-ethernet --
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection 'eth1' (9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04) successfully deleted.
[root@localhost network-scripts]
Connection 'eth0' (5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03) successfully deleted.
[root@localhost network-scripts]
nmcli connetion delete [connetion-name]
[root@localhost network-scripts]
Connection 'test01' (d574e7d6-6f05-4036-8037-0961a4d8092d) successfully added.
[root@localhost network-scripts]
[root@localhost network-scripts]
ifcfg-static-ip-eth0 ifcfg-static-ip-eth1 ifcfg-test01
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection 'test01' (d574e7d6-6f05-4036-8037-0961a4d8092d) successfully deleted.
[root@localhost network-scripts]
ifcfg-static-ip-eth0 ifcfg-static-ip-eth1
[root@localhost network-scripts]
18.6 修改connection信息
$# 1. 修改connection信息
[root@localhost network-scripts]
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.153 netmask 255.255.255.0 broadcast 192.168.8.255
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:3f:96:8d brd ff:ff:ff:ff:ff:ff
inet 192.168.8.153/24 brd 192.168.8.255 scope global eth0
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection 'static-ip-eth0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/19)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/21)
[root@localhost network-scripts]
[root@localhost network-scripts]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:3f:96:8d brd ff:ff:ff:ff:ff:ff
inet 192.168.8.152/24 brd 192.168.8.255 scope global eth0
[root@localhost network-scripts]
18.7 DNS管理
$# 1. DNS添加
[root@localhost network-scripts]
[root@localhost network-scripts]
^C
[root@localhost network-scripts]
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2012ms
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
DNS1=114.114.114.114
[root@localhost network-scripts]
[root@localhost network-scripts]
^C
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection 'static-ip-eth0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/21)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/23)
[root@localhost network-scripts]
nameserver 114.114.114.114
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
nameserver 114.114.114.114
[root@localhost network-scripts]
Connection 'static-ip-eth0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/23)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/25)
[root@localhost network-scripts]
nameserver 114.114.114.114
nameserver 8.8.8.8
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
Connection 'static-ip-eth0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/25)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/27)
[root@localhost network-scripts]
nameserver 114.114.114.114
[root@localhost network-scripts]
18.8 DHCP管理
$# 1.
[root@localhost network-scripts]
Connection 'dhcp-eth0' (2fcefb20-592a-4f36-ba27-f469b0d81f59) successfully added.
[root@localhost network-scripts]
ifcfg-dhcp-eth0 ifcfg-static-ip-eth0 ifcfg-static-ip-eth1
[root@localhost network-scripts]
[root@localhost ~]
NAME UUID TYPE DEVICE
dhcp-eth0 d454dc39-b697-4a71-a523-abdb159fc268 802-3-ethernet eth0
static-ip-eth1 d9b0c44a-9038-4306-9a25-13d491b8cc7e 802-3-ethernet eth1
virbr0 212ad7de-1d30-49eb-826b-e7f25e507550 bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
static-ip-eth0 d4adfb0d-7f36-4c4b-b785-8329e0c55dda 802-3-ethernet --
[root@localhost ~]
[root@localhost ~]
^CError: nmcli terminated by signal Interrupt (2)
[root@localhost ~]
[root@localhost ~]
search localdomain
[root@localhost ~]
[root@localhost ~]
ping: www.qq.com: Name or service not known
[root@localhost ~]
======================================================================================
[root@localhost ~]
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
[root@localhost ~]
NAME UUID TYPE DEVICE
dhcp-eth0 d454dc39-b697-4a71-a523-abdb159fc268 802-3-ethernet eth0
static-ip-eth1 d9b0c44a-9038-4306-9a25-13d491b8cc7e 802-3-ethernet eth1
virbr0 b7218154-899d-4e34-ae58-bd8d27cebffa bridge virbr0
Wired connection 1 dee7c67b-dd99-35de-b2ff-2699d21d05ac 802-3-ethernet --
static-ip-eth0 d4adfb0d-7f36-4c4b-b785-8329e0c55dda 802-3-ethernet --
[root@localhost ~]
[root@localhost ~]
search localdomain
nameserver 192.168.8.2
[root@localhost ~]
PING ins-r23tsuuf.ias.tencent-cloud.net (112.53.42.52) 56(84) bytes of data.
64 bytes from 112.53.42.52 (112.53.42.52): icmp_seq=1 ttl=128 time=51.3 ms
^C
--- ins-r23tsuuf.ias.tencent-cloud.net ping statistics ---
2 packets transmitted, 1 received, 50% packet loss, time 1001ms
rtt min/avg/max/mdev = 51.359/51.359/51.359/0.000 ms
[root@localhost ~]
18.9 主机名字管理
$# 1.
[root@localhost ~]
localhost.localdomain
[root@localhost ~]
localhost.localdomain
[root@localhost ~]
[root@localhost ~]
localhost.localdomain
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
huawei
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
HCIE
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
18.10 网卡图形化管理
$# 1. 了解即可
GUI - 依赖GNONE/KDE图形化界面
nmtui - 不依赖GNONE/KDE图形化界面