免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2256 | 回复: 3
打印 上一主题 下一主题

[OpenBSD] [已经解决]请教一个openbsd关于策略路由的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-09 10:09 |只看该作者 |倒序浏览
弱弱的问

  openbsd 三块网卡   外网 202.202.202.202/29   em2
                                  内网 192.168.1.1/24           em1
                                  内网 192.168.2.1/24           em0

192.168.2.10/32的默认网关是  192.168.2.1
需要从192.168.2.10/32访问3.3.3.3/32 的下一跳是 192.168.2.2/32
这个如何做呢? pf ? 还是其他方法? 谢谢 。
是否也能支持到 默认网关192.168.2.1/32 但 192.168.2.10/32访问3.3.3.3/32 的 http,dns,mail 服务下一跳是 192.168.2.2/32  ,

用bgp实现的暂时就不考虑了,十分感谢 :-)

[ 本帖最后由 testab 于 2009-4-10 13:02 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-04-09 10:18 |只看该作者
http://bbs.chinaunix.net/viewthread.php?tid=1011361 [FreeBSD] Freebsd PF 做策略路由

不知道是否适合楼主?GOOGLE找到很多

论坛徽章:
0
3 [报告]
发表于 2009-04-09 10:30 |只看该作者
google上找到得很多和官网上的pf-faq 中提到的负载均衡实例和原理都是一样的.
不是我想要实现的功能。 同时感谢楼上的.

论坛徽章:
0
4 [报告]
发表于 2009-04-09 10:52 |只看该作者
难道是,我太弱了...
解决了 应该这样写...


pass out log on em0 route-to (em0 192.168.2.2) inet from 192.168.2.10   to 3.3.3.3  flags S/SA keep state



网站上写着

ROUTING
     If a packet matches a rule with a route option set, the packet filter
     will route the packet according to the type of route option.  When such a
     rule creates state, the route option is also applied to all packets
     matching the same connection.

     fastroute
           The fastroute option does a normal route lookup to find the next
           hop for the packet.

     route-to
           The route-to option routes the packet to the specified interface
           with an optional address for the next hop.  When a route-to rule
           creates state, only packets that pass in the same direction as the
           filter rule specifies will be routed in this way.  Packets passing
           in the opposite direction (replies) are not affected and are routed
           normally.

     reply-to
           The reply-to option is similar to route-to, but routes packets that
           pass in the opposite direction (replies) to the specified inter-
           face.  Opposite direction is only defined in the context of a state
           entry, and reply-to is useful only in rules that create state.  It
           can be used on systems with multiple external connections to route
           all outgoing packets of a connection through the interface the in-
           coming connection arrived through (symmetric routing enforcement).

     dup-to
           The dup-to option creates a duplicate of the packet and routes it
           like route-to.  The original packet gets routed as it normally
           would.

[ 本帖最后由 testab 于 2009-4-9 13:50 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP