首頁  >  文章  >  系統教程  >  紅帽 Linux9 版本網路管理及 VMware 虛擬機器三種網路連線方式解析

紅帽 Linux9 版本網路管理及 VMware 虛擬機器三種網路連線方式解析

PHPz
PHPz原創
2024-06-23 15:34:181136瀏覽

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

此文章以紅帽Linux9版本為例進行講解。

紅帽Linux9版本的網路管理非常全面,可在多處進行網路配置的更改,但須要注意的是,在9版本內,用戶可在配置文件內進行網路配置的更改,但係統不會執行更改的命令,而在9之前的版本可執行。

VMware虛擬機器上的三種網路連接形式

橋接模式:

透過虛擬集線器將主機上的網卡與虛擬網卡Vmnet0相聯接,橋接模式下虛擬機的網卡都與虛擬交換器Vmnet0相聯接,當虛擬機想要上網時linux系統與網絡管理linux系統好用嗎,需將虛擬機器IP位址,子網路網段,網段等配置與主機網路卡相同。

NAT模式:

透過虛擬集線器將主機上的網卡與虛擬網卡Vmnet8相聯接,NAT模式下虛擬機的DHCP伺服器連接在Vmnet8虛擬交換器上,須要注意的是,虛擬網卡Vmnet8只是作為主機與虛擬機通訊的插口,虛擬機機最終還是藉助主機網路卡進行連網。

Host-Only模式:

透過虛擬網路卡Vmnet1與虛擬交換器Vmnet1連結,進而實現虛擬機器通訊,當虛擬機器須要進行連網時,將主機連網的網路卡共用給虛擬網路卡Vmnet1,實現虛擬機器網路。

NetworkManager的特徵

NetworkManager是2004年RedHat啟動的項目,藉以才能讓Linux用戶更輕鬆地處理現代網路需求,能手動發覺網卡並配置ip位址。

NetworkManager的特徵

NM能管理各類網路:

有線網路卡、無線網路卡

動態ip、靜態ip

乙太網路、非乙太網路

化學網卡、虛擬網卡

工具齊全:

命令列、文字介面、圖形介面、web

招納天地:

管理各類網路路,有線、無線、實體、虛擬

參數豐富:

多達200多項配置參數(包括ethtool參數)

一統江湖:

RedHat系、Suse系、Debian/Ubuntu系,皆支持

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

大勢所趨:

從紅帽Linux9版本開始,只能透過NM管理網路

一、配置網路

網路插口是指網路中的電腦或網路設備與其他設備實現通訊的進出口。這兒,主要是指電腦的網路插口即網卡設備。

從紅帽Linux7版本開始引入了一種新的「一致網路設備命名」的形式為網路插口命名,該方法可以依據韌體、設備拓撲、設備類型和位置資訊分配固定的名子。網路插口的名稱的前兩個字元為網路路類型符號。

網路類型符號:

en:表示乙太網路(Ethernet)

wl:表示無線區域網路(wlan)

ww:表示無線廣域網路(wwan)

依據設備類型或位置選擇符號:

o:表示外接(onboard)於顯示卡上的整合裝置(即整合式網路卡)及索頓號;

s:表示是插在可以熱插拔的插孔上的獨立設備及索頓號;

x:表示基於MAC位址命名的裝置;p-表示PCI插孔的數學位置及編號。

須要注意的是:

一個網路插口,可以有多個網路聯接,但同一時間只能有一個網路聯接處於活動狀態。

一、修改設定檔(不建議)

前提:

須要有network服務

步入設定檔

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

在設定檔內進行對應內容的編撰

<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>

二、使用IP指令配置臨時生效的網路聯接查看網卡在網路層的配置信息,加-s表示平添顯示相關統計信息,如接收(RX)及傳送(TX)的數據包數目等

ip[-s]addrshow[網卡設備名稱]

<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

查看網卡在資料鏈結層的設定資訊

ip[-s]linkshow[網卡設備名稱]

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

新增或刪除網路卡的暫存IPv4位址;新增或刪除網路卡的暫存IPv6位址

ip[-4]addradd|delIP位址[/網段寬度]dev網卡聯接名

ip-6addradd|delIP位址[/網段寬度]dev網卡聯接名稱

<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

禁用|启用指定网卡

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>

三、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

查看网卡设备

nmclidevice

缩写:nmclid

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

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>

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 

配置已存在会话的网卡的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>

交互式:

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>

添加新的会话

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--

联接、断开、删除会话

联接会话

[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> ----设置系统的主机名

步入选项“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>

使用疗效如下:

<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

二、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>。

网络管理系统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

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

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

命令格式为:

traceroute[选项]

常用选项:

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

三、通过域名来访问主机一、配置静态解析,通过/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

二、通过/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

四、从网站下载文件一、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> :递归下载

使用疗效如下:

<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

二、curl命令

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

命令格式为:

curl网址[选项]

选项:

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

使用疗效如下:

<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

以上是紅帽 Linux9 版本網路管理及 VMware 虛擬機器三種網路連線方式解析的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn