美文网首页
Linux网络 -- network-scripts

Linux网络 -- network-scripts

作者: HelloTech | 来源:发表于2020-11-12 15:47 被阅读0次

1、centos mini 默认不启用网卡

进入centos网络配置文件夹 /etc/sysconfig/network-scripts

[root@localhost ~]# cd /etc/sysconfig/network-scripts
[root@localhost ~]# ls
-rw-r--r--. 1 root root   282 11月 12 15:34 ifcfg-enp0s3
-rw-r--r--. 1 root root   254 8月  19 2019 ifcfg-lo
lrwxrwxrwx. 1 root root    24 11月 12 14:31 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root   654 8月  19 2019 ifdown-bnep
-rwxr-xr-x. 1 root root  6532 8月  19 2019 ifdown-eth
-rwxr-xr-x. 1 root root   781 8月  19 2019 ifdown-ippp
-rwxr-xr-x. 1 root root  4540 8月  19 2019 ifdown-ipv6
lrwxrwxrwx. 1 root root    11 11月 12 14:31 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root  2130 8月  19 2019 ifdown-post
-rwxr-xr-x. 1 root root  1068 8月  19 2019 ifdown-ppp
-rwxr-xr-x. 1 root root   870 8月  19 2019 ifdown-routes
-rwxr-xr-x. 1 root root  1456 8月  19 2019 ifdown-sit
-rwxr-xr-x. 1 root root  1621 12月  9 2018 ifdown-Team
-rwxr-xr-x. 1 root root  1556 12月  9 2018 ifdown-TeamPort
-rwxr-xr-x. 1 root root  1462 8月  19 2019 ifdown-tunnel
lrwxrwxrwx. 1 root root    22 11月 12 14:31 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12415 8月  19 2019 ifup-aliases
-rwxr-xr-x. 1 root root   910 8月  19 2019 ifup-bnep
-rwxr-xr-x. 1 root root 13574 8月  19 2019 ifup-eth
-rwxr-xr-x. 1 root root 12075 8月  19 2019 ifup-ippp
-rwxr-xr-x. 1 root root 11893 8月  19 2019 ifup-ipv6
lrwxrwxrwx. 1 root root     9 11月 12 14:31 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root   650 8月  19 2019 ifup-plip
-rwxr-xr-x. 1 root root  1064 8月  19 2019 ifup-plusb
-rwxr-xr-x. 1 root root  4997 8月  19 2019 ifup-post
-rwxr-xr-x. 1 root root  4154 8月  19 2019 ifup-ppp
-rwxr-xr-x. 1 root root  2001 8月  19 2019 ifup-routes
-rwxr-xr-x. 1 root root  3303 8月  19 2019 ifup-sit
-rwxr-xr-x. 1 root root  1755 12月  9 2018 ifup-Team
-rwxr-xr-x. 1 root root  1876 12月  9 2018 ifup-TeamPort
-rwxr-xr-x. 1 root root  2780 8月  19 2019 ifup-tunnel
-rwxr-xr-x. 1 root root  1836 8月  19 2019 ifup-wireless
-rwxr-xr-x. 1 root root  5419 8月  19 2019 init.ipv6-global
-rw-r--r--. 1 root root 20678 8月  19 2019 network-functions
-rw-r--r--. 1 root root 31027 8月  19 2019 network-functions-ipv6

修改网络配置 ONBOOT=no 改为 ONBOOT=yes

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=fbf88909-1170-4274-af83-fc6af286b9e0
DEVICE=enp0s3
ONBOOT=yes

重启网络

[root@localhost ~]# service network restart

相关文章

网友评论

      本文标题:Linux网络 -- network-scripts

      本文链接:https://www.haomeiwen.com/subject/gqjpbktx.html