冗余结构

利用3台SWX2200的基本冗余结构。使用Lua脚本进行SWX2200-24G端口的监视,当检测到断线时,自动开放别的端口以保证路径通畅。
本设定例中、把从SWX2200-24G的端口2到SWX2200-8G(1)作为主要路径、从SWX2200-24G的端口24到SWX2200-8G(2)作为备份路径使用。

RTX1200的设定例

LAN接口的设定
(使用LAN1端口)

ip lan1 address 192.168.100.1/24

DHCP的设定

dhcp service server
dhcp server rfc2131 compliant except remain-silent
dhcp scope 1 192.168.100.2-192.168.100.191/24

SWX2200的设定

switch control use lan1 on
switch select lan1:1
switch control function set port-use 24 off
switch control function set loopdetect-linkdown linkdown

Lua脚本的日程设定

schedule at 1 startup * lua /swx2200_lua_redundancy_rtx1200.lua

Lua 脚本的设定例

设定值

-- 输出的SYSLOG的等级 (info, debug, notice)
log_level = "info"

主程序

rt.command("switch select lan1:1")
rt.command("switch control function set loopdetect-linkdown linkdown")
rt.command("switch control function set port-use 24 off")

while true do
  -- SWX2200-24G port2down监视
  rt.syslogwatch("lan1:1%b(): PORT2 link down",1)
  rt.command("switch select lan1:1")
  rt.command("switch control function set port-use 24 on")
  rt.syslog(log_level,"SWX2200 switch to backup")

  -- SWX2200-24G port2up监视
  rt.syslogwatch("lan1:1%b(): PORT2 link up",1)
  rt.command("switch select lan1:1")
  rt.command("switch control function set port-use 24 off")
  rt.syslog(log_level,"SWX2200 recover from backup")
end

返回顶部Return to Top

网络相关产品

服务支持

事业绍介