频道栏目
首页 > 系统 > Linux > 正文

CentOS7联网初始化步骤教程

2018-04-16 11:29:13         来源:Yujiumin的博客  
收藏   我要投稿

1. 显示网络设备的运行状态

[root@ruijie ~]$ ip link

2. 显示网络接口的网络参数

[root@ruijie ~]$ ip addr

3. 修改网卡信息–ONBOOT

[root@ruijie ~]$ vi /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes

4. 重启网络服务

[root@ruijie ~]$ systemctl restart network

5. 检测网络连通性

[root@ruijie ~]$ ping 114.114.114.114 -c 3
PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
64 bytes from 114.114.114.114: icmp_seq=1 ttl=67 time=1.55 ms
64 bytes from 114.114.114.114: icmp_seq=2 ttl=70 time=1.47 ms
64 bytes from 114.114.114.114: icmp_seq=3 ttl=65 time=1.54 ms

--- 114.114.114.114 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.472/1.522/1.554/0.057 ms

6. 显示网络接口的网络参数-查看当前IP

[root@ruijie ~]$ ip addr

7. 修改网卡信息–IP

[root@ruijie ~]$ vi /etc/sysconfig/network-scripts/ifcfg-eth0

IPADDR=XXX.XXX.XXX.XXX
NETMASK=255.255.255.0
GATEWAY=XXX.XXX.XXX.1

8. 重启网络服务

[root@ruijie ~]$ systemctl restart network

9. 再次检测网络连通性

[root@ruijie ~]$ ping 114.114.114.114 -c 3

PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
64 bytes from 114.114.114.114: icmp_seq=1 ttl=67 time=1.55 ms
64 bytes from 114.114.114.114: icmp_seq=2 ttl=70 time=1.47 ms
64 bytes from 114.114.114.114: icmp_seq=3 ttl=65 time=1.54 ms

--- 114.114.114.114 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.472/1.522/1.554/0.057 ms

10. 检测域名解析

[root@ruijie ~]$ ping baidu.com

ping: unknown host baidu.com

11. 配置域名解析

[root@ruijie ~]$ vi /etc/resolv.conf

nameserver 114.114.114.114
nameserver 8.8.8.8

12. 再次检测域名解析

[root@ruijie ~]$ ping baidu.com -c 3

PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
64 bytes from 114.114.114.114: icmp_seq=1 ttl=67 time=1.55 ms
64 bytes from 114.114.114.114: icmp_seq=2 ttl=70 time=1.47 ms
64 bytes from 114.114.114.114: icmp_seq=3 ttl=65 time=1.54 ms

--- 114.114.114.114 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.472/1.522/1.554/0.057 ms

13. OK!!!

上一篇:linux下压缩、解压缩程序及使用命令整理
下一篇:Centos7免密码SSH双向登录教程
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站