centos 配置静态网卡

和黑猫之家聊聊?

[root@localhost ~]# cd /etc/sysconfig/network-scripts

[root@localhost network-scripts]# ll

总用量 252

-rw-------. 1 root root   402 8月  18 17:34 ifcfg-eth0

-rw-r--r--. 1 root root   390 8月  18 17:01 ifcfg-eth0.bak

-rw-r--r--. 1 root root   254 1月   3 2018 ifcfg-lo

lrwxrwxrwx. 1 root root    24 8月  18 17:19 ifdown -> ../../../usr/sbin/ifdown

-rwxr-xr-x. 1 root root   654 1月   3 2018 ifdown-bnep

-rwxr-xr-x. 1 root root  6569 1月   3 2018 ifdown-eth

-rwxr-xr-x. 1 root root  6190 5月  16 19:18 ifdown-ib

-rwxr-xr-x. 1 root root   781 1月   3 2018 ifdown-ippp

-rwxr-xr-x. 1 root root  4540 1月   3 2018 ifdown-ipv6

lrwxrwxrwx. 1 root root    11 8月  18 17:19 ifdown-isdn -> ifdown-ippp

-rwxr-xr-x. 1 root root  2102 1月   3 2018 ifdown-post

-rwxr-xr-x. 1 root root  1068 1月   3 2018 ifdown-ppp

-rwxr-xr-x. 1 root root   870 1月   3 2018 ifdown-routes

-rwxr-xr-x. 1 root root  1456 1月   3 2018 ifdown-sit

-rwxr-xr-x. 1 root root  1621 3月  18 2017 ifdown-Team

-rwxr-xr-x. 1 root root  1556 3月  18 2017 ifdown-TeamPort

-rwxr-xr-x. 1 root root  1462 1月   3 2018 ifdown-tunnel

lrwxrwxrwx. 1 root root    22 8月  18 17:19 ifup -> ../../../usr/sbin/ifup

-rwxr-xr-x. 1 root root 12415 1月   3 2018 ifup-aliases

-rwxr-xr-x. 1 root root   910 1月   3 2018 ifup-bnep

-rwxr-xr-x. 1 root root 13442 1月   3 2018 ifup-eth

-rwxr-xr-x. 1 root root 10114 5月  16 19:18 ifup-ib

-rwxr-xr-x. 1 root root 12075 1月   3 2018 ifup-ippp

-rwxr-xr-x. 1 root root 11893 1月   3 2018 ifup-ipv6

lrwxrwxrwx. 1 root root     9 8月  18 17:19 ifup-isdn -> ifup-ippp

-rwxr-xr-x. 1 root root   650 1月   3 2018 ifup-plip

-rwxr-xr-x. 1 root root  1064 1月   3 2018 ifup-plusb

-rwxr-xr-x. 1 root root  4981 1月   3 2018 ifup-post

-rwxr-xr-x. 1 root root  4154 1月   3 2018 ifup-ppp

-rwxr-xr-x. 1 root root  2001 1月   3 2018 ifup-routes

-rwxr-xr-x. 1 root root  3303 1月   3 2018 ifup-sit

-rwxr-xr-x. 1 root root  1755 3月  18 2017 ifup-Team

-rwxr-xr-x. 1 root root  1876 3月  18 2017 ifup-TeamPort

-rwxr-xr-x. 1 root root  2711 1月   3 2018 ifup-tunnel

-rwxr-xr-x. 1 root root  1836 1月   3 2018 ifup-wireless

-rwxr-xr-x. 1 root root  5419 1月   3 2018 init.ipv6-global

-rw-r--r--. 1 root root 19948 1月   3 2018 network-functions

-rw-r--r--. 1 root root 31027 1月   3 2018 network-functions-ipv6

[root@localhost network-scripts]# 

Last login: Mon Aug 20 08:20:23 2018 from 218.95.37.119

[root@localhost ~]# cd /etc/sysconfig/network-scripts

[root@localhost network-scripts]# cat ifcfg-eth0

TYPE=Ethernet

BOOTPROTO=none

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=eth0

UUID=8b29d00d-5b30-4b2e-9430-3d78acca0b8b

DEVICE=eth0

ONBOOT=yes

DNS1=202.101.224.68

IPADDR=218.95.37.118

PREFIX=26

GATEWAY=218.95.37.65

DNS2=202.101.226.69

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_PRIVACY=no

ZONE=public


更多精彩内容,请关注黑猫之家

来黑猫之家看看呗

Copyright © 2021-2023 | 个人技术展示 |赣ICP备18005425号-1 | 赣公网安备36070202000869 |