Open vswitch (mini how-to)
Версия от 07:29, 3 декабря 2014; Moiseevvi (обсуждение | вклад) (Новая страница: «OVS на ubuntu 12.04 В системе присутствует два сетевых адаптера eth1 и eth2. <code> sudo ovs-vsctl add-br br1 sudo o…»)
OVS на ubuntu 12.04
В системе присутствует два сетевых адаптера eth1 и eth2.
sudo ovs-vsctl add-br br1
sudo ovs-vsctl add-port br1 eth1
sudo ovs-vsctl add-port br1 eth2
OVS начнет бриджевать трафик между двумя портами.
Посмтореть data plane записи позволяет такая утилита
sudo ovs-dpctl dump-flows br1
269 sudo ovs-ofctl add-flow br1 "arp actions=NORMAL" 270 sudo ovs-ofctl add-flow br1 "ip actions=NORMAL" 274 sudo ovs-ofctl dump-flows br1 282 sudo ovs-ofctl del-flows br1 "ip" 283 sudo ovs-ofctl dump-flows br1 284 sudo ovs-ofctl add-flow br1 "ip tcp tp_src=22 action=normal" 285 sudo ovs-ofctl add-flow br1 "ip tcp tp_dst=22 action=normal" 293 sudo ovs-ofctl add-flow br1 "icmp action=normal"
sudo ovs-ofctl show br1 OFPT_FEATURES_REPLY (xid=0x1): ver:0x1, dpid:0000005056bf0e5e n_tables:255, n_buffers:256 features: capabilities:0xc7, actions:0xfff
3(eth1): addr:00:50:56:bf:0e:5e config: 0 state: 0 current: 1GB-FD COPPER AUTO_NEG advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG 4(eth2): addr:00:50:56:bf:46:86 config: 0 state: 0 current: 1GB-FD COPPER AUTO_NEG advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG LOCAL(br1): addr:00:50:56:bf:0e:5e config: PORT_DOWN state: LINK_DOWN
OFPT_GET_CONFIG_REPLY (xid=0x3): frags=normal miss_send_len=0
sudo ovs-ofctl del-flows br1 sudo ovs-ofctl add-flow br1 "in_port=3 action=output:4" sudo ovs-ofctl add-flow br1 "in_port=4 action=output:3" sudo ovs-ofctl dump-flows br1 NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=23.098s, table=0, n_packets=14, n_bytes=1296, in_port=3 actions=output:4 cookie=0x0, duration=12.887s, table=0, n_packets=14, n_bytes=1296, in_port=4 actions=output:3