- 论坛徽章:
- 0
|
本帖最后由 rusty_rui 于 2010-06-25 11:25 编辑
配置1、期望使用192.168.0.57用于服务器间通信,配置过Sun Cluster的同仁对此应该不陌生。那就是使用deprecated参数:
deprecated
Marks the address as a deprecated address. Addresses
marked as deprecated will not be used as source
address for outbound packets unless either there are
no other addresses available on this interface or the
application has bound to this address explicitly. The
status display shows DEPRECATED as part of flags. See
INTERFACE FLAGS for information on the flags supported
by ifconfig.
对需要进行限制通信的接口使用此参数,使用此参数的接口地址原则上不参与主动通信,仅当没有其他可用的接口地址用于通信时才承担主动通信任务。可以使用 "-deprecated"参数取消此限制。注:使用deprecated参数的地址,被动访问还是要提供服务的。
此测试中计划使用192.168.0.57作为业务地址,那么我们需要限制ge0端口地址192.168.0.59:- root@e5kd6 # ifconfig ge0 deprecated
- [b]root@e5kd6 # ifconfig -a[/b]
- lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
- inet 127.0.0.1 netmask ff000000
- ge0: flags=1040843<UP,BROADCAST,RUNNING,MULTICAST,[b]DEPRECATED[/b],IPv4> mtu 1500 index 6
- inet 192.168.0.59 netmask ffffff00 broadcast 192.168.0.255
- ether 8:0:20:ff:1b:5c
- ge0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 6
- inet 192.168.0.57 netmask ffffff00 broadcast 192.168.0.255
- root@e5kd6 # traceroute 10.109.109.33
- traceroute: Warning: Multiple interfaces found; [b]using 192.168.0.57 @ ge0:1[/b]
- traceroute to 10.109.109.33 (10.109.109.33), 30 hops max, 40 byte packets
- 1 192.168.0.3 (192.168.0.3) 1.780 ms 0.385 ms 0.344 ms
- 2 10.109.109.33 (10.109.109.33) 0.398 ms 0.310 ms 0.308 ms
- 已经按照预定端口ge0:1进行通讯
- root@e5kd6 # netstat -rn
- Routing Table: IPv4
- Destination Gateway Flags Ref Use Interface
- -------------------- -------------------- ----- ----- ------ ---------
- 192.168.0.0 192.168.0.57 U 1 1 ge0:1
- 192.168.0.0 192.168.0.57 U 1 0 ge0
- default 192.168.0.129 UG 1 201
- 127.0.0.1 127.0.0.1 UH 101967996 lo0
复制代码 |
|