CentOS 6.5 修改網路卡配置資訊

feelpurple發表於2016-05-18
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:E7:6B:2B
TYPE=Ethernet
BOOTPROT=static
IPADDR=192.168.1.10
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=08:00:27:13:9F:DB
TYPE=Ethernet
BOOTPROT=static
IPADDR=192.168.10.10
GATEWAY=192.168.10.1
NETMASK=255.255.255.0
ONBOOT=yes

引數說明

HWADDR是網路卡的MAC地址
IPADDR是IPV4地址
NETMASK是子網掩碼
GATEWAY是閘道器

修改配置資訊後,需要重啟網路

[root@localhost mysql-cluster-gpl-7.4.11]# service network restart
Shutting down interface eth1:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth1:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/34
state: activated
Connection activated
                                                           [  OK  ]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2102804/,如需轉載,請註明出處,否則將追究法律責任。

相關文章