{"id":1158,"date":"2018-09-28T21:16:51","date_gmt":"2018-09-28T21:16:51","guid":{"rendered":"http:\/\/mohamede.com\/?p=1158"},"modified":"2018-09-28T21:16:51","modified_gmt":"2018-09-28T21:16:51","slug":"port-security-in-openstack","status":"publish","type":"post","link":"https:\/\/mohamede.com\/?p=1158","title":{"rendered":"Port security in Openstack"},"content":{"rendered":"<p>Openstack Neutron provides by default some protections for your VMs&#8217; communications, those protections verify that VMs can not impersonate other VMs. You can easily see how it does that by checking the flow rules in an OVS deployment using:<\/p>\n<pre>ovs-ofctl dump-flows br-int<\/pre>\n<p>If you look for a certain qvo port (or the port number, depending on the deployment), this will show the following lines<\/p>\n<pre>table=24, n_packets=1234, n_bytes=1234, priority=2,arp,in_port=\"qvo\",arp_spa=10.10.10.10 actions=resubmit(,25)\ntable=24, n_packets=1234, n_bytes=1234, priority=0 actions=drop<\/pre>\n<p>Table 24 by default will drop all the packets originated from a VM unless they are resubmitted to table 25. The criteria for submitting to table 25 is simple: That the source IP for this traffic is the one that has been assigned to that VM, if not it will drop the packet at the end of table 24<\/p>\n<p>In addition , there&#8217;s a protection from changing the MAC address of the interface, it&#8217;s implemented via the following rule<\/p>\n<pre>table=25, n_packets=1234, n_bytes=1234, priority=2,in_port=\"qvo\",dl_src=aa:aa:aa:aa:aa:aa actions=resubmit(,60)<\/pre>\n<p>which basically compares the source MAC address of the packet with the expected MAC address of the VM.<\/p>\n<p>In some use cases, you may want to drop this protection, it can be done using<\/p>\n<pre>neutron port-update $PORT_ID --port-security-enabled=false<\/pre>\n<p>This will ensure there&#8217;s no openflow rules in br-int that will drop your packets if they don&#8217;t adhere to the MAC\/IP requirements<\/p>\n<p>Good Luck !<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Openstack Neutron provides by default some protections for your VMs&#8217; communications, those protections verify that VMs can not impersonate other VMs. You can easily see how it does that by checking the flow rules in an OVS deployment using: ovs-ofctl dump-flows br-int If you look for a certain qvo port (or the port number, depending<a class=\"read-more \" href=\"https:\/\/mohamede.com\/?p=1158\" title=\"Read More\"> <span class=\"button default\">Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,10],"tags":[],"class_list":["post-1158","post","type-post","status-publish","format-standard","hentry","category-neutron","category-openstack"],"_links":{"self":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/posts\/1158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1158"}],"version-history":[{"count":0,"href":"https:\/\/mohamede.com\/index.php?rest_route=\/wp\/v2\/posts\/1158\/revisions"}],"wp:attachment":[{"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohamede.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}