| 496 | |
| 497 | == Bridging eth1 to VLAN network == |
| 498 | * 基本的なコンセプトは wiki:TipAndDoc/network/vlan#BridgingVLAN の概念図を参照 |
| 499 | |
| 500 | * AG300H:/etc/config/network |
| 501 | {{{ |
| 502 | config interface 'lan' |
| 503 | option ifname 'eth0.0' |
| 504 | option proto 'static' |
| 505 | option netmask '255.255.255.0' |
| 506 | option ipaddr '192.168.0.1' |
| 507 | |
| 508 | config interface 'onu' |
| 509 | option ifname 'eth0.2 eth1' |
| 510 | option type 'bridge' |
| 511 | option proto 'none' |
| 512 | option auto '1' |
| 513 | |
| 514 | config interface 'wan' |
| 515 | option ifname 'br-onu' |
| 516 | option proto 'pppoe' |
| 517 | |
| 518 | config switch |
| 519 | option name 'eth0' |
| 520 | option reset '1' |
| 521 | option enable_vlan '1' |
| 522 | |
| 523 | config switch_vlan |
| 524 | option device 'eth0' |
| 525 | option vlan '0' |
| 526 | option ports '0 1 2 3 4' |
| 527 | |
| 528 | config switch_vlan |
| 529 | option device 'eth0' |
| 530 | option vlan '2' |
| 531 | option ports '0t 1t 2t 3t 4t' |
| 532 | }}} |
| 533 | * 以下の様なネットワークになる[[br]][[Image(br-onu-vlan-2.png,33%)]] |
| 534 | * [前述の通り、NAPTによってPPPoEに抜けるには{{{eth0}}}ではなく{{{eth0.0}}}を指定する点に注意 |
| 535 | * mitty@AG300H:~$ ifconfig |
| 536 | {{{ |
| 537 | br-onu Link encap:Ethernet HWaddr 00:24:XX:YY:ZZ:74 |
| 538 | |
| 539 | eth0 Link encap:Ethernet HWaddr 00:24:XX:YY:ZZ:74 |
| 540 | |
| 541 | eth0.0 Link encap:Ethernet HWaddr 00:24:XX:YY:ZZ:74 |
| 542 | inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 |
| 543 | |
| 544 | eth0.2 Link encap:Ethernet HWaddr 00:24:XX:YY:ZZ:74 |
| 545 | |
| 546 | eth1 Link encap:Ethernet HWaddr 00:24:XX:YY:ZZ:76 |
| 547 | |
| 548 | pppoe-wan Link encap:Point-to-Point Protocol |
| 549 | inet addr:114.159.64.161 P-t-P:118.23.8.36 Mask:255.255.255.255 |
| 550 | }}} |
| 551 | * mitty@AG300H:~$ brctl show |
| 552 | {{{ |
| 553 | bridge name bridge id STP enabled interfaces |
| 554 | br-onu 8000.0024xxyyzz74 no eth0.2 |
| 555 | eth1 |
| 556 | }}} |
| 557 | * mitty@vlan-node:~$ ifconfig |
| 558 | {{{ |
| 559 | eth0 Link encap:Ethernet HWaddr 00:16:3e:c9:70:da |
| 560 | inet addr:192.168.0.166 Bcast:192.168.0.255 Mask:255.255.255.0 |
| 561 | |
| 562 | eth0.2 Link encap:Ethernet HWaddr 00:16:3e:c9:70:da |
| 563 | inet6 addr: 2408:211:c083:6a00:a9b0:b00:786e:d38/64 Scope:Global |
| 564 | inet6 addr: 2408:211:c083:6a00:216:3eff:fec9:70da/64 Scope:Global |
| 565 | }}} |
| 566 | |
| 567 | === check connection with untagged packet == |
| 568 | * mitty@vlan-node:~$ ping 8.8.8.8 -c 2 |
| 569 | {{{ |
| 570 | PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. |
| 571 | 64 bytes from 8.8.8.8: icmp_req=1 ttl=55 time=9.06 ms |
| 572 | 64 bytes from 8.8.8.8: icmp_req=2 ttl=55 time=8.42 ms |
| 573 | |
| 574 | --- 8.8.8.8 ping statistics --- |
| 575 | 2 packets transmitted, 2 received, 0% packet loss, time 1001ms |
| 576 | rtt min/avg/max/mdev = 8.424/8.742/9.060/0.318 ms |
| 577 | }}} |
| 578 | |
| 579 | * mitty@vlan-node:~$ sudo tcpdump -e -n -i eth0 icmp or icmp6 |
| 580 | {{{ |
| 581 | 00:08:01.470667 00:16:3e:c9:70:da > 00:24:xx:yy:zz:74, ethertype IPv4 (0x0800), length 98: 192.168.0.166 > 8.8.8.8: ICMP echo request, id 543, seq 1, length 64 |
| 582 | 00:08:01.479684 00:24:xx:yy:zz:74 > 00:16:3e:c9:70:da, ethertype IPv4 (0x0800), length 98: 8.8.8.8 > 192.168.0.166: ICMP echo reply, id 543, seq 1, length 64 |
| 583 | 00:08:02.471963 00:16:3e:c9:70:da > 00:24:xx:yy:zz:74, ethertype IPv4 (0x0800), length 98: 192.168.0.166 > 8.8.8.8: ICMP echo request, id 543, seq 2, length 64 |
| 584 | 00:08:02.480355 00:24:xx:yy:zz:74 > 00:16:3e:c9:70:da, ethertype IPv4 (0x0800), length 98: 8.8.8.8 > 192.168.0.166: ICMP echo reply, id 543, seq 2, length 64 |
| 585 | }}} |
| 586 | |
| 587 | * mitty@AG300H:~$ sudo tcpdump -e -n -i eth0 icmp or icmp6 |
| 588 | {{{ |
| 589 | 00:08:01.470621 00:16:3e:c9:70:da > 00:24:xx:yy:zz:74, ethertype IPv4 (0x0800), length 98: 192.168.0.166 > 8.8.8.8: ICMP echo request, id 543, seq 1, length 64 |
| 590 | 00:08:01.479326 00:24:xx:yy:zz:74 > 00:16:3e:c9:70:da, ethertype IPv4 (0x0800), length 98: 8.8.8.8 > 192.168.0.166: ICMP echo reply, id 543, seq 1, length 64 |
| 591 | 00:08:02.471803 00:16:3e:c9:70:da > 00:24:xx:yy:zz:74, ethertype IPv4 (0x0800), length 98: 192.168.0.166 > 8.8.8.8: ICMP echo request, id 543, seq 2, length 64 |
| 592 | 00:08:02.479991 00:24:xx:yy:zz:74 > 00:16:3e:c9:70:da, ethertype IPv4 (0x0800), length 98: 8.8.8.8 > 192.168.0.166: ICMP echo reply, id 543, seq 2, length 64 |
| 593 | }}} |
| 594 | |
| 595 | === check connection with tagged packet === |
| 596 | * mitty@vlan-node:~$ ping6 flets-east.jp -c 2 |
| 597 | {{{ |
| 598 | PING flets-east.jp(2404:1a8:ff06::1) 56 data bytes |
| 599 | 64 bytes from 2404:1a8:ff06::1: icmp_seq=1 ttl=57 time=4.42 ms |
| 600 | 64 bytes from 2404:1a8:ff06::1: icmp_seq=2 ttl=57 time=4.79 ms |
| 601 | |
| 602 | --- flets-east.jp ping statistics --- |
| 603 | 2 packets transmitted, 2 received, 0% packet loss, time 1001ms |
| 604 | rtt min/avg/max/mdev = 4.425/4.611/4.798/0.198 ms |
| 605 | }}} |
| 606 | |
| 607 | * mitty@AG300H:~$ sudo tcpdump -e -n -i eth0 icmp or icmp6 |
| 608 | {{{ |
| 609 | 00:12:11.795479 00:16:3e:c9:70:da > 00:12:e2:70:52:04, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2408:211:c083:6a00:a9b0:b00:786e:d38 > 2404:1a8:ff06::1: ICMP6, echo request, seq 1, length 64 |
| 610 | 00:12:11.799675 00:12:e2:70:52:04 > 00:16:3e:c9:70:da, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2404:1a8:ff06::1 > 2408:211:c083:6a00:a9b0:b00:786e:d38: ICMP6, echo reply, seq 1, length 64 |
| 611 | 00:12:12.797123 00:16:3e:c9:70:da > 00:12:e2:70:52:04, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2408:211:c083:6a00:a9b0:b00:786e:d38 > 2404:1a8:ff06::1: ICMP6, echo request, seq 2, length 64 |
| 612 | 00:12:12.801717 00:12:e2:70:52:04 > 00:16:3e:c9:70:da, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2404:1a8:ff06::1 > 2408:211:c083:6a00:a9b0:b00:786e:d38: ICMP6, echo reply, seq 2, length 64 |
| 613 | }}} |
| 614 | |
| 615 | * mitty@vlan-node:~$ sudo tcpdump -e -n -i eth0 icmp or icmp6 |
| 616 | {{{ |
| 617 | 00:12:11.793550 00:16:3e:c9:70:da > 00:12:e2:70:52:04, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2408:211:c083:6a00:a9b0:b00:786e:d38 > 2404:1a8:ff06::1: ICMP6, echo request, seq 1, length 64 |
| 618 | 00:12:11.797929 00:12:e2:70:52:04 > 00:16:3e:c9:70:da, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2404:1a8:ff06::1 > 2408:211:c083:6a00:a9b0:b00:786e:d38: ICMP6, echo reply, seq 1, length 64 |
| 619 | 00:12:12.795197 00:16:3e:c9:70:da > 00:12:e2:70:52:04, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2408:211:c083:6a00:a9b0:b00:786e:d38 > 2404:1a8:ff06::1: ICMP6, echo request, seq 2, length 64 |
| 620 | 00:12:12.799942 00:12:e2:70:52:04 > 00:16:3e:c9:70:da, ethertype 802.1Q (0x8100), length 122: vlan 2, p 0, ethertype IPv6, 2404:1a8:ff06::1 > 2408:211:c083:6a00:a9b0:b00:786e:d38: ICMP6, echo reply, seq 2, length 64 |
| 621 | }}} |
| 622 | |
| 623 | * 期待通り、VLANを通してONU側のNTT NGN網へ抜けている |