ip
Same as dl_type=0x0800.
icmp
Same as dl_type=0x0800,nw_proto=1.
tcp
Same as dl_type=0x0800,nw_proto=6.
udp
Same as dl_type=0x0800,nw_proto=17.
arp
Same as dl_type=0x0806.
rarp
Same as dl_type=0x8035.
actions: output:port controller(key=value) 送到controller作为packet-in 消息,括号内的key value pair可以是: reason=reason reason 可以是action,no_match,invalid_ttl id=controller-id 默认是0,特殊的controller会有一个16位的idmod_dl_src:mac
Sets the source Ethernet address to mac.
mod_dl_dst:mac
Sets the destination Ethernet address to mac.
mod_nw_src:ip
Sets the IPv4 source address to ip.
mod_nw_dst:ip
Sets the IPv4 destination address to ip.
mod_tp_src:port
Sets the TCP or UDP source port to port.
mod_tp_dst:port
Sets the TCP or UDP destination port to port.
4. 删除所有flowovs-ofctl del-flows ovs-switch
操作示例
sudo ovs-vsctl show sudo ovs-vsctl add-br mybridge sudo ovs-vsctl del-br mybridge sudo ovs-vsctl add-port mybridge port-name sudo ovs-vsctl del-port mybridge port-name sudo ovs-vsctl list Bridge/Port/Interface/... sudo ovs-appctl fdb/show mybridge sudo ovs-ofctl show mybridge sudo ovs-ofctl dump-flows mybridge sudo ovs-ofctl add-flow mybridge dl_src=02:a2:a2:a2:a2:a2,dl_dst=02:b2:b2:b2:b2:b2,in_port=2,dl_type=0x0800,nw_src=10.0.0.1,nw_dst=10.0.0.2,actions=output:6 sudo ovs-ofctl del-flows mybridge dl_src=02:a2:a2:a2:a2:a2,dl_dst=02:b2:b2:b2:b2:b2,in_port=2,dl_type=0x0800,nw_src=10.0.0.1,nw_dst=10.0.0.2 sudo ovs-ofctl add-flow dp0 in_port=2,actions=output:6 # This will delete all the flow entries in the flow table sudo ovs-ofctl del-flows mybridge
