LoginSignup
0
0

More than 1 year has passed since last update.

久しぶりにGNS3(その9:L2トンネリング/ブリッジ)

Posted at

L2トンネリング/ブリッジ

物理的に接続されていないネットワーク間で同一セグメントを実現する。L2トンネリング(L2TP)とかL2ブリッジなどと言うらしい。参考にしたサイトは下記。

トポロジー

Topology(DHCP)2.png

  • 両端のPC1とR4(ルーター)とが同一セグメント(ネットワーク:10.0.0.0/24)
  • PC1はDHCP Client、R4はDHCP Server
  • PC1とR4とは複数のネットワーク(ここではR2-R1-R3)を通じて接続

設定

PC1は自明のため省略。

R2

L2TP(疑似回線)の設定。カプセル化方式(L2TPv3)および対象とする物理I/Fの指定。

pseudowire-class test
 encapsulation l2tpv3
 ip local interface FastEthernet0/0

カプセル化される物理I/Fには実IPアドレスをアサイン。

interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0

トンネリング対象となる物理I/FにはIPアドレスをアサインせず、上述したL2TP、カプセル化の対向となるIPアドレス、IDなどを指定する。最後のid、"1 2"と指定しているが、対向ルーターR3では、"2 1"と指定するようだ。

interface FastEthernet0/1
 no ip address
 xconnect 192.168.2.2 1 encapsulation l2tpv3 manual pw-class test
  l2tp id 1 2

スタティックルートをカプセル化する物理I/Fに設定。

ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

R3

R2とほぼ同じのため、説明省略。

pseudowire-class test
 encapsulation l2tpv3
 ip local interface FastEthernet0/0

interface FastEthernet0/0
 ip address 192.168.2.2 255.255.255.0

interface FastEthernet0/1
 no ip address
 xconnect 192.168.1.2 1 encapsulation l2tpv3 manual pw-class test
  l2tp id 2 1

ip route 0.0.0.0 0.0.0.0 FastEthernet0/0

R1

これもほぼ自明。

interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0

interface FastEthernet0/1
 ip address 192.168.2.1 255.255.255.0

R4

IPアドレスアサイン及びDHCPサーバーの設定。

ip dhcp excluded-address 10.0.0.101 10.0.0.254

ip dhcp pool TEST
   network 10.0.0.0 255.255.255.0
   default-router 10.0.0.254 

interface FastEthernet0/0
 ip address 10.0.0.254 255.255.255.0

検証

PC1からのDHCPによるIPアドレス取得

PC1とR2とのWiresharkデータ。
DHCP packetのコピー.png
R2とR1とのWiresharkデータ。
L2TP(DHCP) packetのコピー.png
L2TPヘッダ直後のデータ("ff ff ... ")が、PC1からR2へのDHCP Discoverパケットとなっていることがわかる。

PC1からのR4へのping

PC1とR2とのWiresharkデータ。
ICMP packetのコピー.png
R2とR1とのWiresharkデータ。
L2TP(ICMP) packetのコピー.png
こちらでも、L2TPヘッダ直後のデータ("c4 04 ... ")が、PC1からR2へのICMP Echo Requestのパケットとなっていることがわかる。

EOF.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0