Solaris route命令
其中add代表要增加路由,net表示路由到达的是一个网络而不是一台主机,1代表远端网络需通过网关
才能到达
(直接通过网络接口相连时,该参数用0)
命令格式:
#route add -net remote_net_ip gateway_ip -netmask netmask #route add -host host_ip local_interface_ip -interface 使用"delete","change"命令参数可以对路由表中的路由信息进行删除和修改
使用"netstat –rn"命令查看当前的路由信息
过修改文件/etc/defaultrouter可以设置一些默认路由
添加了第二快网卡,系统路由表自动添加的~
另外:solaris静态路由添加命令:
route add -net 128.1.250.0 10.10.10.4 -netmask 255.255.255.0 (这个128.1.250.0网段的路由从这个10.10.10.4走)
一、 系统环境:
、 应用目的说明: 1
现在所有的应用都是192网段的服务器,现在配置sun服务器双网卡的目的是通
过sun服务器,192网段的所有服务器通过sun服务器访问172.172.172.170.
设置目的:192.192.192.3和192.192.192.151都可以ping通172.16.128(170
2、 系统网络配置:
系统现在有两块网卡:分别是hme0和eri0,打算hme0配192网段,eri0
配置172网段。
网卡配置:
bash-2.03# ifconfig -a
lo0: flags=19200849
mtu 8232 inde
x 1 inet 127.0.0.1 netmask ff000000
eri0: flags=19200843 mtu 1500 in
dex 2 inet 172.172.172.33 netmask
ffffff00 broadcast 172.16.255.255 ether 0:3:ba:29:cf:3a
hme0: lags=19200843 mtu 1500 ind
ex 3 inet 192.192.192..2 netmask ffffff00 broadcast 192.192.192..255
ether 0:3:ba:29:cf:3a
bash-2.03#
3、 系统路由表配置:
路由配置:
bash-2.03# netstat -nr Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.192.192..0 192.192.192..2 U 1 19
hme0
172.172.172.0 172.172.172.33 U 1 192 eri0 172.172.172.0 192.192.192..2 UG 1 0 224.0.0.0 192.192.192..2 U 1 0 hme0
default 192.192.192..1 UG 1 16 127.0.0.1 127.0.0.1 UH 2 5382 lo0 bash-2.03#
说明:
默认路由:192.192.192..1(互联网线路路由)
172.172.172.33(外联172网段路由)
、 Solaris网络更改: 4
保证网络转发打开默认是关闭的:
,ndd -set /dev/ip ip_forwarding 1
#ndd -set /dev/ip ip_forward_directed_broadcasts 1
#ndd -set /dev/ip ip_forward_src_routed 1
5、 Windows客户端192.192.192..151测试:
Windows系统需要添加静态路由:
route add 172.172.172.0 mask 255.255.255.0 192.192.192..2
6、 从Windows客户端192.192.192..151测试:
C:\Documents and Settings\guyhu>ping 192.192.192..2 Reply from 192.192.192..2: bytes=32 time<1ms TTL=255
C:\Documents and Settings\guyhu>ping 172.172.172.33 Reply from 172.172.172.33: bytes=32 time<1ms TTL=255
C:\Documents and Settings\guyhu>ping 172.172.172.170 Reply from 172.172.172.170: bytes=32 time=5ms TTL=254 C:\Documents and Settings\guyhu>
7、
总结
初级经济法重点总结下载党员个人总结TXt高中句型全总结.doc高中句型全总结.doc理论力学知识点总结pdf
:
配置过程中一定要添加“,ndd -set /dev/ip ip_forwarding 1“,这个很重
要。