Linux-CentOS8精简配置版网卡

#配置精简版网卡

#配置精简版网卡
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# vi ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=static
NAME=eth1
DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.229.170
NEIMASK=255.225.225.0
GATEWAY=192.168.229.2
DNS1=114.114.114.114
#重启网卡服务
[root@localhost network-scripts]# systemctl restart NetworkManager
#让IP地址生效
[root@localhost network-scripts]# ip link set eth1 down;ip link set eth1 up
#查看IP地址生效没有
[root@localhost ~]# ip addr show eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:e4:64:80 brd ff:ff:ff:ff:ff:ff
    inet 192.168.229.170/24 brd 192.168.229.255 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fee4:6480/64 scope link 
       valid_lft forever preferred_lft forever
#要是没有生效就重启系统
[root@localhost ~]# reboot
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值