{"id":18114,"date":"2015-04-02T13:56:18","date_gmt":"2015-04-02T17:56:18","guid":{"rendered":"https:\/\/nuxx.net\/blog\/?p=18114"},"modified":"2015-04-17T12:34:13","modified_gmt":"2015-04-17T16:34:13","slug":"creating-a-bridge-with-a-span-port-on-openbsd-5-6","status":"publish","type":"post","link":"https:\/\/nuxx.net\/blog\/2015\/04\/02\/creating-a-bridge-with-a-span-port-on-openbsd-5-6\/","title":{"rendered":"Creating a Bridge with a Span Port on OpenBSD 5.6"},"content":{"rendered":"<p>Since <a href=\"http:\/\/openbsd.org\">OpenBSD<\/a>\u00a0moved the bridge commands into <a href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi\/OpenBSD-current\/man8\/ifconfig.8\">ifconfig(8)<\/a>\u00a0I hadn&#8217;t\u00a0been able to find quick info on creating a <a href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi\/OpenBSD-current\/man4\/bridge.4\">bridge(4)<\/a>. Presuming you&#8217;ve got some <a href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi\/OpenBSD-current\/man4\/em.4\">em(4)<\/a>\u00a0interfaces (for naming purposes) here&#8217;s\u00a0all you need to do:<\/p>\n<p style=\"padding-left: 30px;\"><code>ifconfig em0 up<\/code><br \/>\n<code>ifconfig em1 up<\/code><br \/>\n<code>ifconfig em2 up<\/code><br \/>\n<code>ifconfig bridge0 create<\/code><br \/>\n<code>ifconfig bridge0 add em0<\/code><br \/>\n<code>ifconfig bridge0 add em1<\/code><br \/>\n<code>ifconfig bridge0 addspan em2<\/code><br \/>\n<code>ifconfig bridge0 up<\/code><\/p>\n<p>This will result in <code>em0<\/code> and <code>em1<\/code> bridged together, and a copy of all frames that it sees going out to <code>em2<\/code> for monitoring.<\/p>\n<p>After this, if you want it to come up every time you boot the machine, do this:<\/p>\n<p style=\"padding-left: 30px;\">Create three files, \/etc\/hostname.em0, \/etc\/hostname.em1, and \/etc\/hostname.em2 all containing the single line:<\/p>\n<p style=\"padding-left: 60px;\"><code>up<\/code><\/p>\n<p style=\"padding-left: 30px;\">Create one file, \/etc\/hostname.bridge0, containing the following lines:<\/p>\n<p style=\"padding-left: 60px;\"><code>add em0<\/code><br \/>\n<code>add em1<\/code><br \/>\n<code>addspan em2<\/code><br \/>\n<code>up<\/code><\/p>\n<p style=\"padding-left: 30px;\">Reboot the computer and <a href=\"http:\/\/www.openbsd.org\/cgi-bin\/man.cgi\/OpenBSD-current\/man8\/netstart.8\">netstart(8)<\/a> will use these files to create the bridge for you.<\/p>\n<p>One very important point to note if using this to troubleshoot <a href=\"https:\/\/en.wikipedia.org\/wiki\/IEEE_802.1X\">802.1x<\/a>: this sort of bridge cannot be used to troubleshoot 802.1x because it does not pass <a href=\"https:\/\/en.wikipedia.org\/wiki\/Link_Layer_Discovery_Protocol\">LLDP<\/a>\u00a0frames, nor does it drop\/raise the link, which\u00a0switches commonly use as a trigger for initiating client authentication. For situations like this a tap such as the <a href=\"http:\/\/www.netoptics.com\/sites\/default\/files\/PUBTPCU3ZDU.pdf\">NetOptics TP-CU3<\/a> is much more useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since OpenBSD\u00a0moved the bridge commands into ifconfig(8)\u00a0I hadn&#8217;t\u00a0been able to find quick info on creating a bridge(4). Presuming you&#8217;ve got some em(4)\u00a0interfaces (for naming purposes)&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/nuxx.net\/blog\/2015\/04\/02\/creating-a-bridge-with-a-span-port-on-openbsd-5-6\/\">Continue reading<span class=\"screen-reader-text\">Creating a Bridge with a Span Port on OpenBSD 5.6<\/span><\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-18114","post","type-post","status-publish","format-standard","hentry","category-computers","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/18114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/comments?post=18114"}],"version-history":[{"count":5,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/18114\/revisions"}],"predecessor-version":[{"id":18142,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/18114\/revisions\/18142"}],"wp:attachment":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/media?parent=18114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/categories?post=18114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/tags?post=18114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}