File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 44
44
```
45
45
- 重启网络配置:` service network restart `
46
46
47
- ## CentOS 7
47
+ ## CentOS 7.x
48
48
49
49
### 命令行下设置网络
50
50
51
51
- 查看系统下有哪些网卡:` ls /etc/sysconfig/network-scripts/ ` ,新版本不叫 eth0 这类格式了,比如我当前这个叫做:ifcfg-ens33(你的肯定跟我不一样,但是格式类似)
52
+ - 先备份:` cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33.bak `
52
53
- 编辑该文件:` vim /etc/sysconfig/network-scripts/ifcfg-ens33 ` ,改为如下信息:(IP 段自己改为自己的网络情况)
53
54
54
55
``` ini
55
56
TYPE =Ethernet
57
+ PROXY_METHOD =none
58
+ BROWSER_ONLY =no
56
59
BOOTPROTO =static
57
- IPADDR =192.168.1.126
60
+ IPADDR =192.168.0.127
58
61
NETMASK =255.255.255.0
59
- GATEWAY =192.168.1 .1
62
+ GATEWAY =192.168.0 .1
60
63
DNS1 =8.8.8.8
61
64
DNS1 =114.114.114.114
62
65
DEFROUTE =yes
@@ -71,7 +74,7 @@ IPV6_PEERROUTES=yes
71
74
IPV6_FAILURE_FATAL =no
72
75
IPV6_ADDR_GEN_MODE =stable-privacy
73
76
NAME =ens33
74
- UUID =15a16b51-0369-44d7-87b4-667f715a68df
77
+ UUID =b9f01b7d-4ebf-4d3a-a4ec-ae203425bb11
75
78
DEVICE =ens33
76
79
ONBOOT =yes
77
80
```
You can’t perform that action at this time.
0 commit comments