配置网络
1、为网卡添加一个会话static,在此会话配置ip地址为x.x.x.123
2、测试网络连通性,看是否能够ping通百度,并把百度首页文件下载下来
[root@localhost ~]# ping www.baidu.com -c 5
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=128 time=11.6 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=128 time=8.21 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=128 time=11.5 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=4 ttl=128 time=9.40 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=5 ttl=128 time=11.3 ms
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4008ms
rtt min/avg/max/mdev = 8.209/10.391/11.569/1.354 ms
[root@localhost ~]# mkdir baidu
[root@localhost ~]# wget -P baidu www.baidu.com
--2022-11-13 19:45:46-- http://www.baidu.com/
Resolving www.baidu.com (www.baidu.com)... 14.215.177.38, 14.215.177.39
Connecting to www.baidu.com (www.baidu.com)|14.215.177.38|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2381 (2.3K) [text/html]
Saving to: ‘baidu/index.html’
2022-11-13 19:45:46 (169 MB/s) - ‘baidu/index.html’ saved [2381/2381]
[root@localhost ~]# cd baidu
[root@localhost baidu]# ll
total 4
-rw-r--r--. 1 root root 2381 Nov 13 19:45 index.html
3、设置系统开机时,该网卡通过DHCP协议自动获取IP地址