Cisco IOS MPLS Layer 2 tunnel (AToM と L2TPv3) の設定方法

スポンサーリンク

MPLSを用いたLayer 2 tunnel技術としてAToM(Any Transport over MPLS)とL2TPv3があります。AToM(Any Transport over MPLS)とL2TPv3の設定方法についてまとめます。

概要

AToM(Any Transport over MPLS)とL2TPv3の違いをまとめると以下の通りです。

AToM L2TPv3
カプセル化オーバーヘッド 小さい 大きい
使用プロトコル MPLS 通常のIP(protocol number 115とUDP)
※ MPLSは必要ありません
接続方法 デフォルトで
MPLS neighbor間の接続を確立
※ interfaceの明示指定不要
neighborを確立するinterfaceを
明示的に指定する
必要があります

L2TPv3

設定説明

pseudowire-classというLayer 2 Tunnelに関するパラメータを定義する必要があります。l2tpv3を使用する場合は、tunnelを確立する送信元interfaceが必須設定である事に注意して下さい。

Router(config)# psedowire-class <pw_class>
Router(config-xx)# encapsulation { l2tpv3 | mpls }
Router(config-xx)# ip local interface <interface>
Router(config-xx)# ip dfbit set
Router(config-xx)# ip pmtu [ max <byte> ]
Router(config-xx)# ip tos { value <value> | reflect }
パラメータ 説明
encapsulation カプセル化方式を定義します
ip local interface Layer 2 tunnelを確立するinterfaceを定義します
ip dfbit set カプセル化する際にDF bitを付与します
ip pmtu ICMP unreachableを送信元ホストに返す事を許可します。
“ipdfbit set”と併用する事でPMTU discoveryを使う事ができます。
ip tos カプセル化する際のToSを定義する事ができます
reflectを指定した場合はカプセル化する前のToSを継承します。

以下のコマンドを使用してL2 tunnelを確立します。
なお、はトンネル両端で同じIDを使用して下さい。

Router(config-if)# xconnect <remote_addr> <vc> [ encapsulation { mpls | l2tpv3 } ] [ pw-class <pw_class> ]

動作確認

以下の環境でMPLSの動作確認を行います。なお、SW1, SW4はNM-16ESW moduleを用いてスイッチの動作をエミュレートしています。

        f0/1      e0/0.12    e0/1      e0/1    e0/0.34     f0/1
  +------+trunk     .2+------+.2      .3+------+.3     trunk+------+
  |  SW1 +------------+  R2  +----------+  R3  +------------+ SW4  |
  +------+            +------+          +------+            +------+
        192.168.12.0/24    200.200.23.0/24     192.168.34.0/24   

SW1 vlan12          R2 Loopback0      R3 Loopback0        SW4 vlan34
192,168.12.1/24     200.2.2.2/24      200.3.3.3/24        192.168.34.3/24
 [SW1]
vlan database
 vlan 12
 apply
 exit
!
interface FastEthernet0/0
 switchport mode trunk
 spanning-tree portfast
!
interface Vlan12
 ip address 192.168.0.1 255.255.255.0

 [R2]
pseudowire-class PW_CLASS
 encapsulation l2tpv3
 ip local interface Loopback0
 ip pmtu
 ip dfbit set
 ip tos reflect
!
interface Loopback0
 ip address 200.2.2.2 255.255.255.0
!
interface Ethernet0/0
 no ip address
!
interface Ethernet0/0.12
 encapsulation dot1Q 12
 xconnect 200.3.3.3 23 encapsulation l2tpv3 pw-class PW_CLASS
!
interface Ethernet0/1
 ip address 200.200.23.2 255.255.255.0
!
router rip
 version 2
 network 200.2.2.0
 network 200.200.23.0
 no auto-summary

 [R3]
pseudowire-class PW_CLASS
 encapsulation l2tpv3
 ip local interface Loopback0
 ip pmtu
 ip dfbit set
 ip tos reflect
!
interface Loopback0
 ip address 200.3.3.3 255.255.255.0
!
interface Ethernet0/0
 no ip address
!
interface Ethernet0/0.34
 encapsulation dot1Q 34
 xconnect 200.2.2.2 23 encapsulation l2tpv3 pw-class PW_CLASS
!
interface Ethernet0/1
 ip address 200.200.23.3 255.255.255.0
!
router rip
 version 2
 network 200.2.2.0
 network 200.200.23.0
 no auto-summary

 [SW4]
vlan database
 vlan 34
 apply
 exit
!
interface FastEthernet0/0
 switchport mode trunk
 spanning-tree portfast
!
interface Vlan34
 ip address 192.168.0.4 255.255.255.0

なお、設定全文は下記ファイルです。必要に応じて下記を参照下さい。

SW1
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SW1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
no spanning-tree vlan 12
!
!
!
!
!
interface FastEthernet0/0
 switchport mode trunk
 spanning-tree portfast
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan12
 ip address 192.168.0.1 255.255.255.0
!
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end
R2
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
logging buffered 4096 debugging
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
pseudowire-class PW_CLASS
 encapsulation l2tpv3
 ip local interface Loopback0
 ip pmtu
 ip dfbit set
 ip tos reflect
!
!
!
!
interface Loopback0
 ip address 200.2.2.2 255.255.255.0
!
interface Ethernet0/0
 no ip address
 full-duplex
!
interface Ethernet0/0.12
 encapsulation dot1Q 12
 no cdp enable
 xconnect 200.3.3.3 23 encapsulation l2tpv3 pw-class PW_CLASS
!
interface Ethernet0/1
 ip address 200.200.23.2 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
!
router rip
 version 2
 network 200.2.2.0
 network 200.200.23.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end
R3
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
logging buffered 4096 debugging
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
pseudowire-class PW_CLASS
 encapsulation l2tpv3
 ip local interface Loopback0
 ip pmtu
 ip dfbit set
 ip tos reflect
!
!
!
!
interface Loopback0
 ip address 200.3.3.3 255.255.255.0
!
interface Ethernet0/0
 no ip address
 full-duplex
!
interface Ethernet0/0.34
 encapsulation dot1Q 34
 no cdp enable
 xconnect 200.2.2.2 23 encapsulation l2tpv3 pw-class PW_CLASS
!
interface Ethernet0/1
 ip address 200.200.23.3 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
!
router rip
 version 2
 network 200.3.3.0
 network 200.200.23.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end
SW4
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SW4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
no spanning-tree vlan 34
!
!
!
!
!
interface FastEthernet0/0
 switchport mode trunk
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
 no ip address
!
interface Vlan34
 ip address 192.168.0.4 255.255.255.0
!
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end

Layer 2 Tunnelが確立したかどうかは以下のコマンドで確認する事ができます。

R2#show l2tun session all

%No active L2F tunnels

L2TP Session Information Total tunnels 1 sessions 1

Session id 35782 is up, tunnel id 42451
Call serial number is 3035900000
Remote tunnel name is R3
  Internet address is 200.3.3.3
  Session is L2TP signalled
  Session state is established, time since change 00:00:35
    18 Packets sent, 0 received
    1224 Bytes sent, 0 received
  Last clearing of "show vpdn" counters never
    Receive packets dropped:
      out-of-order:             0
      total:                    0
    Send packets dropped:
      exceeded session MTU:     0
      total:                    0
  Session vcid is 23
  Session Layer 2 circuit, type is Ethernet Vlan, name is Ethernet0/0.12:12
  Circuit state is UP
    Remote session id is 27036, remote tunnel id 36816
  Session PMTU enabled, path MTU is not known
  DF bit on, ToS reflect enabled, ToS value 0, TTL value 255
  No session cookie information available
  UDP checksums are disabled
  SSS switching enabled
  Sequencing is off
  Unique ID is 6

%No active PPTP tunnels
R2#

BPDU 諸注意

BPDUに関する考察

Layer 2 Tunnelが確立すると、以下のようなBPDUの異常を表すメッセージが出力されます。

SW1#
*Mar  1 00:05:08.811: %SPANTREE-2-RECV_PVID_ERR: Received BPDU with inconsistent peer vlan id 34 on FastEthernet0/0 VLAN12.
*Mar  1 00:05:08.815: %SPANTREE-2-BLOCK_PVID_LOCAL: Blocking FastEthernet0/0 on VLAN12. Inconsistent local vlan.
SW1#

BPDUの異常を検地すると以下のようなblocking状態に遷移する事もあります。

SW1#show spanning-tree vlan 12 brief

VLAN12
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     cc02.045c.0001
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     cc02.045c.0001
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/0      128.1    128    19 BKN     0 32768 cc02.045c.0001 128.1

SW1#

これはBPDUのvlan IDが一致しないために発生した現象です。SW1 f0/0はVLAN 12のBPDUを受信する事を期待していますが、SW4が送信するのはVLAN 34のBPDUであるためです。

BPDU filter

このような現象を回避するためには、一般的には以下のようにBPDU filterを用いて回避します。

 [SW1]
interface FastEthernet0/0
 spanning-tree bpduguard enable

 [SW4]
interface FastEthernet0/0
 spanning-tree bpduguard enable

NM-16ESWはBPDU filterをサポートしていません機器では、以下のようにspanning-treeを無効化するような回避策も存在します。

 [SW1]
no spanning-tree vlan 12

 [SW4]
no spanning-tree vlan 34

SW1, SW4間で疎通可能な事を確認します。

SW1#ping 192.168.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.4, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 12/30/68 ms
SW1#

AToM

必須設定

AToMを使用するためにはMPLSによるルーティングを行う必要があります
MPLSの設定については省略します。

以下のコマンドを使用してL2 tunnelを確立します。AToMの場合はencapsulationにmplsを指定します。pw-classは詳細設定が可能なオプションですが、AToMの場合は省略しても問題ありません。l2tpv3と異なり、tunnelを確立する送信元intefaceとしてmpls router-idが自動的に選出されます。

Router(config-if)# xconnect <remote_addr> <vc> [ encapsulation { mpls | l2tpv3 } ] [ pw-class <pw_class> ]

動作確認

以下のように、L2TPv3と同様の環境で考察します。なお、下記設定ファイルは、理論上の設定例です(動作確認は行っていません)。AToMをサポートし、さらにDynagen上で動作するIOSは、まだ数が少ないようです。

        f0/1      e0/0.12    e0/1      e0/1    e0/0.34     f0/1
  +------+trunk     .2+------+.2      .3+------+.3     trunk+------+
  |  SW1 +------------+  R2  +----------+  R3  +------------+ SW4  |
  +------+            +------+          +------+            +------+
        192.168.12.0/24    200.200.23.0/24     192.168.34.0/24   

SW1 vlan12          R2 Loopback0      R3 Loopback0        SW4 vlan34
192,168.12.1/24     200.2.2.2/24      200.3.3.3/24        192.168.34.3/24
 [R2]
interface Loopback0
 ip address 200.2.2.2 255.255.255.0
!
interface Ethernet0/0
 no ip address
!
interface Ethernet0/0.12
 encapsulation dot1Q 12
 xconnect 200.3.3.3 23 encapsulation mpls
!
interface Ethernet0/1
 ip address 200.200.23.2 255.255.255.0
 mpls ip
!
router rip
 version 2
 network 200.2.2.0
 network 200.200.23.0
 no auto-summary

 [R3]
interface Loopback0
 ip address 200.3.3.3 255.255.255.0
!
interface Ethernet0/0
 no ip address
!
interface Ethernet0/0.34
 encapsulation dot1Q 34
 xconnect 200.2.2.2 23 encapsulation mpls
!
interface Ethernet0/1
 ip address 200.200.23.3 255.255.255.0
 mpls ip
!
router rip
 version 2
 network 200.2.2.0
 network 200.200.23.0
 no auto-summary

 [SW4]
vlan database
 vlan 34
 apply
 exit
!
interface FastEthernet0/0
 switchport mode trunk
 spanning-tree portfast
!
interface Vlan34
 ip address 192.168.0.4 255.255.255.0

L2TPv3の違いは、mpls neighborを確立する必要がある事と、pw-classを用いた明示的なsource interface指定が不要である事です。

タイトルとURLをコピーしました