Home > System Tutorial > LINUX > Analysis of Red Hat Linux9 version network management and three network connection methods of VMware virtual machines

Analysis of Red Hat Linux9 version network management and three network connection methods of VMware virtual machines

PHPz
Release: 2024-06-23 15:34:18
Original
1179 people have browsed it

红帽 Linux9 版本网络管理及 VMware 虚拟机三种网络连接方式解析

This article uses Red Hat Linux9 version as an example to explain.

The network management of Red Hat Linux 9 version is very comprehensive, and network configuration changes can be made in many places. However, it should be noted that in version 9, users can make network configuration changes in the configuration file, but the system cannot. The changed command will be executed, and versions before version 9 can execute it.

Three types of network connections on VMware virtual machines

Bridge Mode:

Connect the network card on the host to the virtual network card Vmnet0 through the virtual hub. In bridge mode, the network card of the virtual machine is connected to the virtual switch Vmnet0. When the virtual machine wants to access the InternetLinux system and network managementIs the Linux system easy to use? , the virtual machine IP address, subnet segment, network segment, etc. need to be configured the same as the host network card.

NAT mode:

Connect the network card on the host to the virtual network card Vmnet8 through the virtual hub. In NAT mode, the DHCP server of the virtual machine is connected to the Vmnet8 virtual switch. It should be noted that the virtual network card Vmnet8 is only used as a communication socket between the host and the virtual machine. The machine finally uses the host network card to connect to the Internet.

Host-Only mode:

The virtual network card Vmnet1 is connected to the virtual switch Vmnet1 to realize virtual machine communication. When the virtual machine needs to be connected to the Internet, the network card of the host network is shared with the virtual network card Vmnet1 to realize virtual machine networking.

Features of NetworkManager

NetworkManager is a project launched by RedHat in 2004 to allow Linux users to more easily handle modern network needs and manually discover network cards and configure IP addresses.

Features of NetworkManager

NM can manage all kinds of networks:

Wired network card, wireless network card

Dynamic ip, static ip

Ethernet, non-Ethernet

Chemical network card, virtual network card

Complete tools:

Command line, text interface, graphical interface, web

Recruit the world:

Manage various types of networks, wired, wireless, physical, virtual

Rich parameters:

Up to 200 configuration parameters (including ethtool parameters)

Unify the world:

RedHat system, Suse system, Debian/Ubuntu system, all supported

linux系统与网络管理_网络管理系统admin_网络管理系统入口

The general trend:

Starting from Red Hat Linux version 9, the network can only be managed through NM

1. Configure the network

Network socket refers to the entrance and exit for communication between computers or network equipment and other devices on the network. Here, it mainly refers to the computer's network socket, that is, the network card device.

Starting from Red Hat Linux 7 version, a new "Consistent Network Device Naming" form has been introduced for naming network sockets. This method can assign fixed names based on firmware, device topology, device type and location information. The first two characters of the network jack's name are the network type symbols.

Network type symbol:

en: stands for Ethernet

wl: stands for Wireless LAN (wlan)

ww: stands for wireless wide area network (wwan)

Select symbols based on device type or location:

o: Indicates the integrated device (i.e. integrated network card) and Soton number external to the graphics card;

s: Indicates an independent device plugged into a hot-swappable jack;

x: represents the device named based on the MAC address; p——represents the mathematical position and number of the PCI jack.

Things to note are:

A network socket can have multiple network connections, but only one network connection can be active at the same time.

1. Modify the configuration file (not recommended)

Prerequisite:

Requires network service

Step into profile

vim/etc/NetworkManager/system-connections/ens160.nmconnection

Compile the corresponding content in the configuration file

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># vim /etc/NetworkManager/system-connections/ens160.nmconnection </span>
<span class="token punctuation">[</span>connection<span class="token punctuation">]</span>
<span class="token assign-left variable">id</span><span class="token operator">=</span>ens160
<span class="token assign-left variable">uuid</span><span class="token operator">=</span>63a4d8e6-5b83-3145-b9d8-81ac17ac17cc
<span class="token assign-left variable">type</span><span class="token operator">=</span>ethernet
autoconnect-priority<span class="token operator">=</span>-999
interface-name<span class="token operator">=</span>ens160
<span class="token assign-left variable">timestamp</span><span class="token operator">=</span><span class="token number">1708402421</span>
<span class="token punctuation">[</span>ethernet<span class="token punctuation">]</span>
<span class="token punctuation">[</span>ipv4<span class="token punctuation">]</span>
<span class="token assign-left variable">address1</span><span class="token operator">=</span><span class="token number">192.168</span>.218.4/24,192.168.218.2
<span class="token assign-left variable">dns</span><span class="token operator">=</span><span class="token number">223.5</span>.5.5<span class="token punctuation">;</span>
<span class="token assign-left variable">method</span><span class="token operator">=</span>manual
<span class="token punctuation">[</span>ipv6<span class="token punctuation">]</span>
addr-gen-mode<span class="token operator">=</span>eui64
<span class="token assign-left variable">method</span><span class="token operator">=</span>auto
<span class="token punctuation">[</span>proxy<span class="token punctuation">]</span>
Copy after login

2. Use the IP command to configure a temporarily effective network connection to view the configuration information of the network card at the network layer. Add -s to display relevant statistical information, such as the number of data packets received (RX) and transmitted (TX).

ip[-s]addrshow[network card device name]

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ip addr show ens160</span>
<span class="token number">2</span>: ens160: <span class="token operator"><</span>BROADCAST,MULTICAST,UP,LOWER_UP<span class="token operator">></span> mtu <span class="token number">1500</span> qdisc mq state UP group default qlen <span class="token number">1000</span>
link/ether 00:0c:29:57:78:25 brd ff:ff:ff:ff:ff:ff
altname enp3s0
inet <span class="token number">192.168</span>.218.4/24 brd <span class="token number">192.168</span>.218.255 scope global noprefixroute ens160
 valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe57:7825/64 scope <span class="token function">link</span> noprefixroute 
 valid_lft forever preferred_lft forever
Copy after login

View the configuration information of the network card at the data link layer

ip[-s]linkshow[network card device name]

linux系统与网络管理_网络管理系统入口_网络管理系统admin

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ip link show ens160</span>
<span class="token number">2</span>: ens160: <span class="token operator"><</span>BROADCAST,MULTICAST,UP,LOWER_UP<span class="token operator">></span> mtu <span class="token number">1500</span> qdisc mq state UP mode DEFAULT group default qlen <span class="token number">1000</span>
link/ether 00:0c:29:57:78:25 brd ff:ff:ff:ff:ff:ff
altname enp3s0
Copy after login

Add or delete the temporary IPv4 address of the network card; add or delete the temporary IPv6 address of the network card

ip[-4]addradd|delIP address[/network segment width]dev network card connection name

ip-6addradd|delIP address[/network segment width]dev network card connection name

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ip addr add 192.168.218.5/24 dev ens160</span>
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ip a</span>
inet <span class="token number">192.168</span>.218.4/24 brd <span class="token number">192.168</span>.218.255 scope global noprefixroute ens160
 valid_lft forever preferred_lft forever
inet <span class="token number">192.168</span>.218.5/24 scope global secondary ens160
 valid_lft forever preferred_lft forever
Copy after login

禁用|启用指定网卡

iplinksetdev网卡的设备名down|up

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ip link set dev ens160 up</span>
Copy after login

三、nmcli命令(命令行工具)

命令界面输入“nmcli”,按下"Tab"键,输出相匹配的后续命令,输入相匹配的命令后,按下"Tab"键继续输出相匹配的后续命令。

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli </span>
agent connectiondevicegeneral <span class="token builtin class-name">help</span>monitor networkingradio
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli connection </span>
<span class="token function">add</span>delete edit <span class="token builtin class-name">help</span> load modify reload up 
clonedown <span class="token builtin class-name">export</span> <span class="token function">import</span> migratemonitorshow
Copy after login

查看网卡设备

nmclidevice

缩写:nmclid

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli device</span>
DEVICETYPESTATECONNECTION 
ens160ethernetconnectedens160 
loloopbackunmanaged-- 
Copy after login

nmclideviceshow

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli device show </span>
GENERAL.DEVICE: ens160
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:0C:29:57:78:25
GENERAL.MTU:<span class="token number">1500</span>
GENERAL.STATE:<span class="token number">100</span> <span class="token punctuation">(</span>connected<span class="token punctuation">)</span>
Copy after login

connected:已被NM管理,但是当前有活跃的connection

disconnected:已被NM管理,并且当前没有活跃的connection

unmanaged:未被NM管理

unavailable:不可用,NM难以管理,一般出现于网卡为down的时侯

查看网卡相应的会话

nmcliconnection

缩写:nmclic

nmclicshow

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli connection </span>
NAMEUUIDTYPEDEVICE 
ens16063a4d8e6-5b83-3145-b9d8-81ac17ac17ccethernetens160 
Copy after login

配置已存在会话的网卡的IP地址

非交互式:

nmclicmodify……)----非交互式的相关配置

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli connection modify ens160 ipv4.method manual ipv4.addresses 192.168.218.5/24ipv4.gateway 192.168.218.2ipv4.dns 223.5.5.5autoconnectyes</span>
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli c up ens160(重启网卡设备)</span>
Copy after login

交互式:

nmclicedit……)----交互式的相关配置

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli connection edit ens160</span>
nmcli<span class="token operator">></span> goto ipv4
nmcli ipv<span class="token operator"><span class="token file-descriptor important">4</span>></span> <span class="token builtin class-name">set</span> addresses <span class="token number">192.168</span>.168.11/24
nmcli ipv<span class="token operator"><span class="token file-descriptor important">4</span>></span> activate<span class="token punctuation">(</span>激活<span class="token punctuation">)</span>
nmcli ipv<span class="token operator"><span class="token file-descriptor important">4</span>></span> quit
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli c up ens160</span>
Copy after login

添加新的会话

nmclicaddtypeethernetcon-name会话名称ifname网卡设备ipv4.addressesIP地址ipv4.gateway网段ipv4.dnsdns服务器ipv4.methodmanualautoconnectyes

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli c add type ethernet con-name 1 ifname ens160 ipv4.addresses 192.168.218.11/24 ipv4.gateway 192.168.218.2 ipv4.dns 223.5.5.5 ipv4.method manual autoconnect yes</span>
Connection <span class="token string">&#039;1&#039;</span> <span class="token punctuation">(</span>635585a9-aed8-4327-9bf8-7fbf1565036b<span class="token punctuation">)</span> successfully added.(会话建立成功)
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># nmcli c show</span>
NAMEUUIDTYPEDEVICE 
ens16063a4d8e6-5b83-3145-b9d8-81ac17ac17ccethernetens160 
<span class="token number">1</span> 635585a9-aed8-4327-9bf8-7fbf1565036bethernet--
Copy after login

联接、断开、删除会话

联接会话

[root@tym~]#nmclicup网卡设备

断掉会话

[root@tym~]#nmclicdown网卡设备

删掉会话

[root@tym~]#nmclicdelete网卡设备

四、nmtui(图形界面工具)

nmtui(命令行回车后linux系统与网络管理,步入图形化界面)

命令回车后步入的第一页面如右图。

在这里插入图片描述

使用按键上的上下左右键可进行不同选项的选择,选项的涵义如下:

Edit a connection ----编辑一个网络连接,即可创建或修改一个网络连接
Activate a connection ----激活一个网络连接
Set system <span class="token function">hostname</span> ----设置系统的主机名
Copy after login

步入选项“Editaconnection”,创建一个新的网路联接。

在这里插入图片描述

步入选项后,我们使用鼠标左右键联通光标,选中“Add”选项,创建一个新的网路联接

在这里插入图片描述

步入“Add”选项后,我们选择“Ethernet”选项

网络管理系统入口_网络管理系统admin_linux系统与网络管理

在这里插入图片描述

选择完成网路类型后,回车步入如下页面

在这里插入图片描述

在此页面,使用上下键联通光标,我们须要将IPv4的配置模式修改为自动模式,并在虚拟机相对应的网路联接模式(桥接模式、NAT模式、Host-Only模式)下进行相应的IP地址、网关、DNS服务器等配置

在这里插入图片描述

配置完成后,使用上下键将光标联通至最下方,并选中“OK”,之后回车

在这里插入图片描述

步入选项“Activateaconnection”,激活创建的网路联接。

在这里插入图片描述

使用上下左右键选中创建的新网路联接,并将光标联通至“Deactivate”处,进行回车,如网路联接前显示“*”号,则代表该联接已激活

在这里插入图片描述

最后,回到最初的页面,选中“Quit”,并联通光标至“OK”,之后回车,完成新网路联接的创建和激活。

网络管理系统admin_linux系统与网络管理_网络管理系统入口

二、网络测试命令一、ping命令

用于测试网路的连贯性

命令格式为:

ping[选项]

选项:

<span class="token parameter variable">-c</span> 数字:用于设定本命令发出的ICMP消息包的数量,若无此选项,则会无限次发送消息包直到 用户按【Ctrl+C】组合键才终止命令。
<span class="token parameter variable">-s</span> 字节数:设置ping命令发出的消息包的大小,默认发送的测试数据大小为56字节;自动添加8字节的ICMP协议头后,显示的是64字节;再添加20字节的IP协议头,则显示的为84字节。最大设置值为65507B。
<span class="token parameter variable">-i</span> 时间间隔:设定前后两次发送ICMP消息包之间的时间间隔,无此选项时,默认时间间隔为1 秒。为了保障本机和目标主机的安全,一般不要小于0.2秒。
<span class="token parameter variable">-t</span> :设置存活时间TTL<span class="token punctuation">(</span>Time To Live<span class="token punctuation">)</span>
Copy after login

使用疗效如下:

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ping -c 2 www.baidu.com</span>
PING www.a.shifen.com <span class="token punctuation">(</span><span class="token number">120.232</span>.145.185<span class="token punctuation">)</span> <span class="token number">56</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">)</span> bytes of data.
<span class="token number">64</span> bytes from <span class="token number">120.232</span>.145.185 <span class="token punctuation">(</span><span class="token number">120.232</span>.145.185<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">1</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">128</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">35.1</span> ms
<span class="token number">64</span> bytes from <span class="token number">120.232</span>.145.185 <span class="token punctuation">(</span><span class="token number">120.232</span>.145.185<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">2</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">128</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">36.1</span> ms
--- www.a.shifen.com <span class="token function">ping</span> statistics ---
<span class="token number">2</span> packets transmitted, <span class="token number">2</span> received, <span class="token number">0</span>% packet loss, <span class="token function">time</span> 1002ms
rtt min/avg/max/mdev <span class="token operator">=</span> <span class="token number">35.093</span>/35.573/36.053/0.480 ms
Copy after login

二、tracepath命令

用于追踪并显示报文抵达目的主机所经过的路由信息

命令格式为:

tracepath[选项]

常用选项:

<span class="token parameter variable">-n</span> :对沿途各主机节点,,仅仅获取并输出IP地址,不在每个IP 地址的节点设备上通过DNS查找其主机名,以此来加快测试速度。
<span class="token parameter variable">-b</span> :对沿途各主机节点同时显示IP地址和主机名。
<span class="token parameter variable">-l</span> 包长度:设置初始的数据包的大小。
<span class="token parameter variable">-p</span> 端口号:设置UDP传输协议的端口<span class="token punctuation">(</span>缺省为33434<span class="token punctuation">)</span>。
Copy after login

网络管理系统admin_网络管理系统入口_linux系统与网络管理

使用疗效如下:

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># tracepath -b www.baidu.com</span>
 <span class="token number">1</span>?: <span class="token punctuation">[</span>LOCALHOST<span class="token punctuation">]</span>pmtu <span class="token number">1500</span>
 <span class="token number">1</span>:_gateway <span class="token punctuation">(</span><span class="token number">192.168</span>.218.2<span class="token punctuation">)</span><span class="token number">0</span>.198ms 
 <span class="token number">1</span>:_gateway <span class="token punctuation">(</span><span class="token number">192.168</span>.218.2<span class="token punctuation">)</span><span class="token number">0</span>.337ms 
 <span class="token number">2</span>:no reply
Copy after login

三、traceroute命令(Windows系统下是tracert)

该命令借助ICMP合同定位计算机和目标计算机之间的所有路由器,追踪数据包在网路上传输时的全部路径linux系统教程,它默认发送的数据包大小是40字节

命令格式为:

traceroute[选项]

常用选项:

<span class="token parameter variable">-I</span> :使用ICMP协议
Copy after login

三、通过域名来访问主机一、配置静态解析,通过/etc/hosts文件实现域名解析

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># cat /etc/hosts</span>
<span class="token number">127.0</span>.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
<span class="token number">192.168</span>.218.4 tym
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ping tym</span>
PING tym <span class="token punctuation">(</span><span class="token number">192.168</span>.218.4<span class="token punctuation">)</span> <span class="token number">56</span><span class="token punctuation">(</span><span class="token number">84</span><span class="token punctuation">)</span> bytes of data.
<span class="token number">64</span> bytes from tym <span class="token punctuation">(</span><span class="token number">192.168</span>.218.4<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">1</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">64</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">0.091</span> ms
<span class="token number">64</span> bytes from tym <span class="token punctuation">(</span><span class="token number">192.168</span>.218.4<span class="token punctuation">)</span>: <span class="token assign-left variable">icmp_seq</span><span class="token operator">=</span><span class="token number">2</span> <span class="token assign-left variable">ttl</span><span class="token operator">=</span><span class="token number">64</span> <span class="token assign-left variable">time</span><span class="token operator">=</span><span class="token number">0.083</span> ms
Copy after login

二、通过/etc/resolv.conf文件委派域名解析服务器的地址,由dns服务器做域名解析

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># vim /etc/resolv.conf </span>
<span class="token comment"># Generated by NetworkManager</span>
nameserver <span class="token number">223.5</span>.5.5
nameserver <span class="token number">192.168</span>.218.4
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># host www.baidu.com 192.168.218.4</span>
Using domain server:
Name: <span class="token number">192.168</span>.218.4
Address: <span class="token number">192.168</span>.218.4<span class="token comment">#53</span>
Aliases: 
www.baidu.com is an <span class="token builtin class-name">alias</span> <span class="token keyword">for</span> www.a.shifen.com.
www.a.shifen.com has address <span class="token number">120.232</span>.145.144
www.a.shifen.com has address <span class="token number">120.232</span>.145.185
www.a.shifen.com has IPv6 address <span class="token number">2409</span>:8c54:870:67:0:ff:b0c2:ad75
www.a.shifen.com has IPv6 address <span class="token number">2409</span>:8c54:870:34e:0:ff:b024:1916
Copy after login

四、从网站下载文件一、wget命令

用于在终端命令行里下载网路文件,中文全称为:webget

命令格式为:

wget[选项]网址

选项:

<span class="token parameter variable">-P</span> :下载到指定目录
<span class="token parameter variable">-t</span> :最大尝试次数
<span class="token parameter variable">-b</span> :后台下载模式
<span class="token parameter variable">-c</span> :断点续传
<span class="token parameter variable">-p</span> :下载页面内所有资源,包括图片、视频等
<span class="token parameter variable">-r</span> :递归下载
Copy after login

使用疗效如下:

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment">#wget http://rpmfind.net/linux/epel/8/Everything/x86_64/Packages/s/sl-5.02-1.el8.x86_64.rpm</span>
--2024-04-03 <span class="token number">21</span>:23:56--http://rpmfind.net/linux/epel/8/Everything/x86_64/Packages/s/sl-5.02-1.el8.x86_64.rpm
Resolving rpmfind.net <span class="token punctuation">(</span>rpmfind.net<span class="token punctuation">)</span><span class="token punctuation">..</span>. <span class="token number">195.220</span>.108.108
Connecting to rpmfind.net <span class="token punctuation">(</span>rpmfind.net<span class="token punctuation">)</span><span class="token operator">|</span><span class="token number">195.220</span>.108.108<span class="token operator">|</span>:80<span class="token punctuation">..</span>. connected.
HTTP request sent, awaiting response<span class="token punctuation">..</span>. <span class="token number">200</span> OK
Length: <span class="token number">16564</span> <span class="token punctuation">(</span>16K<span class="token punctuation">)</span> <span class="token punctuation">[</span>application/x-rpm<span class="token punctuation">]</span>
Saving to: ‘sl-5.02-1.el8.x86_64.rpm’
sl-5.02-1.el8.x86_64.rpm<span class="token number">100</span>%<span class="token punctuation">[</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span><span class="token operator">></span><span class="token punctuation">]</span><span class="token number">16</span>.18K<span class="token number">5</span>.77KB/s<span class="token keyword">in</span> <span class="token number">2</span>.8s
<span class="token number">2024</span>-04-03 <span class="token number">21</span>:24:02 <span class="token punctuation">(</span><span class="token number">5.77</span> KB/s<span class="token punctuation">)</span> - ‘sl-5.02-1.el8.x86_64.rpm’ saved <span class="token punctuation">[</span><span class="token number">16564</span>/16564<span class="token punctuation">]</span>
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ls</span>
anaconda-ks.cfgsl-5.02-1.el8.x86_64.rpm
Copy after login

二、curl命令

curl命令是一个网路工具,其主要作用是通过http、https、ftp等形式下载/上传文件

命令格式为:

curl网址[选项]

选项:

<span class="token parameter variable">-o</span> :指定名称
Copy after login

使用疗效如下:

<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># curl www.baidu.com -o baidu.html</span>
% Total% Received % XferdAverage Speed TimeTime TimeCurrent
 DloadUpload Total SpentLeftSpeed
<span class="token number">100</span><span class="token number">2381</span><span class="token number">100</span><span class="token number">2381</span><span class="token number">0</span> <span class="token number">0</span><span class="token number">19677</span><span class="token number">0</span> --:--:-- --:--:-- --:--:-- <span class="token number">19677</span>
<span class="token punctuation">[</span>root@tym ~<span class="token punctuation">]</span><span class="token comment"># ls</span>
anaconda-ks.cfgbaidu.htmlsl-5.02-1.el8.x86_64.rpm
Copy after login

The above is the detailed content of Analysis of Red Hat Linux9 version network management and three network connection methods of VMware virtual machines. For more information, please follow other related articles on the PHP Chinese website!

source:itcool.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template