flow1 = {
    "switch":"00:00:00:00:00:00:00:03",
    "name":"flow-mod-1",
    "cookie":"0",
    "priority":"1",
    "ether-type":"2048",
    #~ "ingress-port":"1",
    "active":"true",
    "src-ip":"10.0.0.0/16",
    "dst-ip":"10.0.0.4",
    "actions":"drop"
    }

以上代码表示,在00:00:00:00:00:00:00:03交换机中添加了一条flow,该flow规则将所有10.0.x.x到10.0.0.4的数据包drop掉。

flow的通配规则为:

10.0.0.0/0  --> 全匹配,相当于10.0.0.0
10.0.0.0/8 --> 10.x.x.x 10.0.0.0/16 --> 10.0.x.x 10.0.0.0/24 --> 10.0.0.x 10.0.0.0/32 --> 全匹配,相当于10.0.0.0

 

可以在mininet中对host更改IP做实验测试。更改IP命令为:

mininet> py h1.setIP('10.1.0.1')

 

相关文章:

  • 2021-07-27
  • 2022-02-10
  • 2021-10-09
  • 2021-11-10
  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
猜你喜欢
  • 2021-08-11
  • 2021-12-03
  • 2021-10-08
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2022-01-21
相关资源
相似解决方案