如何操纵Openflow数据包改变IP地址?

网络工程 sdn 开放流
2022-02-08 12:54:12

我想使用 Pox 控制器更改源和目​​标的 IP 地址。是否有任何算法可以满足我的要求以及将其放置在 Pox 的什么位置?

2个回答

您正在寻找的功能是网络地址转换 (NAT),您很可能需要使用该misc.nat工具。

用法记录在nat.py此处:https ://github.com/noxrepo/pox/blob/eel/pox/misc/nat.py

e 0 - 访问控制表=0,ip,nw_src=10.0.0.0/24,nw_dst=10.0.0.0/24,actions=resubmit(,1) table=0,arp,nw_src=10.0.0.0/24,nw_dst= 10.0.0.0/24,actions=resubmit(,1) table=0,icmp,nw_src=10.0.0.1,nw_dst=30.0.0.3,actions=resubmit(,1) table=0,tcp,nw_src=10.0.0.1, nw_dst=30.0.0.3,tp_dst=80,actions=resubmit(,1) table=0,ip,nw_src=30.0.0.3,actions=resubmit(,1) table=0,priority=0,actions=drop

表 1 - NAT

表=1,ip,nw_src=10.0.0.1,nw_dst=30.0.0.3,actions=mod_nw_src=5.5.5.5,resubmit(,2) 表=1,ip,nw_src=30.0.0.3,nw_dst=5.5.5.5,actions =mod_nw_dst=10.0.0.1,resubmit(,2) table=1,priority=0,actions=resubmit(,2)

表 2 - 转发/路由

表=2,ip,nw_dst=10.0.0.1,actions=mod_dl_dst=00:00:00:00:00:01,输出:1 表=2,ip,nw_dst=10.0.0.2,actions=mod_dl_dst=00:00 :00:00:00:02,输出:2 表=2,ip,nw_dst=30.0.0.3,actions=mod_dl_dst=00:00:00:00:00:03,输出:3 优先级=0,表=2 ,arp,nw_dst=10.0.0.1,actions=output:1 优先级=0,table=2,arp,nw_dst=10.0.0.2,actions=output:2

其它你可能感兴趣的问题