centos nmtui 使用_【CentOS 7.1】配置网卡 nmtui

// ifconfig

[root@localhost network-scripts]# ifconfig

enp5s0f0: flags=4163  mtu 1500

ether 0c:c4:7a:32:06:bc  txqueuelen 1000  (Ethernet)

RX packets 2789  bytes 1502507 (1.4 MiB)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 0  bytes 0 (0.0 B)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

device memory 0xfafe0000-faffffff

enp5s0f1: flags=4163  mtu 1500

inet 118.244.212.178  netmask 255.255.255.224  broadcast 118.244.212.191

inet6 fe80::ec4:7aff:fe32:6bd  prefixlen 64  scopeid 0x20

ether 0c:c4:7a:32:06:bd  txqueuelen 1000  (Ethernet)

RX packets 202774  bytes 197210427 (188.0 MiB)

RX errors 0  dropped 4585  overruns 0  frame 0

TX packets 79864  bytes 13770643 (13.1 MiB)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

device memory 0xfaf60000-faf7ffff

lo: flags=73  mtu 65536

inet 127.0.0.1  netmask 255.0.0.0

inet6 ::1  prefixlen 128  scopeid 0x10

loop  txqueuelen 0  (Local Loopback)

RX packets 10  bytes 864 (864.0 B)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 10  bytes 864 (864.0 B)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost network-scripts]#

// network-scripts

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

[root@localhost network-scripts]# ls

ifcfg-enp5s0f0  ifdown-isdn      ifup-bnep   ifup-routes

ifcfg-enp5s0f1ifdown-postifup-ethifup-sit

ifcfg-lo        ifdown-ppp       ifup-ib     ifup-Team

ifcfg-配置_1ifdown-routesifup-ipppifup-TeamPort

ifdownifdown-sitifup-ipv6ifup-tunnel

ifdown-bnepifdown-Teamifup-isdnifup-wireless

ifdown-ethifdown-TeamPortifup-plipinit.ipv6-global

ifdown-ibifdown-tunnelifup-plusbnetwork-functions

ifdown-ippp     ifup             ifup-post   network-functions-ipv6

ifdown-ipv6ifup-aliasesifup-ppp

[root@localhost network-scripts]#

// f1

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

TYPE=Ethernet

BOOTPROTO=dhcp

DEFROUTE=yes

PEERDNS=yes

PEERROUTES=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

NAME=enp5s0f1

UUID=8c023245-5a6f-4738-975e-0c5e89b58ee5

DEVICE=enp5s0f1

ONBOOT=no

[root@localhost network-scripts]#

// 配置_1

[root@localhost network-scripts]# cat ifcfg-配置_1

TYPE=Ethernet

BOOTPROTO=none

IPADDR=118.244.212.178

PREFIX=27

GATEWAY=118.244.212.161

DNS1=202.106.196.115

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

NAME="配置 1"

UUID=dad3f4d6-ab54-49da-afeb-424be5b415d3

ONBOOT=yes

[root@localhost network-scripts]#

// yum install NetworkManager-tui

[root@localhost network-scripts]# yum install NetworkManager-tui

已加载插件:fastestmirror, langpacks

Repository base is listed more than once in the configuration

Repository updates is listed more than once in the configuration

Repository extras is listed more than once in the configuration

Repository centosplus is listed more than once in the configuration

Loading mirror speeds from cached hostfile

软件包 1:NetworkManager-tui-1.0.0-14.git20150121.b4ea599c.el7.x86_64 已安装并且是最新版本

无须任何处理

[root@localhost network-scripts]#

// nmtui edit enp5s0f0

见附件

// f0

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

TYPE=Ethernet

BOOTPROTO=dhcp

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

NAME=enp5s0f0

UUID=254dc573-bf21-40d2-8237-743497053cc9

DEVICE=enp5s0f0

ONBOOT=no

IPADDR=192.168.1.125

PREFIX=32

GATEWAY=192.168.1.1

PEERDNS=yes

PEERROUTES=yes

[root@localhost network-scripts]#

// modify

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

TYPE=Ethernet

BOOTPROTO=none

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME=enp5s0f0

UUID=254dc573-bf21-40d2-8237-743497053cc9

DEVICE=enp5s0f0

ONBOOT=yes

HWADDR=0C:C4:7A:32:06:BC

NETMASK=255.255.255.0

IPADDR=192.168.1.125

PREFIX=24

GATEWAY=192.168.1.1

[root@localhost network-scripts]#

// network restart

[root@localhost network-scripts]# /etc/init.d/network restart

Restarting network (via systemctl):                        [确定]

[root@localhost network-scripts]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值