トンネリング(仮想トンネル)
ネットワークにおいて、トンネリングとは、例えば離れた2拠点を仮想のトンネルを用いて、直接接続されているように見せかけることである。
GRE
ここでは、GRE(Generic Routing Encapsulation)をGNS3で実現する。GREについては、次のサイトの説明がわかりやすい。
- GREとは
- 
GRE Tunnel の概要 〜基礎編〜
 IPパケットに、GREヘッダが付加されたもの。トンネリングされた2拠点間でマルチキャストパケットを通すことができることが最大の特徴のような気がする。
トンネリングネットワーク

両端のネットワーク(172.16.10.0/24および172.16.20.0/24)をトンネリング(黄色)する。
ルーターの設定
次のサイトを参考に設定。
なお、PCの設定はほぼ自明のため省略。
R1
アドレス関連情報。
interface Tunnel0
 ip address 192.168.10.1 255.255.255.0
 tunnel source FastEthernet0/0
 tunnel destination 192.168.2.2
トンネリングのIPアドレス、送信先(I/F)、宛先(R2の物理IPアドレス)を設定している。
interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
interface FastEthernet0/1
 ip address 172.16.10.254 255.255.255.0
ここはほぼ自明、I/FごとのIPアドレス設定。
router eigrp 11
 network 172.16.0.0
 network 192.168.10.0
 no auto-summary
EIGRPを用いて、ルーティングの実施。
ip route 192.168.2.2 255.255.255.255 FastEthernet0/0
トンネリングの物理的な宛先となる送信先のスタティックルートを設定(R2のIPアドレス)。
ルーティング状況。
R1#show ip route
  (略)  
C    192.168.10.0/24 is directly connected, Tunnel0
     172.16.0.0/24 is subnetted, 2 subnets
D       172.16.20.0 [90/297270016] via 192.168.10.2, 00:01:49, Tunnel0
C       172.16.10.0 is directly connected, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
     192.168.2.0/32 is subnetted, 1 subnets
S       192.168.2.2 is directly connected, FastEthernet0/0
172.16.20.0/24へのルートが、EIGRP(D)によるTunnel0(R2の192.168.10.2)経由となっていることがわかる。
EIGRPトポロジー状況。
R1#show ip eigrp topology 
IP-EIGRP Topology Table for AS(11)/ID(192.168.10.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 
P 192.168.10.0/24, 1 successors, FD is 297244416
        via Connected, Tunnel0
P 172.16.20.0/24, 1 successors, FD is 297270016
        via 192.168.10.2 (297270016/281600), Tunnel0
P 172.16.10.0/24, 1 successors, FD is 281600
        via Connected, FastEthernet0/1
R2
設定内容は、R1と同じのため、説明省略。
interface Tunnel0
 ip address 192.168.10.2 255.255.255.0
 tunnel source FastEthernet0/0
 tunnel destination 192.168.1.2
interface FastEthernet0/0
 ip address 192.168.2.2 255.255.255.0
interface FastEthernet0/1
 ip address 172.16.20.254 255.255.255.0
        
router eigrp 11
 network 172.16.0.0
 network 192.168.10.0
 no auto-summary
        
ip route 192.168.1.2 255.255.255.255 FastEthernet0/0
ルーティング状況。
R2#show ip route
  (略)  
C    192.168.10.0/24 is directly connected, Tunnel0
     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.20.0 is directly connected, FastEthernet0/1
D       172.16.10.0 [90/297270016] via 192.168.10.1, 00:03:42, Tunnel0
     192.168.1.0/32 is subnetted, 1 subnets
S       192.168.1.2 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
また、こちらでも、172.16.10.0/24へのルートが、EIGRP(D)によるTunnel0(R1の192.168.10.1)経由となっていることがわかる。
EIGRPトポロジー状況。
R2#show ip eigrp 11 topology 
IP-EIGRP Topology Table for AS(11)/ID(192.168.10.2)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 
P 192.168.10.0/24, 1 successors, FD is 297244416
        via Connected, Tunnel0
P 172.16.20.0/24, 1 successors, FD is 281600
        via Connected, FastEthernet0/1
P 172.16.10.0/24, 1 successors, FD is 297270016
        via 192.168.10.1 (297270016/281600), Tunnel0
ISP
アドレス設定は下記のとおり。説明は不要であろう。
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
ルーティング情報は下記のとおり、何も設定していない。
ISP#show ip route
  (略)
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
実験
PC1からPC2へのpingの結果。
PC1> ping 172.16.20.2
84 bytes from 172.16.20.2 icmp_seq=1 ttl=62 time=60.602 ms
84 bytes from 172.16.20.2 icmp_seq=2 ttl=62 time=43.020 ms
84 bytes from 172.16.20.2 icmp_seq=3 ttl=62 time=42.873 ms
84 bytes from 172.16.20.2 icmp_seq=4 ttl=62 time=51.173 ms
84 bytes from 172.16.20.2 icmp_seq=5 ttl=62 time=49.895 ms
このときのWiresharkデータ。
- 水色枠:R1およびR2のIPアドレス
- 青枠:GREヘッダ
- 赤枠:PC1およびPC2のIPアドレス(トンネリング内)
終わりに
次はIPsecの予定。

