●L2VPNは前回のConfigにちょっと足すだけ。
注意点としては、インターフェイスにIPアドレスを付与できないので単体で試験ができない。
何らかの通信相手が別に必要になる。
そこで、チュートリアルにある「Virtual PC Simulator」を使うことにする。
http://wiki.freecode.com.cn/doku.php?id=wiki:vpcs
簡単に言うとpingなどに応答するだけの仮想PCで9台分の設定ができる。
★簡単な使い方。
上記URLよりvpcs-0.16c.zipをダウンロード。
解凍したら、startup.vpcに以下を書く。#,!はコメント扱い
# PC1 1 ip 11.0.0.1 11.0.0.254 24 # PC2 2 ip 11.0.0.2 11.0.0.254 24
1番目のPCにIP:11.0.0.1/24 gw:11.0.0.254
2番目のPCにIP:11.0.0.2/24 gw:11.0.0.254
という意味になる。
正常なら↓こうなる。
VPCS 1 >show NAME IP/CIDR GATEWAY MAC LPORT RPORT PC1 11.0.0.1/24 11.0.0.254 00:50:79:66:68:00 20000 30000 PC2 11.0.0.2/24 11.0.0.254 00:50:79:66:68:01 20001 30001 PC3 0.0.0.0/0 0.0.0.0 00:50:79:66:68:02 20002 30002 PC4 0.0.0.0/0 0.0.0.0 00:50:79:66:68:03 20003 30003 PC5 0.0.0.0/0 0.0.0.0 00:50:79:66:68:04 20004 30004 PC6 0.0.0.0/0 0.0.0.0 00:50:79:66:68:05 20005 30005 PC7 0.0.0.0/0 0.0.0.0 00:50:79:66:68:06 20006 30006 PC8 0.0.0.0/0 0.0.0.0 00:50:79:66:68:07 20007 30007 PC9 0.0.0.0/0 0.0.0.0 00:50:79:66:68:08 20008 30008
これは、PC1のインターフェイスは、LPORT 20000 RPORT 30000で通信できるってことだ。
GNS3のプロジェクトに
"雲1"に仮想PC1向けに
"NIO UDP ローカルポート:30000 リモートホスト:127.0.0.1 リモートポート:20000"
"雲2"に仮想PC2向けに
"NIO UDP ローカルポート:30001 リモートホスト:127.0.0.1 リモートポート:20001"
を追加し、R1,R2のL2vpnの物理ポート(Fa1/1)と繋いであげれば良い。
うまくいくとVPCSでPC1⇒PC2のpingが通る(祝!!L2VPNの開通)
VPCS 1 >ping 11.0.0.2 11.0.0.2 icmp_seq=1 time=121.000 ms 11.0.0.2 icmp_seq=2 time=79.000 ms 11.0.0.2 icmp_seq=3 time=31.000 ms 11.0.0.2 icmp_seq=4 time=48.000 ms 11.0.0.2 icmp_seq=5 time=73.000 ms VPCS 1 >arp 00:50:79:66:68:01 11.0.0.2 VPCS 1 >2 VPCS 2 >ping 11.0.0.1 11.0.0.1 icmp_seq=1 time=258.000 ms 11.0.0.1 icmp_seq=2 time=112.000 ms 11.0.0.1 icmp_seq=3 time=46.000 ms 11.0.0.1 icmp_seq=4 time=68.000 ms 11.0.0.1 icmp_seq=5 time=80.000 ms VPCS 2 >arp 00:50:79:66:68:00 11.0.0.1
PC1側からPC2側にpingすると、ARPテーブルにPC2側のmacアドレスが見える。
●R1,R2のL2VPN(VC:123)の追加configとmpls forwarding-table
R1
R1#sh run int fa1/1 Building configuration... Current configuration : 115 bytes ! interface FastEthernet1/1 no ip address duplex auto speed auto xconnect 10.1.1.2 123 encapsulation mpls end R1#sh mpls forwarding-table Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or VC or Tunnel Id Switched interface 16 17 10.1.1.2/32 0 Fa1/0 10.3.3.3 17 Pop Label 10.1.1.3/32 0 Fa1/0 10.3.3.3 18 Pop Label 192.168.101.0/24[V] \ 0 aggregate/test 19 Pop Label 192.168.201.0/24[V] \ 0 aggregate/test2 20 No Label l2ckt(123) 2048 Fa1/1 point2point
R2
R2#sh run int fa1/1 Building configuration... Current configuration : 115 bytes ! interface FastEthernet1/1 no ip address duplex auto speed auto xconnect 10.1.1.1 123 encapsulation mpls end R2#sh mpls forwarding-table Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or VC or Tunnel Id Switched interface 16 16 10.1.1.1/32 0 Fa1/0 10.4.4.3 17 Pop Label 10.1.1.3/32 0 Fa1/0 10.4.4.3 18 Pop Label 192.168.102.0/24[V] \ 0 aggregate/test 19 Pop Label 192.168.202.0/24[V] \ 0 aggregate/test2 20 No Label l2ckt(123) 2048 Fa1/1 point2point