Solaris双网卡绑定


1、查看网卡设备

-bash-3.00# dladm show-link
e1000g0         类型: 非 vlan   mtu: 1500       设备: e1000g0
e1000g1         类型: 非 vlan   mtu: 1500       设备: e1000g1

2、修改EPROM

-bash-3.00# eeprom local-mac-address?=true

3、把网卡添加到组

-bash-3.00# ifconfig e1000g0 group test
-bash-3.00# ifconfig e1000g1 group test

4、修改host文件

-bash-3.00# cat /etc/hosts
#
# Internet host table
#
127.0.0.1       localhost       loghost
::1     localhost       loghost solaris
192.168.10.2    solaris
192.168.10.3    test1
192.168.10.4    test2

5、修改netmasks文件

-bash-3.00# cat /etc/netmasks
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
#       network-number  netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
#               128.32.0.0 255.255.255.0
192.168.10.0    255.255.255.0

6、修改defaultrouter文件

-bash-3.00# cat /etc/defaultrouter
192.168.10.1

7、修改网卡配置文件

-bash-3.00# cat /etc/hostname.e1000g0
solaris netmask + broadcast + group test up addif 192.168.10.3 netmask + broadcast + deprecated -failover up
-bash-3.00# cat /etc/hostname.e1000g1
192.168.10.4 netmask + broadcast + deprecated group test -failover standby up
-bash-3.00#

8、重启网卡检查网卡状态

-bash-3.00#svcadm restart physical
-bash-3.00# ifconfig –a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.10.2 netmask ffffff00 broadcast 192.168.10.255
        groupname test
        ether 0:c:29:3d:29:60
e1000g0:1: flags=9040843 mtu 1500 index 2
        inet 192.168.10.3 netmask ffffff00 broadcast 192.168.10.255
e1000g1: flags=69040842 mtu 1500 index 3
        inet 192.168.10.4 netmask ffffff00 broadcast 192.168.10.255
        groupname test
        ether 0:c:29:3d:29:6a

9、进行网卡切换(中断主网卡)

-bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=19000802 mtu 0 index 2
        inet 0.0.0.0 netmask 0
        groupname test
        ether 0:c:29:3d:29:60
e1000g0:1: flags=19040803 mtu 1500 index 2
        inet 192.168.10.3 netmask ffffff00 broadcast 192.168.10.255
e1000g1: flags=29040842 mtu 1500 index 3
        inet 192.168.10.4 netmask ffffff00 broadcast 192.168.10.255
        groupname test
        ether 0:c:29:3d:29:6a
e1000g1:1: flags=21000843 mtu 1500 index 3
        inet 192.168.10.2 netmask ffffff00 broadcast 192.168.10.255
-bash-3.00#

09-23 07:29