{"id":178,"date":"2018-01-11T14:48:30","date_gmt":"2018-01-11T14:48:30","guid":{"rendered":"http:\/\/www.beer.org\/blog\/?p=178"},"modified":"2018-01-11T14:51:31","modified_gmt":"2018-01-11T14:51:31","slug":"linux-add-a-usb-network-interface-to-a-bridge","status":"publish","type":"post","link":"https:\/\/www.beer.org\/blog\/index.php\/2018\/01\/11\/linux-add-a-usb-network-interface-to-a-bridge\/","title":{"rendered":"Linux: add a USB network interface to a bridge"},"content":{"rendered":"<p>I have some Raspberry Pi0Ws that I&#8217;m connecting to a LAN via the USB gadget network driver on a Raspberry Pi3.\u00a0 The problem I encountered was that the usb[0-3] interfaces weren&#8217;t showing up when the Pi3 booted because the Pi0w&#8217;s booted later.\u00a0 Only &#8216;eth0&#8217; appeared on &#8216;br0&#8217;.<\/p>\n<p>You need to make sure to add the usb[0-3] interfaces to the Bridge when the Pi0w&#8217;s boot.\u00a0 This also works if Pi0W&#8217;s are plugged in after the Pi3 is already booted.\u00a0 A simple change to \/etc\/network\/interfaces is all it took to make this happen:<\/p>\n<blockquote><p>auto br0<br \/>\niface br0 inet dhcp<br \/>\nbridge_ports eth0 usb0 usb1 usb2 usb3<br \/>\nbridge_stp off<br \/>\nbridge_fd 0<br \/>\nbridge_waitport 0<\/p>\n<p>allow-hotplug usb0<br \/>\nallow-hotplug usb1<br \/>\nallow-hotplug usb2<br \/>\nallow-hotplug usb3<\/p>\n<p>auto usb0<br \/>\niface usb0 inet static<br \/>\naddress 10.0.0.1<br \/>\nnetmask 255.255.255.0<br \/>\nup ifconfig usb0 up<br \/>\nup brctl addif br0 usb0<\/p>\n<p>auto usb1<br \/>\niface usb1 inet static<br \/>\naddress 10.0.0.2<br \/>\nnetmask 255.255.255.0<br \/>\nup ifconfig usb1 up<br \/>\nup brctl addif br0 usb1<\/p>\n<p>auto usb2<br \/>\niface usb2 inet static<br \/>\naddress 10.0.0.3<br \/>\nnetmask 255.255.255.0<br \/>\nup ifconfig usb2 up<br \/>\nup brctl addif br0 usb2<\/p>\n<p>auto usb3<br \/>\niface usb3 inet static<br \/>\naddress 10.0.0.4<br \/>\nnetmask 255.255.255.0<br \/>\nup ifconfig usb3 up<br \/>\nup brctl addif br0 usb3<\/p><\/blockquote>\n<p>Note the IP addresses on the individual usb[0-3] interfaces are irrelevant. Those are present only so I can bring the interface &#8216;up&#8217;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have some Raspberry Pi0Ws that I&#8217;m connecting to a LAN via the USB gadget network driver on a Raspberry Pi3.\u00a0 The problem I encountered was that the usb[0-3] interfaces weren&#8217;t showing up when the Pi3 booted because the Pi0w&#8217;s booted later.\u00a0 Only &#8216;eth0&#8217; appeared on &#8216;br0&#8217;. You need to make sure to add the&#8230; <a class=\"moretag\" href=\"https:\/\/www.beer.org\/blog\/index.php\/2018\/01\/11\/linux-add-a-usb-network-interface-to-a-bridge\/\">Continue reading &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-memotoself","category-tech-stuff"],"_links":{"self":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":1,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":179,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/178\/revisions\/179"}],"wp:attachment":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}