Solaris-IPMP配置
如果将 transitive-probing 设置为 true,并且没有为给定 IPMP 组配置测试地址,那么将使用传递式探测。如果将其设置为 false(缺省值),那么在任何情况下都不会使用传递式探测。
# svccfg -s svc:/network/ipmp setprop config/transitive-probing=true
# svcadm refresh svc:/network/ipmp:default
# svcprop svc:/network/ipmp | grep config/transitive-probing
删除默认路由,并添加不指定网卡的路由
route -p delete default 10.101.1.254 -ifp net0
route -p add default 10.101.1.254
netstat -rn
使用手工(manual)网络配置模式
netadm list //查看是否启用
netadm enable -p ncp DefaultFixed //如果没有启用,使用这个命令
查看现有的网卡
dladm show-phys
确认各自的mac地址
dladm show-linkprop -p mac-address
如果mac地址相同,进行一下操作
eeprom local-mac-address?=true
ipadm create-ipmp ipmp0
ipadm create-ip net2
ipadm create-ip net3
ipadm add-ipmp -i net2 -i net3 ipmp0
ipadm create-addr -T static -a 10.101.1.52/24 ipmp0/v4
如果设置active/standby模式,使用下面的命令
ipadm set-ifprop -p standby=on -m ip net3
显示与验证IPMP状态
ipadm show-addr
ipmpstat -g
GROUP GROUPNAME STATE FDT INTERFACES
ipmp0 ipmp0 ok -- net2(net3)
ipmpstat -an
ADDRESS STATE GROUP INBOUND OUTBOUND
192.168.1.10 up ipmp0 net2 net2
ipmpstat -i
INTERFACE ACTIVE GROUP FLAGS LINK PROBE STATE
net2 no ipmp0 is----- up disabled ok
net1 yes ipmp0 --mbM--- up disabled ok
Here m -> the interface is used to send and receive multicast traffic in the IPMP group
b -> the interface is used to send and receive broadcast traffic in the IPMP group
ipmpstat -tn
# ipmpstat -tn
INTERFACE MODE TESTADDR TARGETS
net2 disabled -- --
net1 disabled -- --
--------------------
查看你的网络设备
# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet up 1000 full e1000g0
net1 Ethernet unknown 0 unknown e1000g1
创建ip
# ipadm create-ip net1
# ipadm create-addr -T static -a 192.168.42.145/24 net1/v4
删除网卡
ipadm delete-ip net1
创建DHCP地址
ipadm create-addr -T dhcp net0/dhaddr
移除网络设备
To include information about removed hardware, use the -P option
# dladm show-phys -P
In the following example, the r flag for net0 indicates that the link's associated hardware (ce) has been removed. Therefore, you can also remove the link net0 and then reassign the name to a new data link.
# dladm show-phys -P
LINK DEVUCE MEDIA FLAGS
eri0 eri0 Ethernet -----
net0 ce0 Ethernet r----
# dladm delete-phys net0
拆除硬件后,dladm show-phys就看不到设备了。
——————————————————————————————
查看ip:
# ipadm show-addr
我的显示
net0/v4 192.168.1.250
如果想更改可以使用
#ipadm delete-addr net0/v4
命令删除,
#ipadm create-addr -T static -a 192.168.1.200/24 net0/v4
更改ip
如果想设置网关可以使用命令
#route -p add default 192.168.1.1
删除网关
#route delete default 192.168.1.1