添加如下语句
运行
[root@RAC1 ~]# source .bash_profile
使修改生效
目前两个节点的eth0 对应Public IP,eth1 对应Private IP,目标是eth0 与eht1 绑定bond0对应Public IP,eth3 与eth4 绑定bond1对应Private IP,具体IP地址不变。
一旦修改网卡绑定之后,RAC就不能启动,也就不能进行修改,所以我们这里先修改PUBLIC和 Private配置。修改完之后再绑定双网卡。
删除当前配置
创建bond0配置文件
写入
创建bond1配置文件
写入
修改eth0
修改eth1
修改eth2
修改eth3
添加
添加
RAC1的网卡绑定 *** 作完成
RAC2的网卡绑定 *** 作步骤与RAC1相同,注意修改对应的bond0与bond1的IP地址即可。
2016/9/12
关闭虚拟机,添加一块虚拟网卡:启动虚拟机后,此时还查看不到新加的网卡:
[root@slave2 ~]# ifconfig
[plain] view plain copy 在CODE上查看代码片派生到我的代码片
eth0 Link encap:Ethernet HWaddr08:00:27:04:05:16
inet addr:10.192.200.202 Bcast:10.192.200.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe04:516/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:321 errors:0 dropped:0 overruns:0 frame:0
TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33576 (32.7 KiB) TXbytes:5508 (5.3 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0(0.0 b)
[root@slave2 ~]#cd /etc/sysconfig/network-scripts/
[root@slave2 network-scripts]# cp ifcfg-eth0 ifcfg-eth1
[root@slave2 network-scripts]# cat /etc/udev/rules.d/70-persistent-net.rules
[plain] view plain copy 在CODE上查看代码片派生到我的代码片
# This file was automatically generated bythe /lib/udev/write_net_rules
# program, run by thepersistent-net-generator.rules rules file.
#
# You can modify it, as long as you keepeach rule on a single
# line, and change only the value of theNAME= key.
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net",ACTION=="add", DRIVERS=="?*",ATTR{address}=="08:00:27:04:05:16", ATTR{type}=="1",KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net",ACTION=="add", DRIVERS=="?*",ATTR{address}=="08:00:27:3a:ec:3c", ATTR{type}=="1", KERNEL=="eth*",NAME="eth1"
[root@slave2 network-scripts]# vi ifcfg-eth1
改下DEVICE,HWADDR,IPADDR,删除GATEWAY
修改后:
[root@slave2 network-scripts]# cat ifcfg-eth1
[plain] view plain copy 在CODE上查看代码片派生到我的代码片
DEVICE=eth1
HWADDR=08:00:27:3a:ec:3c
TYPE=Ethernet
#UUID=a4610b15-fc38-4984-875d-208599054e37
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.0.0.2
NETMASK=255.255.255.0
注意:用于内连的网卡不能设置网关,否则会连不上网。
注意:MAC地址HWADDR一定得和/etc/udev/rules.d/70-persistent-net.rules文件中的eth1保持一致,否则servicenetwork restart会报错:
Bringing up interface eth1: Device eth1 does not seem to be present,delaying initialization.
[FAILED]
[root@slave2network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface:[ OK ]
Bringing up interface eth0: Determining if ip address 10.192.200.202 isalready in use for device eth0...
[ OK ]
Bringing up interface eth1: Determining if ip address 10.0.0.2 is alreadyin use for device eth1...
[ OK ]
[root@slave2 network-scripts]# ifconfig
[plain] view plain copy 在CODE上查看代码片派生到我的代码片
eth0 Link encap:Ethernet HWaddr 08:00:27:04:05:16
inet addr:10.192.200.202 Bcast:10.192.200.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe04:516/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3303 errors:0 dropped:0 overruns:0 frame:0
TX packets:343 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:339469 (331.5 KiB) TX bytes:49274 (48.1 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:3A:EC:3C
inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe3a:ec3c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:636 (636.0 b)
loLink encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)