找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1973|回复: 0

[其它] 各位好,请帮我改一下这道题,谢谢

[复制链接]
发表于 2006-4-14 20:37:22 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
一、我的网络现状:
1、Man=教育局城域网(电信):IP:192.168.188.253/24,Gat:192.168.188.1
2、Wan=电信固定IP:202.98.153.AA/24,Gat:202.98.153.1
3、Lan=192.168.0.0/24,Gat:192.168.0.1  (这是目的,即将以上两电信外网路由为192.168.0.0/24)

二、我是这样做的,敬请指教,谢谢!

1、宽带线路
/ip address
add address 192.168.0.1 mask 24 interface Lan
add address 192.168.188.253 mask 24 interface Man
add address 202.98.153.AA mask 24 interface Wan

2、路由
/ip route
add dst 0.0.0.0/0 gat 192.168.188.1,202.98.153.1

3、IP伪装
/ ip firewall nat
add chain=srcnat src-address=192.168.0.0/24 action=masquerade comment="" disabled=no

/ ip firewall mangle
add chain=prerouting src-address=192.168.0.0/24 protocol=tcp tcp-flags=syn \
    tcp-mss=1448 action=accept comment="" disabled=no
add chain=prerouting src-address=192.168.0.0/24 action=mark-routing \
    new-routing-mark=lan passthrough=yes comment="" disabled=no

4、自动切换脚本:
/ system script
add name="Mandown" source=":if \(\[/tool netwatch get \[/tool netwatch find comment=Wan\] status\]=\"down\"\) do {/ip route set \[/ip route find comment=Man\] gateway \[/ip address get \[/ip address find interface=Man\] network\]} else {/ip route set \[/ip route find comment=Man\] gateway 202.98.153.1}" policy=ftp,reboot,read,write,policy,test
add name="Wanup" source="/ip route set \[/ip route find comment=Wan\] gateway 202.98.153.1\n" policy=ftp,reboot,read,write,policy,test
add name="Wandown" source=":if \(\[/tool netwatch get \[/tool netwatch find comment=Man\] status\]=\"down\"\) do {/ip route set \[/ip route find comment=Wan\] gateway \[/ip address get \[/ip address find interface=Wan\] network\]} else {/ip route set \[/ip route find comment=Wan\] gateway 192.168.188.1}" policy=ftp,reboot,read,write,policy,test
add name="Manup" source="/ip route set \[/ip route find comment=Man\] gateway 192.168.188.1\n" policy=ftp,reboot,read,write,policy,test

5、监控开关
/tool netwatch
add host=202.98.153.1 timeout=1s interval=5s up-script=Wanup down-script=Wandown comment="Wan" disabled=no
add host=192.168.188.1 timeout=1s interval=5s up-script=Manup down-script=Mandown comment="Man" disabled=no
routeros
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-9-30 21:33 , Processed in 0.044644 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表