打印

How do I configure the Solaris 10 as a router?

How do I configure the Solaris 10 as a router?

The whole scenario is like this

Hme0 - 10.4.133.96
Hme1 - 172.255.12.20
Internal network - 10.4.133.0
External network - 172.255.12.0
Default router set for 172.255.12.0 - is 172.255.12.3

How do I configure a Solaris 10 to become a router?
How would the host in the internal network see the Internet ?

TOP

Solaris8 双网卡配置(路由器用途)(转载)
作者:solaris小兵 来源: http://www.chinaunix.net
前言
现在有一台sun 280的服务器是192.192.192..0网段的,现在需要和172.172.172.0网段的网络通讯,现在需要在solaris上配置双网卡实现路由器的功能。


一、 系统环境:
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<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>; mtu 8232 index 1 inet 127.0.0.1 netmask ff000000

eri0: flags=19200843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 2 inet 172.172.172.33 netmask

ffffff00 broadcast 172.16.255.255        ether 0:3:ba:29:cf:3a
hme0: lags=19200843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 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网段路由)

4、 Solaris网络更改:
保证网络转发打开默认是关闭的:
#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、 总结:
配置过程中一定要添加“#ndd -set /dev/ip ip_forwarding 1“,这个很重要。

[ 本帖最后由 云杉上的蝴蝶 于 2007-8-15 19:06 编辑 ]
|-- AI by Spruce Lab -- | Discover the Info. Tech. for Personal! && Powered by Solaris & Oracle

通告:即日起启用新MSN和Mail地址:aic.lab.sif@gmail.com 原来的最多1个月后停用!

TOP

此帖已收集到主题列表

TOP


感谢一直以来您对我们的支持!
当前时区 GMT+8, 现在时间是 2008-12-5 12:51 京ICP证060528 号

Designed By 17DST