PT
Что-то не срастается.
Size: a a a
PT
J
PT
# ovs-vsctl show
3270e9f9-1e3e-4de9-b11d-bbd7d7b49326
Bridge "ovs0"
Port "ovs0"
Interface "ovs0"
type: internal
Port "eth0"
trunks: [1, 5, 7, 111]
Interface "eth0"
Port "ovs0-vlan5"
tag: 5
Interface "ovs0-vlan5"
type: internal
Port "tapvm4"
tag: 7
Interface "tapvm4"
Bridge br-int
fail_mode: secure
Port "ovn-19f0ce-0"
Interface "ovn-19f0ce-0"
type: geneve
options: {csum="true", key=flow, remote_ip="192.168.5.50"}
PT
<interface type='ethernet'>
<mac address='ca:fc:be:9e:86:93'/>
<target dev='tapvm4'/>
<model type='virtio'/>
<alias name='net0'/>
<rom file=''/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='ethernet'>
<mac address='52:54:00:93:05:27'/>
<target dev='tapvnet42'/>
<model type='virtio'/>
<mtu size='1442'/>
<alias name='net1'/>
<rom file=''/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</interface>
PT
PT
ovs-vsctl --timeout=5 -- \
--if-exists del-port tapvnet42 \
-- add-port br-int tapvnet42 \
-- set Interface tapvnet42 "external-ids:attached-mac=\"52:54:00:93:05:27\"" \
-- set Interface tapvnet42 "external-ids:iface-id=\"ad800793-41c4-412d-b43a-bfba69b52707\"" \
-- set Interface tapvnet42 "external-ids:vm-id=\"10faf03f-9715-48d6-ba16-02712a8dc0e2\"" \
-- set Interface tapvnet42 external-ids:iface-status=active
PT
PT
switch 1fcc53e3-a78d-45f7-8f29-843f4a3a5fc1 (sw1)
port b71994c8-2719-11ea-abe6-3c07542c942f
addresses: ["52:54:00:93:05:27"]
port sw1gw-attachment
addresses: ["52:54:00:93:05:30 192.168.39.1"]
router e360a9fb-0a5b-4d2b-aa59-9528fc53210d (lr1)
port sw1gw
mac: "52:54:00:93:05:30"
networks: ["192.168.39.1/24"]
PT
# ovn-nbctl list Logical_switch_Port b71994c8-2719-11ea-abe6-3c07542c942f
_uuid : 2b3e1d19-4c0b-4340-966e-1ec6a35cb6be
addresses : ["52:54:00:93:05:27"]
dhcpv4_options : db175c1e-e528-4773-bd14-b51b8c0c7de7
dhcpv6_options : []
dynamic_addresses : []
enabled : []
external_ids : {}
name : "b71994c8-2719-11ea-abe6-3c07542c942f"
options : {}
parent_name : []
port_security : []
tag : []
tag_request : []
type : ""
up : true
PT
# ovn-nbctl list DHCP_Options
_uuid : db175c1e-e528-4773-bd14-b51b8c0c7de7
cidr : "192.168.39.0/24"
external_ids : {}
options : {lease_time="3600", mtu="1442", server_id="192.168.39.1", server_mac="52:54:00:93:05:30"}
PT
port b71994c8-2719-11ea-abe6-3c07542c942f
должен получать ip из сети 192.168.39.0/24
, но нифига не происходитPT
ovn-nbctl dhcp-options-create 192.168.39.0/24
ovn-nbctl dhcp-options-set-options db175c1e-e528-4773-bd14-b51b8c0c7de7 \
server_id=192.168.39.1 \
server_mac=52:54:00:93:05:30 \
lease_time=3600 \
mtu=1442
ovn-nbctl lr-add lr1
ovn-nbctl lrp-add lr1 sw1gw 52:54:00:93:05:30 192.168.39.1/24
ovn-nbctl -- lsp-add sw1 sw1gw-attachment \
-- set Logical_Switch_Port sw1gw-attachment \
type=router \
options:router-port=sw1gw \
addresses='"52:54:00:93:05:30 192.168.39.1"'
ovn-nbctl lsp-set-dhcpv4-options b71994c8-2719-11ea-abe6-3c07542c942f db175c1e-e528-4773-bd14-b51b8c0c7de7
PT
PT
# ovn-sbctl lflow-list 8823692e-c0c3-451f-8959-88d5059df084
Datapath: "sw1" (8823692e-c0c3-451f-8959-88d5059df084) Pipeline: ingress
table=0 (ls_in_port_sec_l2 ), priority=100 , match=(eth.src[40]), action=(drop;)
table=0 (ls_in_port_sec_l2 ), priority=100 , match=(vlan.present), action=(drop;)
table=0 (ls_in_port_sec_l2 ), priority=50 , match=(inport == "b71994c8-2719-11ea-abe6-3c07542c942f"), action=(next;)
table=0 (ls_in_port_sec_l2 ), priority=50 , match=(inport == "sw1gw-attachment"), action=(next;)
table=1 (ls_in_port_sec_ip ), priority=0 , match=(1), action=(next;)
table=2 (ls_in_port_sec_nd ), priority=0 , match=(1), action=(next;)
table=3 (ls_in_pre_acl ), priority=0 , match=(1), action=(next;)
table=4 (ls_in_pre_lb ), priority=0 , match=(1), action=(next;)
table=5 (ls_in_pre_stateful ), priority=100 , match=(reg0[0] == 1), action=(ct_next;)
table=5 (ls_in_pre_stateful ), priority=0 , match=(1), action=(next;)
table=6 (ls_in_acl ), priority=0 , match=(1), action=(next;)
table=7 (ls_in_lb ), priority=0 , match=(1), action=(next;)
table=8 (ls_in_stateful ), priority=100 , match=(reg0[1] == 1), action=(ct_commit(ct_label=0/1); next;)
table=8 (ls_in_stateful ), priority=100 , match=(reg0[2] == 1), action=(ct_lb;)
table=8 (ls_in_stateful ), priority=0 , match=(1), action=(next;)
table=9 (ls_in_arp_rsp ), priority=100 , match=(arp.tpa == 192.168.39.1 && arp.op == 1 && inport == "sw1gw-attachment"), action=(next;)
table=9 (ls_in_arp_rsp ), priority=50 , match=(arp.tpa == 192.168.39.1 && arp.op == 1), action=(eth.dst = eth.src; eth.src = 52:54:00:93:05:30; arp.op = 2; /* ARP reply */ arp.tha = arp.sha; arp.sha = 52:54:00:93:05:30; arp.tpa = arp.spa; arp.spa = 192.168.39.1; outport = inport; flags.loopback = 1; output;)
table=9 (ls_in_arp_rsp ), priority=0 , match=(1), action=(next;)
table=10(ls_in_dhcp_options ), priority=0 , match=(1), action=(next;)
table=11(ls_in_dhcp_response), priority=0 , match=(1), action=(next;)
table=12(ls_in_l2_lkup ), priority=100 , match=(eth.mcast), action=(outport = "_MC_flood"; output;)
table=12(ls_in_l2_lkup ), priority=50 , match=(eth.dst == 52:54:00:93:05:27), action=(outport = "b71994c8-2719-11ea-abe6-3c07542c942f"; output;)
table=12(ls_in_l2_lkup ), priority=50 , match=(eth.dst == 52:54:00:93:05:30), action=(outport = "sw1gw-attachment"; output;)
Datapath: "sw1" (8823692e-c0c3-451f-8959-88d5059df084) Pipeline: egress
table=0 (ls_out_pre_lb ), priority=0 , match=(1), action=(next;)
table=1 (ls_out_pre_acl ), priority=0 , match=(1), action=(next;)
table=2 (ls_out_pre_stateful), priority=100 , match=(reg0[0] == 1), action=(ct_next;)
table=2 (ls_out_pre_stateful), priority=0 , match=(1), action=(next;)
table=3 (ls_out_lb ), priority=0 , match=(1), action=(next;)
table=4 (ls_out_acl ), priority=0 , match=(1), action=(next;)
table=5 (ls_out_stateful ), priority=100 , match=(reg0[1] == 1), action=(ct_commit(ct_label=0/1); next;)
table=5 (ls_out_stateful ), priority=100 , match=(reg0[2] == 1), action=(ct_lb;)
table=5 (ls_out_stateful ), priority=0 , match=(1), action=(next;)
table=6 (ls_out_port_sec_ip ), priority=0 , match=(1), action=(next;)
table=7 (ls_out_port_sec_l2 ), priority=100 , match=(eth.mcast), action=(output;)
table=7 (ls_out_port_sec_l2 ), priority=50 , match=(outport == "b71994c8-2719-11ea-abe6-3c07542c942f"), action=(output;)
table=7 (ls_out_port_sec_l2 ), priority=50 , match=(outport == "sw1gw-attachment"), action=(output;)
S
НС
S
НС
S