{"id":2586,"date":"2010-07-09T08:50:35","date_gmt":"2010-07-08T23:50:35","guid":{"rendered":"http:\/\/yasu2.prosou.nu\/blog\/index.php\/2010\/07\/09\/if_bridge_ipfw_dummynet\/"},"modified":"2010-07-09T08:50:35","modified_gmt":"2010-07-08T23:50:35","slug":"if_bridge_ipfw_dummynet","status":"publish","type":"post","link":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/2010\/07\/09\/2586\/","title":{"rendered":"if_bridge + ipfw + dummynet"},"content":{"rendered":"<p>\u30d1\u30b1\u30c3\u30c8\u30ed\u30b9\u3092\u610f\u56f3\u7684\u306b\u767a\u751f\u3055\u305b\u305f\u5b9f\u9a13\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u305f\u306e\u3067\u3001if_bridge + ipfw + dummynet \u3092\u3061\u3087\u3063\u3068\u3084\u3063\u3066\u307f\u305f\u3002OS \u306f\u3001FreeBSD 8.0 \u3067\u3001em0 \u3068 em1 \u3092 if_bridge \u3067\u7d50\u3076\u611f\u3058\u3002fxp0 \u304c\u3001\u3053\u306e\u30de\u30b7\u30f3\u305d\u306e\u3082\u306e\u304c\u751f\u304d\u3066\u3044\u304f\u305f\u3081\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30d5\u30a7\u30a4\u30b9\u3067\u3001\u3053\u3063\u3061\u306f\u65e2\u306b up &#038; running.<\/p>\n<p>\n\u307e\u305a\u3001em0 \u3068 em1 \u3092 up \u306b\u3057\u3066\u3001bridge \u3067\u3064\u306a\u3050\u3002<\/p>\n<pre>\nifconfig em0 up\nifconfig em1 up\nifconfig bridge0 create up addm em0 addm em1\n<\/pre>\n<p>NIS \u3068\u304b NFS \u4f7f\u3063\u3066\u306a\u3044\u30de\u30b7\u30f3\u306a\u306e\u3092\u5e78\u3044\u306b\u3001ipfw \u3068 dummynet \u306f kldload \u3067\u5165\u308c\u308b\u3002NIS\/NFS \u4f7f\u3063\u3066\u3066\u3082\u3001\u6c17\u3092\u3064\u3051\u308c\u3070\u3044\u3051\u308b\u3068\u601d\u3046\u3002<\/p>\n<pre>\nkldload ipfw\nkldload dummynet\nipfw add 100 allow ip from any to any via lo0\nipfw add 110 allow ip from any to any via fxp0\n<\/pre>\n<p>bridge \u307e\u308f\u308a\u306e sysctl \u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3044\u3044\u306e\u304b\u306a\u3002pfil_bridge \u306f 0 \u306b\u3059\u308b\u306e\u304c\u3044\u3044\u307f\u305f\u3044?<\/p>\n<pre>\nsysctl net.link.bridge.ipfw=1\nsysctl net.link.bridge.pfil_member=0\nsysctl net.link.bridge.pfil_bridge=0\n<\/pre>\n<p>\u305d\u308c\u3067\u3001pipe \u3078\u306e\u30eb\u30fc\u30eb\u3068\u3001pipe \u306e\u5b9a\u7fa9\u3002<\/p>\n<pre>\nipfw add 200 pipe 1 all from any to any recv em0 xmit em1\nipfw add 210 pipe 2 all from any to any recv em1 xmit em0\nipfw pipe 1 config delay 10ms\nipfw pipe 2 config delay 50ms\n<\/pre>\n<p>\u3053\u308c\u3067\u300160ms \u3067 ping \u304c\u5e30\u3063\u3066\u304f\u308b\u3088\u3046\u306b\u306a\u308b\u3002pfil_bridge \u3092 1 \u306b\u3057\u3066\u3001pipe X all from any to any via bridge0 \u3068\u304b\u3060\u3068\u3001delay \u3092 0 \u3067\u306a\u304f\u3057\u305f\u5834\u5408\u306b ping \u304c\u5e30\u3063\u3066\u3053\u306a\u304f\u306a\u3063\u305f\u308a\u3057\u305f\u306e\u3067\u3001recv em0 xmit em1 \u3068\u304b\u3067\u3001\u53cc\u65b9\u5411\u306b\u3064\u3044\u3066\u305d\u308c\u305e\u308c\u306e\u30d1\u30a4\u30d7\u3092\u4f5c\u3063\u3066\u3084\u308b\u306e\u304c\u3088\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3001\u3068\u601d\u3046\u3002<\/p>\n<p>\n\u3082\u3046\u3061\u3087\u3063\u3068\u9032\u3081\u3066\u3001em1\u2192em0 \u304c\u30011\/3 \u305a\u3064\u306e\u78ba\u7387\u3067\u9055\u3046\u9045\u5ef6\u306b\u306a\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u305f\u3002<\/p>\n<pre>\nipfw delete 210\nipfw add 210 prob 0.33 pipe 2 all from any to any recv em1 xmit em0\nipfw add 210 prob 0.5 pipe 3 all from any to any recv em1 xmit em1\nipfw add 210 pipe 4 all from any to any recv em1 xmit em0\nipfw pipe 2 config delay 500ms\nipfw pipe 3 config delay 1000ms\nipfw pipe 4 config delay 1500ms\n<\/pre>\n<p>\u3053\u308c\u3067\u3001ping -i 0.3 x.x.x.x \u3068\u304b\u3059\u308b\u3068\u3001\u9806\u756a\u304c\u3070\u3089\u3070\u3089\u306b\u306a\u308b\u306e\u304c\u308f\u304b\u3063\u3066\u3001\u9762\u767d\u3044\u3002\u5230\u9054\u6642\u9593\u306e\u30b8\u30c3\u30bf\u3068\u304b\u3092\u6a21\u64ec\u3059\u308b\u306e\u306b\u3044\u3044\u3067\u3059\u306d\u3002prob \u3092\u4f7f\u3063\u3066\u3001\u78ba\u7387\u3067\u30d1\u30b1\u30c3\u30c8\u3092\u843d\u3068\u3057\u305f\u308a\u3001pipe \u306e bandwidth (bw), packet loss rate (plr) \u307f\u305f\u3044\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u3046\u3068\u3001\u304b\u306a\u308a\u3044\u308d\u3093\u306a\u6027\u80fd\u691c\u8a3c\u304c\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30d1\u30b1\u30c3\u30c8\u30ed\u30b9\u3092\u610f\u56f3\u7684\u306b\u767a\u751f\u3055\u305b\u305f\u5b9f\u9a13\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u305f\u306e\u3067\u3001if_bridge + ipfw + dummynet \u3092\u3061\u3087\u3063\u3068\u3084\u3063\u3066\u307f\u305f\u3002OS \u306f\u3001FreeBSD 8.0 \u3067\u3001em0 \u3068 em1 \u3092 if_bridge  &hellip; <a href=\"https:\/\/yasu2.prosou.nu\/blog\/index.php\/2010\/07\/09\/2586\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;if_bridge + ipfw + dummynet&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[4],"tags":[],"class_list":["post-2586","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2586"}],"version-history":[{"count":0,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2586\/revisions"}],"wp:attachment":[{"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yasu2.prosou.nu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}