このブログを検索

ラベル routing の投稿を表示しています。 すべての投稿を表示
ラベル routing の投稿を表示しています。 すべての投稿を表示

2015/12/26

NATの用途


こういうとき、PCは10.0.1.254をデフォルトゲートウェイにしただけでは、Vlan200のIPSecでのアクセスができない。

IPSecは対向装置と同じLANにあるかのような通信をおこなうので、
通常のルーティングによるバケツリレーのような方式とは少し異なるからだ。

こういう場合、図の下のほうにあるルーターでnatをする。

2015/10/31

natの用途

すごく基本的なことかもしれないが、
よく悩むしたぶん理解できてないので、整理のために書く。

私はnatが嫌いだ。できることならnatなどしたくない。あんなものはしないに越したことはない。

natというのは、IPアドレスを変換することである。

ユニーク(唯一で重複がないという意味)なIPアドレス同士の通信なのに、途中で送信元あるいはあて先が変更されてしまうと、誰が誰と通信しているのかわからなくなってしまう。送信者も受信者も中継者も混乱する。


ではなぜnatなどということをするのか。

一番多い目的は、privateアドレスをグローバルアドレスに変換することだろう。

家庭でインターネットを利用するような場合だ。

つまり、ルータがあって、内側(LAN側)では192.168.1.0/24などのプライベートアドレスを使用し、
外側(WAN側)には200.xxx.xxx.xxx などのグローバルアドレスが割り当てられているケース。

家にあるパソコンのIPアドレスは 192.168.1.1/24 とかになっている。

ブラウザで http://www.yahoo.co.jp/ とアドレスを指定して(わざわざURLを全部書くことはまずないだろうが)、目的のサーバ(サイト)にアクセスする。

このとき、www.yahoo.co.jp というホスト名(fqdn)はIPアドレスに変換される。
これをおこなうのがDNSサーバである。

たとえば、今 ping www.yahoo.co.jp をやってみると、

183.79.11.230 宛に通信しているのがわかる。

ちなみに私のパソコンのIPアドレスは 192.168.0.16 である。

192.168.0.16 → 183.79.11.230

という通信である。

「プライベートアドレスとグローバルアドレスは直接通信できない」
ということを聞いたことがないだろうか?

それは、事実上は正しいといえなくもないが、TCP/IPの仕組みとしては可能である。

プライベートアドレスもグローバルアドレスも関係ない。

実際に、インターネットにプライベートアドレスを送信元としたパケットを送出することはできる。

宛先にしても。

でも、そのパケットはすぐに破棄されるだろう。



「プライベートアドレスはインターネットに流してはいけない」
というのもよく聞くセリフで、これはその通りなのだが、

経緯としては、グローバルアドレスは重複しないように管理しようと決めて、
例外としてプライベートアドレスというものを作ったのである。


プライベートアドレスの範囲は決まっていて、
192.168.0.0/16
10.0.0.0/8
172.16.0.0/12

である。

さっき、yahooにpingしたときのアドレス 183.79.11.230はグローバルアドレスである。

でも、このIPアドレスをパソコンに設定しようと思えばすることはできる。


インターネットに接続しなければ、どんなIPアドレスを使用することもできる。

通信もできるかもしれない。

でも、インターネットというのはどこに誰がいるのかわからなくても通信できる仕組みで、

そのネットワークに同じIPアドレスが複数存在するとその仕組みは成立しなくなる。



話が長くなってめんどくさくなってきたのでそろそろ終わりにしよう。



natの第一の用途は、このprivate/global変換である。

これがほとんどである。


しかし、もう一つ用途がある。
私も最近ようやくわかった。


これが本題である。プライベートアドレスのことなどどうでもよかったのだ。実は。



(Network A) --- Router1 --- (Network B) --- Router2 --- (Network C)


Network Aから Network B, Network Cのいずれにもアクセスしたいとする。

すごく単純な構成だが、この要件を満たすには「ルーティング」が必要である。


Router1はNetwork A, Bと接続しているがCには接続していないので、
Cに到達するためのnext hopを設定しなければならない。

それは、Router2である。


そして、Router2にとってはAが未知のネットワークで、そこへ到達するためのnext hopは
Router1である。



では上記のような構成ではどうか。

host1はhost2へアクセスしたい。

host2はhost3へアクセスしたい。


ただし、host2のデフォルトゲートウェイはRouterA、
host3のデフォルトゲートウェイはRouterCで、変更できず、
host3にstatic routeを追加することもできない。


このときhost2に、192.168.2.0/24 → RouterB という経路を追加しても、

host3が192.168.1.0/24の経路を知らないため通信が成立しない。

host3にstatic routeを書けばいいのだが事情があって書けない。


というようなときに、natを使う。

RouterBで、192.168.1.0/24のソースアドレスを、192.168.2.0/24に接続しているI/FのIPアドレスにNATするのである。



もっと、一般化して説明したかったのだが・・・

またの機会に。


2015/02/11

OSPF over GRE over IPsec





R1#ping 192.168.2.254 repeat 100000

Type escape sequence to abort.
Sending 100000, 100-byte ICMP Echos to 192.168.2.254, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!.
Success rate is 99 percent (365/366), round-trip min/avg/max = 68/100/232 ms
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#sho run
R1#sho running-config
Building configuration...

Current configuration : 1662 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
ip tcp synwait-time 5
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
crypto isakmp policy 1
 authentication pre-share
crypto isakmp key ipsec address 10.0.2.1
!
!
crypto ipsec transform-set IPSEC esp-aes esp-sha-hmac
!
crypto map MAP1 1 ipsec-isakmp
 set peer 10.0.2.1
 set transform-set IPSEC
 match address ACL1
!
!
!
!
interface Tunnel1
 ip address 100.0.0.1 255.255.255.252
 tunnel source GigabitEthernet1/0
 tunnel destination 10.0.2.1
!
interface FastEthernet0/0
 ip address 192.168.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface GigabitEthernet1/0
 ip address 10.0.1.1 255.255.255.252
 negotiation auto
 crypto map MAP1
!
interface GigabitEthernet2/0
 no ip address
 shutdown
 negotiation auto
!
router ospf 1
 log-adjacency-changes
 network 100.0.0.0 0.0.0.3 area 0
 network 192.168.1.0 0.0.0.255 area 0
!
ip route 0.0.0.0 0.0.0.0 GigabitEthernet1/0
!
no ip http server
no ip http secure-server
!
!
!
ip access-list extended ACL1
 permit gre host 10.0.1.1 host 10.0.2.1
no cdp log mismatch duplex
!
!
!
!
control-plane
!
!
!
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
!
end

R1#sho cry isa sa
dst             src             state          conn-id slot status
10.0.2.1        10.0.1.1        QM_IDLE              1    0 ACTIVE

R1#sho cry ipsec sa

interface: GigabitEthernet1/0
    Crypto map tag: MAP1, local addr 10.0.1.1

   protected vrf: (none)
   local  ident (addr/mask/prot/port): (10.0.1.1/255.255.255.255/47/0)
   remote ident (addr/mask/prot/port): (10.0.2.1/255.255.255.255/47/0)
   current_peer 10.0.2.1 port 500
     PERMIT, flags={origin_is_acl,}
    #pkts encaps: 454, #pkts encrypt: 454, #pkts digest: 454
    #pkts decaps: 428, #pkts decrypt: 428, #pkts verify: 428
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 16, #recv errors 0

     local crypto endpt.: 10.0.1.1, remote crypto endpt.: 100.0.0.2
     path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet1/0
     current outbound spi: 0x0(0)

     inbound esp sas:

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:

     outbound ah sas:

     outbound pcp sas:

     local crypto endpt.: 10.0.1.1, remote crypto endpt.: 10.0.2.1
     path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet1/0
     current outbound spi: 0x4206FCA5(1107754149)

     inbound esp sas:
      spi: 0x283F14B1(675222705)
        transform: esp-aes esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 2001, flow_id: SW:1, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4569184/3013)
        IV size: 16 bytes
        replay detection support: Y
        Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0x4206FCA5(1107754149)
        transform: esp-aes esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 2002, flow_id: SW:2, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4569180/3013)
        IV size: 16 bytes
        replay detection support: Y
        Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:
R1#sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     100.0.0.0/30 is subnetted, 1 subnets
C       100.0.0.0 is directly connected, Tunnel1
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.1.0 is directly connected, GigabitEthernet1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/11112] via 100.0.0.2, 00:01:19, Tunnel1
S*   0.0.0.0/0 is directly connected, GigabitEthernet1/0
R1#

R1#sho ip os neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.254     0   FULL/  -        00:00:36    100.0.0.2       Tunnel1
R1#




R1#show ip os interface
Tunnel1 is up, line protocol is up
  Internet Address 100.0.0.1/30, Area 0
  Process ID 1, Router ID 192.168.1.254, Network Type POINT_TO_POINT, Cost: 11111
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:00
  Supports Link-local Signaling (LLS)
  Index 3/3, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 4 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 192.168.2.254
  Suppress hello for 0 neighbor(s)
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.1.254/24, Area 0
  Process ID 1, Router ID 192.168.1.254, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 192.168.1.254, Interface address 192.168.1.254
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:08
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R1#



Netwrk Typeは POINT_TO_POINTになる。

DR/BDRは存在しない。

peerは自動で見つかる。


















R3#sho running-config
Building configuration...

Current configuration : 1664 bytes
!
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
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
ip tcp synwait-time 5
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
crypto isakmp policy 1
 authentication pre-share
crypto isakmp key ipsec address 10.0.1.1
!
!
crypto ipsec transform-set IPSEC esp-aes esp-sha-hmac
!
crypto map MAP1 1 ipsec-isakmp
 set peer 10.0.1.1
 set transform-set IPSEC
 match address ACL1
!
!
!
!
interface Tunnel1
 ip address 100.0.0.2 255.255.255.252
 tunnel source GigabitEthernet2/0
 tunnel destination 10.0.1.1
!
interface FastEthernet0/0
 ip address 192.168.2.254 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface GigabitEthernet1/0
 no ip address
 shutdown
 negotiation auto
!
interface GigabitEthernet2/0
 ip address 10.0.2.1 255.255.255.252
 negotiation auto
 crypto map MAP1
!
router ospf 1
 log-adjacency-changes
 network 100.0.0.0 0.0.0.255 area 0
 network 192.168.2.0 0.0.0.255 area 0
!
ip route 0.0.0.0 0.0.0.0 GigabitEthernet2/0
!
no ip http server
no ip http secure-server
!
!
!
ip access-list extended ACL1
 permit gre host 10.0.2.1 host 10.0.1.1
no cdp log mismatch duplex
!
!
!
!
control-plane
!
!
!
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
!
end

R3#sho cry isa sa
dst             src             state          conn-id slot status
10.0.2.1        10.0.1.1        QM_IDLE              1    0 ACTIVE

R3#sho cry ipsec sa

interface: GigabitEthernet2/0
    Crypto map tag: MAP1, local addr 10.0.2.1

   protected vrf: (none)
   local  ident (addr/mask/prot/port): (10.0.2.1/255.255.255.255/47/0)
   remote ident (addr/mask/prot/port): (10.0.1.1/255.255.255.255/47/0)
   current_peer 10.0.1.1 port 500
     PERMIT, flags={origin_is_acl,}
    #pkts encaps: 428, #pkts encrypt: 428, #pkts digest: 428
    #pkts decaps: 454, #pkts decrypt: 454, #pkts verify: 454
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 0, #recv errors 0

     local crypto endpt.: 10.0.2.1, remote crypto endpt.: 100.0.0.1
     path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet2/0
     current outbound spi: 0x0(0)

     inbound esp sas:

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:

     outbound ah sas:

     outbound pcp sas:

     local crypto endpt.: 10.0.2.1, remote crypto endpt.: 10.0.1.1
     path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet2/0
     current outbound spi: 0x283F14B1(675222705)

     inbound esp sas:
      spi: 0x4206FCA5(1107754149)
        transform: esp-aes esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 2001, flow_id: SW:1, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4550791/3020)
        IV size: 16 bytes
        replay detection support: Y
        Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0x283F14B1(675222705)
        transform: esp-aes esp-sha-hmac ,
        in use settings ={Tunnel, }
        conn id: 2002, flow_id: SW:2, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4550795/3020)
        IV size: 16 bytes
        replay detection support: Y
        Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:
R3#sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     100.0.0.0/30 is subnetted, 1 subnets
C       100.0.0.0 is directly connected, Tunnel1
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.2.0 is directly connected, GigabitEthernet2/0
O    192.168.1.0/24 [110/11112] via 100.0.0.1, 00:01:26, Tunnel1
C    192.168.2.0/24 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 is directly connected, GigabitEthernet2/0
R3#

R3#sho ip os neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.1.254     0   FULL/  -        00:00:36    100.0.0.1       Tunnel1
R3#



経路集約について

10.0.0.0/24
10.0.1.0/24
10.0.2.0/24
10.0.3.0/24

このような経路があったときは、10.0.0.0/22 で集約できる。

集約前と集約後のIPアドレスの範囲は一致する。



では、次のような場合はどうしたらよいか?

10.0.1.0/24
10.0.2.0/24
10.0.3.0/24
10.0.4.0/24
10.0.5.0/24
10.0.6.0/24
10.0.7.0/24
10.0.8.0/24
10.0.9.0/24


一番簡単なのは、上記のサブネットを含む集約アドレスにすることである。

この場合なら、10.0.0.0/20 となる。

しかし、そうすると、10.0.0.0~10.0.0.255、10.0.10.0~10.0.15.255 という
かなり広いムダな領域を含んでしまうことになる。


では逆に、まったく無駄な領域を含まないように、
複数の集約アドレスを設定してみよう。

10.0.1.0/24
10.0.2.0/23
10.0.4.0/22
10.0.8.0/23


でも、今度は集約の効果があまりなく、
集約されている範囲がどこなのかもパっとはわからない。

そこで間をとって、


10.0.0.0/21
10.0.8.0/23


とするのがいいんじゃないだろうか。

10.0.0.0/24が、余計な領域とはなるが。



EIGRPの集約

前回OSPFのsummary addressコマンドで集約をおこなったが、
そもそもその経路はEIGRPルータから広報されている経路であった。

前回は自社ではOSPFルータしか設定できないという前提であったが、
EIGRPルータで集約する場合を考えてみよう。



R4

R4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#interface gigabitEthernet 2/0
R4(config-if)#ip summary-address eigrp 1 ?
  A.B.C.D  IP address

R4(config-if)#ip summary-address eigrp 1 10.0.0.0 ?
  A.B.C.D  IP network mask

R4(config-if)#ip summary-address eigrp 1 10.0.0.0 255.255.248.0
R4(config-if)#end
R4#
*Feb 11 14:33:39.611: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 20.0.1.254 (GigabitEthernet2/0) is resync: summary configured
*Feb 11 14:33:40.263: %SYS-5-CONFIG_I: Configured from console by console
R4#
R4#sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
S       10.0.2.0/24 is directly connected, Loopback0
S       10.0.3.0/24 is directly connected, Loopback0
D       10.0.0.0/21 is a summary, 00:00:07, Null0
S       10.0.1.0/24 is directly connected, Loopback0
S       10.0.4.0/24 is directly connected, Loopback0
S       10.0.5.0/24 is directly connected, Loopback0




R1

R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
O IA    100.0.2.0/26 [110/2] via 100.0.1.2, 00:34:54, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/21 is subnetted, 1 subnets
D       10.0.0.0 [90/51456] via 20.0.1.1, 00:00:16, GigabitEthernet2/0
R1#


ちなみに、R1もR4も、auto-summaryの設定はデフォルトのまま、つまり有効であったのだが、
10.0.x.0/24 は 10.0.0.0/8 に集約されていなかった。

どうも、再配送された経路は集約されないみたいだ・・・。

なんでかな・・・。



OSPFの集約


R1のルーティングテーブル

R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA    100.0.2.33/32 [110/3] via 100.0.1.2, 00:09:07, GigabitEthernet1/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
O IA    100.0.2.0/30 [110/2] via 100.0.1.2, 00:32:16, GigabitEthernet1/0
O IA    100.0.2.22/32 [110/2] via 100.0.1.2, 00:01:59, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/24 is subnetted, 5 subnets
D EX    10.0.2.0 [170/51456] via 20.0.1.1, 00:17:56, GigabitEthernet2/0
D EX    10.0.3.0 [170/51456] via 20.0.1.1, 00:17:56, GigabitEthernet2/0
D EX    10.0.1.0 [170/51456] via 20.0.1.1, 00:17:56, GigabitEthernet2/0
D EX    10.0.4.0 [170/51456] via 20.0.1.1, 00:17:29, GigabitEthernet2/0
D EX    10.0.5.0 [170/51456] via 20.0.1.1, 00:17:25, GigabitEthernet2/0
R1#


R1はEIGRP/OSPF間のASBRで、OSPFエリア1に所属しているので、
OSPFのエリア外経路とEIGRPの経路を学習している。

R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O       100.0.2.33/32 [110/2] via 100.0.2.2, 00:05:41, GigabitEthernet2/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
C       100.0.2.22/32 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
     10.0.0.0/24 is subnetted, 5 subnets
O E2    10.0.2.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.3.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.1.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.4.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
O E2    10.0.5.0 [110/20] via 100.0.1.1, 00:05:41, GigabitEthernet1/0
R2#

R2は、OSPFのABR(area 0 と area 1)
R1がeigrpからredistributeしたOSPF外部経路を学習している。



R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C       100.0.2.33/32 is directly connected, Loopback0
O IA    100.0.1.0/30 [110/2] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
O       100.0.2.22/32 [110/2] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
     10.0.0.0/24 is subnetted, 5 subnets
O E2    10.0.2.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.3.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.1.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.4.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
O E2    10.0.5.0 [110/20] via 100.0.2.1, 00:05:19, GigabitEthernet2/0
R3#


R3は、OSPFのarea 0にのみ所属している。
area 1から、100.0.1.0/30 を学習している。
R1のredistributeした経路も、E2として学習している。


R4#
R4#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     4.0.0.0/32 is subnetted, 1 subnets
C       4.4.4.4 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/24 is subnetted, 5 subnets
S       10.0.2.0 is directly connected, Loopback0
S       10.0.3.0 is directly connected, Loopback0
S       10.0.1.0 is directly connected, Loopback0
S       10.0.4.0 is directly connected, Loopback0
S       10.0.5.0 is directly connected, Loopback0
R4#



R4はEIGRPのルータ。

router eigrp 1
 redistribute static metric 100000 100 255 1 1500
 network 20.0.1.0 0.0.0.255
 auto-summary
!
ip route 10.0.1.0 255.255.255.0 Loopback0
ip route 10.0.2.0 255.255.255.0 Loopback0
ip route 10.0.3.0 255.255.255.0 Loopback0
ip route 10.0.4.0 255.255.255.0 Loopback0
ip route 10.0.5.0 255.255.255.0 Loopback0


static routeをredistributeして、R1が学習している。



この、EIGRPから来ている5本の経路が、まず集約できそうだ。


今回考えるケースでは、EIGRPルータの管理は他社が実施していて、
自分で設定変更できるのはOSPFルータだけだとする。

まず、EIGRPから来ている経路を集約する。


R1で

router ospf 1
 log-adjacency-changes
 summary-address 10.0.0.0 255.255.248.0
 redistribute eigrp 1 subnets
 network 100.0.1.0 0.0.0.3 area 1
!
!

10.0.0.0 ~ 10.0.7.255 までを集約した。
(この集約方法でよいかは改めて考える)


集約後の各ルータのルーティングテーブル


R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA    100.0.2.33/32 [110/3] via 100.0.1.2, 00:27:58, GigabitEthernet1/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
O IA    100.0.2.0/30 [110/2] via 100.0.1.2, 00:51:07, GigabitEthernet1/0
O IA    100.0.2.22/32 [110/2] via 100.0.1.2, 00:20:50, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
D EX    10.0.2.0/24 [170/51456] via 20.0.1.1, 00:36:47, GigabitEthernet2/0
D EX    10.0.3.0/24 [170/51456] via 20.0.1.1, 00:36:47, GigabitEthernet2/0
O       10.0.0.0/21 is a summary, 00:02:01, Null0
D EX    10.0.1.0/24 [170/51456] via 20.0.1.1, 00:36:47, GigabitEthernet2/0
D EX    10.0.4.0/24 [170/51456] via 20.0.1.1, 00:36:20, GigabitEthernet2/0
D EX    10.0.5.0/24 [170/51456] via 20.0.1.1, 00:36:16, GigabitEthernet2/0
R1#


R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O       100.0.2.33/32 [110/2] via 100.0.2.2, 00:21:03, GigabitEthernet2/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
C       100.0.2.22/32 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.1.1, 00:21:03, GigabitEthernet1/0
     10.0.0.0/21 is subnetted, 1 subnets
O E2    10.0.0.0 [110/20] via 100.0.1.1, 00:02:14, GigabitEthernet1/0
R2#



R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C       100.0.2.33/32 is directly connected, Loopback0
O IA    100.0.1.0/30 [110/2] via 100.0.2.1, 00:21:11, GigabitEthernet2/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
O       100.0.2.22/32 [110/2] via 100.0.2.1, 00:21:11, GigabitEthernet2/0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.2.1, 00:21:11, GigabitEthernet2/0
     10.0.0.0/21 is subnetted, 1 subnets
O E2    10.0.0.0 [110/20] via 100.0.2.1, 00:02:25, GigabitEthernet2/0
R3#



R4は変化がないので省略




次に、area 0からarea 1に来ている3つの経路を集約する。

O IA    100.0.2.33/32 [110/3] via 100.0.1.2, 00:09:07, GigabitEthernet1/0
O IA    100.0.2.0/30 [110/2] via 100.0.1.2, 00:32:16, GigabitEthernet1/0
O IA    100.0.2.22/32 [110/2] via 100.0.1.2, 00:01:59, GigabitEthernet1/0

この集約はR2でおこなう。


router ospf 1
 log-adjacency-changes
 area 0 range 100.0.2.0 255.255.255.192
 network 100.0.1.0 0.0.0.3 area 1
 network 100.0.2.0 0.0.0.3 area 0
 network 100.0.2.22 0.0.0.0 area 0




R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
O IA    100.0.2.0/26 [110/2] via 100.0.1.2, 00:00:33, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.1.0 is directly connected, GigabitEthernet2/0
     10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
D EX    10.0.2.0/24 [170/51456] via 20.0.1.1, 00:42:54, GigabitEthernet2/0
D EX    10.0.3.0/24 [170/51456] via 20.0.1.1, 00:42:54, GigabitEthernet2/0
O       10.0.0.0/21 is a summary, 00:08:09, Null0
D EX    10.0.1.0/24 [170/51456] via 20.0.1.1, 00:42:54, GigabitEthernet2/0
D EX    10.0.4.0/24 [170/51456] via 20.0.1.1, 00:42:27, GigabitEthernet2/0
D EX    10.0.5.0/24 [170/51456] via 20.0.1.1, 00:42:23, GigabitEthernet2/0
R1#



R1#ping 100.0.2.22

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.22, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/29/48 ms
R1#ping 100.0.2.33

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.33, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/80/140 ms
R1#
R1#
R1#ping 100.0.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/87/124 ms
R1#ping 100.0.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/52/124 ms
R1#



R2のルーティングテーブルに、Null0あての集約経路が登録される。

R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 5 subnets, 3 masks
O       100.0.2.33/32 [110/2] via 100.0.2.2, 00:01:04, GigabitEthernet2/0
C       100.0.1.0/30 is directly connected, GigabitEthernet1/0
C       100.0.2.0/30 is directly connected, GigabitEthernet2/0
O       100.0.2.0/26 is a summary, 00:01:04, Null0
C       100.0.2.22/32 is directly connected, Loopback0
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.1.0 [110/20] via 100.0.1.1, 00:01:04, GigabitEthernet1/0
     10.0.0.0/21 is subnetted, 1 subnets
O E2    10.0.0.0 [110/20] via 100.0.1.1, 00:01:04, GigabitEthernet1/0
R2#


R3, R4は変化なし









distance eigrp

R1から、R5のloopback 200.0.0.1へアクセスしたい。

R2とR3で、ospfとeigrpの相互redistributeをすればよい。


<R2>
router eigrp 1
 redistribute ospf 1 metric 1544 2000 255 1 1500
 network 10.1.0.0 0.0.0.255
 network 100.0.0.0 0.0.0.255
 auto-summary
!
router ospf 1
 log-adjacency-changes
 redistribute eigrp 1 subnets

<R3>
router eigrp 1
 redistribute ospf 1 metric 1000000 1 255 1 1500
 network 10.1.0.0 0.0.0.255
 auto-summary
!
router ospf 1
 log-adjacency-changes
 redistribute eigrp 1 subnets
 network 30.0.0.0 0.0.0.255 area 0
!
!

R1#ping 200.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/78/92 ms
R1#

pingは通るようになった。しかし、tracerouteしてみると、
低速なシリアルI/Fを経由してしまっている。

R1#traceroute 200.0.0.1

Type escape sequence to abort.
Tracing the route to 200.0.0.1

  1 100.0.0.254 36 msec 60 msec 64 msec
  2 20.0.0.2 60 msec 64 msec 64 msec
  3 40.0.0.2 120 msec 92 msec 92 msec
R1#

R2のルーティングテーブルを見てみる。

R2#sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       100.0.0.0/24 is directly connected, FastEthernet0/0
D       100.0.0.0/8 is a summary, 00:00:10, Null0
     200.0.0.0/32 is subnetted, 1 subnets
O       200.0.0.1 [110/66] via 20.0.0.2, 00:00:12, Serial3/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.0.0 is directly connected, Serial3/0
     40.0.0.0/24 is subnetted, 1 subnets
O       40.0.0.0 [110/65] via 20.0.0.2, 00:00:12, Serial3/0
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       10.0.0.0/8 is a summary, 00:00:10, Null0
C       10.1.0.0/24 is directly connected, GigabitEthernet1/0
     30.0.0.0/24 is subnetted, 1 subnets
O       30.0.0.0 [110/65] via 20.0.0.2, 00:00:13, Serial3/0


R2はOSPFとEIGRPを両方動作させているいわゆるASBRであり、二つのプロトコルから
経路を学習している。
そして、200.0.0.1への経路はOSPFで学習した、next hopが20.0.0.2の経路である。

EIGRPで学習した経路情報を見てみる。

R2#show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(100.0.0.254)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.0.0.0/8, 1 successors, FD is 2816
        via Summary (2816/0), Null0
P 10.1.0.0/24, 1 successors, FD is 2816
        via Connected, GigabitEthernet1/0
P 20.0.0.0/24, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
        via 10.1.0.2 (3072/2816), GigabitEthernet1/0
P 30.0.0.0/24, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
        via 10.1.0.2 (3072/2816), GigabitEthernet1/0
P 40.0.0.0/24, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
        via 10.1.0.2 (3072/2816), GigabitEthernet1/0
P 100.0.0.0/8, 1 successors, FD is 28160
        via Summary (28160/0), Null0
P 100.0.0.0/24, 1 successors, FD is 28160
        via Connected, FastEthernet0/0
        via 10.1.0.2 (3072/2816), GigabitEthernet1/0

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 200.0.0.1/32, 1 successors, FD is 2169856
        via Redistributed (2169856/0)
        via 10.1.0.2 (3072/2816), GigabitEthernet1/0

R2#

EIGRPでも200.0.0.1/32への経路は学習されているが、
ルーティングテーブルに載らない。

これは、ルーティングテーブルに載せる経路を選択するときに最初に比較されるAdministrative Distanceが、
OSPFの経路は110、EIGRPの外部経路は170で、
OSPFの経路が採用されるからである。

そこで、EIGRPの外部経路のdistance値を、110より小さい値に変更する。

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router eigrp 1
R2(config-router)#distance ?
  <1-255>  Administrative distance
  eigrp    IP-EIGRP distance

R2(config-router)#distance eigrp ?
  <1-255>  Distance for internal routes

R2(config-router)#distance eigrp 90 ?
  <1-255>  Distance for external routes

R2(config-router)#distance eigrp 90 105
R2(config-router)#end
R2#
*Feb 11 11:25:52.463: %SYS-5-CONFIG_I: Configured from console by console
R2#
R2#
*Feb 11 11:26:01.431: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.0.2 (GigabitEthernet1/0) is down: route configuration changed
*Feb 11 11:26:01.443: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 100.0.0.1 (FastEthernet0/0) is down: route configuration changed
R2#
*Feb 11 11:26:04.091: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 100.0.0.1 (FastEthernet0/0) is up: new adjacency
*Feb 11 11:26:04.747: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.1.0.2 (GigabitEthernet1/0) is up: new adjacency
R2#


すると、EIGRPの二つのneighborが一度ダウンして再度UPする。

変更後のR2のルーティングテーブルを見てみる。

R2#
R2#sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       100.0.0.0/24 is directly connected, FastEthernet0/0
D       100.0.0.0/8 is a summary, 00:14:28, Null0
     200.0.0.0/32 is subnetted, 1 subnets
D EX    200.0.0.1 [105/3072] via 10.1.0.2, 00:00:13, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.0.0 is directly connected, Serial3/0
     40.0.0.0/24 is subnetted, 1 subnets
D EX    40.0.0.0 [105/3072] via 10.1.0.2, 00:00:13, GigabitEthernet1/0
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       10.0.0.0/8 is a summary, 00:00:13, Null0
C       10.1.0.0/24 is directly connected, GigabitEthernet1/0
     30.0.0.0/24 is subnetted, 1 subnets
D EX    30.0.0.0 [105/3072] via 10.1.0.2, 00:00:13, GigabitEthernet1/0
R2#

R2#


200.0.0.1への経路として、D EXつまりEIGRPで学習した外部経路が採用されており、
そのnext hopは 10.1.0.2である。

R1からのtracerouteの結果も変わった。

R1#traceroute 200.0.0.1

Type escape sequence to abort.
Tracing the route to 200.0.0.1

  1 100.0.0.254 44 msec 64 msec 64 msec
  2 10.1.0.2 92 msec 92 msec 64 msec
  3 30.0.0.2 64 msec 124 msec 16 msec
  4 40.0.0.2 116 msec 44 msec 40 msec

R1#



では、EIGRPのdistanceを変更せずに、OSPFのdistanceを大きくしても、
同じことができるのではないか?


R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#distance ?
  <1-255>  Administrative distance
  ospf     OSPF distance

R2(config-router)#distance ospf ?
  external    External type 5 and type 7 routes
  inter-area  Inter-area routes
  intra-area  Intra-area routes

R2(config-router)#distance ospf intra-area 200
R2(config-router)#end
R2#
*Feb 11 11:39:58.407: %SYS-5-CONFIG_I: Configured from console by console
R2#
R2#
R2#
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       100.0.0.0/24 is directly connected, FastEthernet0/0
D       100.0.0.0/8 is a summary, 00:28:18, Null0
     200.0.0.0/32 is subnetted, 1 subnets
D EX    200.0.0.1 [170/3072] via 10.1.0.2, 00:00:11, GigabitEthernet1/0
     20.0.0.0/24 is subnetted, 1 subnets
C       20.0.0.0 is directly connected, Serial3/0
     40.0.0.0/24 is subnetted, 1 subnets
D EX    40.0.0.0 [170/3072] via 10.1.0.2, 00:00:11, GigabitEthernet1/0
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       10.0.0.0/8 is a summary, 00:01:01, Null0
C       10.1.0.0/24 is directly connected, GigabitEthernet1/0
     30.0.0.0/24 is subnetted, 1 subnets


できる・・・。

OSPFのデフォルトのAD値は110で、外部も内部も同じであるが、
変更は external, inter-area, intra-area それぞれでおこなえる・・・というのは
今初めて知った・・・・。