UBUT ER-X路由器多WAN,故障转移/查看会话数

show load-balance watchdog  //pings 为ping的次数,fails 为失败次数
ubnt@EdgeRouter-X-5-Port:~$ show load-balance watchdog
Group G
  eth1
  status: Waiting on recovery (0/10)
  pings: 99
  fails: 99
  run fails: 0/10
  route drops: 0
  ping gateway: 223.5.5.5 - DOWN

  pppoe0
  status: OK
  pings: 98
  fails: 0
  run fails: 0/10
  route drops: 0
  ping gateway: 223.5.5.5 - REACHABLE


show load-balance config //这里pppoe0为wan1 eth1为wan2,eth1配置failover   : true
ubnt@EdgeRouter-X-5-Port:~$ show load-balance config

Group G
    Balance Local  : true
    Lock Local DNS : false
    Conntrack Flush: true
    Sticky Bits    : 0x00000000

  eth1
    table      : 201
    route-type : default
    gateway    :
    cfg_weight : 50
    failover   : true
    fo_priority: 60

  pppoe0
    table      : 202
    route-type : default
    gateway    : pppoe0
    cfg_weight : 50
    failover   : false
    fo_priority: 100



show load-balance status  //查看状态

ubnt@EdgeRouter-X-5-Port:~$ show load-balance status
Group G
    Balance Local  : true
    Lock Local DNS : false
    Conntrack Flush: true
    Sticky Bits    : 0x00000000

  interface   : eth1
  reachable   : false
  status      : inactive
  gateway     :
  route table : 201
  weight      : 0%
  fo_priority : 60
  flows
      WAN Out   : 0
      WAN In    : 0
      Local ICMP: 0
      Local DNS : 0
      Local Data: 0

  interface   : pppoe0
  reachable   : true
  status      : active
  gateway     : pppoe0
  route table : 202
  weight      : 100%
  fo_priority : 100
  flows
      WAN Out   : 2303
      WAN In    : 2
      Local ICMP: 146
      Local DNS : 0
      Local Data: 148

 这里是配置例子,可以是用命令行配置 也可以使用web页面的 config tree

load-balance {
    group G {
        exclude-local-dns disable
        flush-on-active enable
        gateway-update-interval 20
        interface eth1 {
            failover-only
            route-test {
                count {
                    failure 10
                    success 10
                }
                initial-delay 10
                interval 10
                type {
                    ping {
                        target 223.5.5.5
                    }
                }
            }
        }
        interface pppoe0 {
            route-test {
                count {
                    failure 10
                    success 10
                }
                initial-delay 10
                interval 10
                type {
                    ping {
                        target 223.5.5.5
                    }
                }
            }
        }
        lb-local enable
        lb-local-metric-change disable
    }
}

查看会话表

 show conntrack table ipv4 //查看全部会话表

show conntrack table ipv4 source 10.0.1.169   //查看指定源IP会话表

另外可以使用  sudo conntrack  -C  查看全部会话数

ubnt@EdgeRouter-X-5-Port:~$ sudo conntrack -C
325

 详细命令如下:

ubnt@EdgeRouter-X-5-Port:~$ sudo conntrack
Command line interface for the connection tracking system. Version 0.9.14
Usage: conntrack [commands] [options]

Commands:
  -L [table] [options]          List conntrack or expectation table
  -G [table] parameters         Get conntrack or expectation
  -D [table] parameters         Delete conntrack or expectation
  -I [table] parameters         Create a conntrack or expectation
  -U [table] parameters         Update a conntrack
  -E [table] [options]          Show events
  -F [table]                    Flush table
  -C [table]                    Show counter
  -S                            Show statistics

Tables: conntrack, expect

Conntrack parameters and options:
  -n, --src-nat ip                      source NAT ip
  -g, --dst-nat ip                      destination NAT ip
  -m, --mark mark                       Set mark
  -c, --secmark secmark                 Set selinux secmark
  -e, --event-mask eventmask            Event mask, eg. NEW,DESTROY
  -z, --zero                            Zero counters while listing
  -o, --output type[,...]               Output format, eg. xml

Expectation parameters and options:
  --tuple-src ip        Source address in expect tuple
  --tuple-dst ip        Destination address in expect tuple
  --mask-src ip         Source mask address
  --mask-dst ip         Destination mask address

Common parameters and options:
  -s, --orig-src ip             Source address from original direction
  -d, --orig-dst ip             Destination address from original direction
  -r, --reply-src ip            Source addres from reply direction
  -q, --reply-dst ip            Destination address from reply direction
  -p, --protonum proto          Layer 4 Protocol, eg. 'tcp'
  -f, --family proto            Layer 3 Protocol, eg. 'ipv6'
  -t, --timeout timeout         Set timeout
  -u, --status status           Set status, eg. ASSURED
  -b, --buffer-size             Netlink socket buffer size

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值