1、查看网卡信息
1
2
3
4
5
6
7
8
9
10
11
12
13
|
ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link
/loopback
00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1
/8
scope host lo
inet6 ::1
/128
scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link
/ether
00:0c:29:0a:69:59 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.162
/24
brd 192.168.100.255 scope global eth0
inet6 fe80::20c:29ff:fe0a:6959
/64
scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link
/ether
00:0c:29:0a:69:63 brd ff:ff:ff:ff:ff:ff
|
2、复制配置文件,并修改DEVICE、IPADDR和HWADDR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
cd
/etc/sysconfig/network-scripts/
cp
ifcfg-eth0 ifcfg-eth1
cat
ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=c9c43a0d-439b-4855-9058-56edf186bf74
ONBOOT=
yes
NM_CONTROLLED=
yes
BOOTPROTO=none
IPADDR=192.168.100.162
PREFIX=24
GATEWAY=192.168.100.1
DEFROUTE=
yes
IPV4_FAILURE_FATAL=
yes
IPV6INIT=no
NAME=
"System eth0"
HWADDR=00:0C:29:0A:69:59
LAST_CONNECT=1446137377
vim ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
UUID=c9c43a0d-439b-4855-9058-56edf186bf74
ONBOOT=
yes
NM_CONTROLLED=
yes
BOOTPROTO=none
IPADDR=192.168.100.163
PREFIX=24
GATEWAY=192.168.100.1
DEFROUTE=
yes
IPV4_FAILURE_FATAL=
yes
IPV6INIT=no
NAME=
"System eth1"
HWADDR=00:0c:29:0a:69:63
LAST_CONNECT=1446137377
|
3、重启网络服务
1
|
service network restart
|
本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1734237,如需转载请自行联系原作者