{"id":2037,"date":"2018-05-26T16:32:22","date_gmt":"2018-05-26T07:32:22","guid":{"rendered":"https:\/\/blog.ymyzk.com\/?p=2037"},"modified":"2018-05-26T16:32:22","modified_gmt":"2018-05-26T07:32:22","slug":"raspbian-9-stretch-bridge-interface","status":"publish","type":"post","link":"https:\/\/blog.ymyzk.com\/2018\/05\/raspbian-9-stretch-bridge-interface\/","title":{"rendered":"Raspbian 9 stretch \u3067 bridge \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"

Raspbian 9 stretch \u3067 bridge \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u307e\u3068\u3081\u307e\u3059\uff0e<\/p>\n

<\/p>\n

\u6e96\u5099<\/h2>\n

bridge \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9 \u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b bridge-utils \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3059<\/p>\n

$ sudo apt install bridge-utils\r\n$ sudo brctl show\r\nbridge name     bridge id               STP enabled     interfaces\r\nbr0             8000.b827xxxxxxxx       no              eth0<\/code><\/pre>\n

Bridge \u306e\u8a2d\u5b9a<\/h2>\n

\/etc\/network\/interfaces<\/code> \u3067 eth0 \u3092 bridge \u306b\u8ffd\u52a0\u3057\u307e\u3059\uff0e<\/p>\n

auto br0\r\niface br0 inet manual\r\n        bridge_ports eth0<\/code><\/pre>\n

Raspbian \u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067 IP \u30a2\u30c9\u30ec\u30b9\u306e\u8a2d\u5b9a\u7b49\u3092 \/etc\/dhcpcd.conf<\/code> \u306b\u66f8\u304f\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\uff0c\u3053\u3061\u3089\u306b\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3057\u307e\u3059\uff0eeth0 \u306b\u3082\u91cd\u8907\u3057\u3066 IP \u30a2\u30c9\u30ec\u30b9\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u308b\u3053\u3068\u3092\u9632\u3050\u305f\u3081\u306b denyinterfaces<\/code> \u3092\u8a2d\u5b9a\u3057\u307e\u3059\uff0e<\/p>\n

denyinterfaces eth0\r\ninterface br0\r\n# \u4ee5\u4e0b\u5fc5\u8981\u306a\u8a2d\u5b9a\u3092\u8a18\u8ff0 \u4f8b:\r\nstatic ip_address=192.168.x.yy\/24<\/code><\/pre>\n

\u518d\u8d77\u52d5\u3057\u3066\uff0c\u6b63\u3057\u304f\u8a2d\u5b9a\u3067\u304d\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059:<\/p>\n

$ sudo brctl show\r\nbridge name     bridge id               STP enabled     interfaces\r\nbr0             8000.b827xxxxxxxx       no              eth0\r\n\r\n$ ip a\r\n1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\r\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\r\n    inet 127.0.0.1\/8 scope host lo\r\n       valid_lft forever preferred_lft forever\r\n    inet6 ::1\/128 scope host \r\n       valid_lft forever preferred_lft forever\r\n2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000\r\n    link\/ether b8:27:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff\r\n4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000\r\n    link\/ether b8:27:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff\r\n    inet 192.168.x.y\/24 brd 192.168.x.255 scope global br0\r\n       valid_lft forever preferred_lft forever<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

Raspbian 9 stretch \u3067 bridge \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u307e\u3068\u3081\u307e\u3059\uff0e<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[57,35],"_links":{"self":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/2037"}],"collection":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/comments?post=2037"}],"version-history":[{"count":2,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/2037\/revisions"}],"predecessor-version":[{"id":2039,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/2037\/revisions\/2039"}],"wp:attachment":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/media?parent=2037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/categories?post=2037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/tags?post=2037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}