labunix's blog

labunixのラボUnix

Cisco IOU L3でEIGRPスタブ検証環境を追加する。

■Cisco IOU L3でEIGRPスタブ検証環境を追加する。

 今回の拡張分のルータを起動して、
 IOUルータ7台、IOUスイッチ1台、Ethernet switch1台、FrameRelay1台の環境でも、
 CPU(1.8%)、RAM(22.4%)と安定しているので、まだまだ増やせそう。

 Cisco IOU L3でEIGRP検証環境を作ってみる。
 http://labunix.hateblo.jp/entry/20180725/1532448140

f:id:labunix:20180731182838p:plain

■管理用のtelnetを構成する。

$ for n in `seq 31 34`;do \
    echo "[R$(($n%30))]"; \
    echo -e "conf t"; \
    echo -e "int e$(($n%30/4))/$(($n%30%4))"; \
    echo -e "ip address 192.168.0.${n}" 255.255.255.0; \
    echo "no shut"; \
    echo -e "enable password cisco\nline vty 0 4\npassword cisco\ntransport input telnet"; \
    echo -e "end\nwrite mem\n";
  done
[R1]
conf t
int e0/1
ip address 192.168.0.31 255.255.255.0
no shut
enable password cisco
line vty 0 4
password cisco
transport input telnet
end
write mem

[R2]
conf t
int e0/2
ip address 192.168.0.32 255.255.255.0
no shut
enable password cisco
line vty 0 4
password cisco
transport input telnet
end
write mem

[R3]
conf t
int e0/3
ip address 192.168.0.33 255.255.255.0
no shut
enable password cisco
line vty 0 4
password cisco
transport input telnet
end
write mem

[R4]
conf t
int e1/0
ip address 192.168.0.34 255.255.255.0
no shut
enable password cisco
line vty 0 4
password cisco
transport input telnet
end
write mem


■socatで別のサーバからつなげる場合。

$ for n in `seq 31 34`;do socat tcp-listen:${n}23,fork tcp-connect:192.168.0.${n}:23 & done

■それ以外はtelnetがつながるので地道に。

R1#show run | section interface Serial2/0
interface Serial2/0
 ip address 10.2.1.1 255.255.255.0
 serial restart-delay 0

R2#show run | section interface Ethernet0/0|interface Serial2/0
interface Ethernet0/0
 ip address 10.2.2.2 255.255.255.0
interface Serial2/0
 ip address 10.2.1.2 255.255.255.0
 serial restart-delay 0

R3#show run  | section interface Ethernet0/0|interface Serial2/0|interface Ethernet0/3
interface Ethernet0/0
 ip address 172.16.1.1 255.255.255.0
interface Ethernet0/3
 ip address 192.168.0.33 255.255.255.0
interface Serial2/0
 ip address 10.2.3.3 255.255.255.0
 serial restart-delay 0

R4#show run | section interface Ethernet0/0|interface Serial2/0
interface Ethernet0/0
 ip address 10.2.2.4 255.255.255.0
interface Serial2/0
 ip address 10.2.3.4 255.255.255.0
 serial restart-delay 0

■R1,R2,R3,R4を、EIGRP AS 65000で構成する。

R4#show run | section router
router eigrp 65000
 network 10.0.0.0
 network 172.16.0.0

■ルーティングテーブルを確認

R1#show ip route eigrp
Codes: L - local, 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, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
D        10.2.2.0/24 [90/2195456] via 10.2.1.2, 17:13:43, Serial2/0
D        10.2.3.0/24 [90/2707456] via 10.2.1.2, 17:13:20, Serial2/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2733056] via 10.2.1.2, 00:06:57, Serial2/0

R2#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
D        10.2.3.0/24 [90/2195456] via 10.2.2.4, 17:14:04, Ethernet0/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2221056] via 10.2.2.4, 00:07:41, Ethernet0/0

R3#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
D        10.2.1.0/24 [90/2707456] via 10.2.3.4, 00:07:42, Serial2/0
D        10.2.2.0/24 [90/2195456] via 10.2.3.4, 00:07:42, Serial2/0

R4#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
D        10.2.1.0/24 [90/2195456] via 10.2.2.2, 17:14:07, Ethernet0/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2195456] via 10.2.3.3, 00:07:44, Serial2/0

■R1とR3にパッシブインターフェイスを設定する。
 R1とR3の違いを確認する。

R1#show run | section eigrp
router eigrp 65000
 network 10.0.0.0
 network 172.16.0.0
 passive-interface default
 no passive-interface Serial2/0

R1# show ip protocols | section Passive

R3#show run | section eigrp
router eigrp 65000
 network 10.0.0.0
 network 172.16.0.0
 passive-interface default
 no passive-interface Serial2/0

R3#show ip protocols | section Passive
  Passive Interface(s):
    Ethernet0/0

■R2とR4でインターフェイス単位のEIGRP経路集約を手動で設定する。

R2#show run | section router|interface Serial2/0
interface Serial2/0
 ip address 10.2.1.2 255.255.255.0
 ip summary-address eigrp 65000 10.2.0.0 255.255.0.0
 serial restart-delay 0
router eigrp 65000
 network 10.0.0.0
 network 172.16.0.0

R2#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
D        10.2.0.0/16 is a summary, 00:01:41, Null0
D        10.2.3.0/24 [90/2195456] via 10.2.2.4, 17:50:49, Ethernet0/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2221056] via 10.2.2.4, 00:30:57, Ethernet0/0

R2#show ip protocols | section Summar
  Automatic Summarization: disabled
  Address Summarization:
    10.2.0.0/16 for Se2/0
      Summarizing 3 components with metric 281600

R1#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
D        10.2.0.0/16 [90/2195456] via 10.2.1.2, 00:01:57, Serial2/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2733056] via 10.2.1.2, 00:30:22, Serial2/0

R4#show run | section router|interface Serial2/0
interface Serial2/0
 ip address 10.2.3.4 255.255.255.0
 ip summary-address eigrp 65000 10.2.0.0 255.255.0.0
 serial restart-delay 0
router eigrp 65000
 network 10.0.0.0
 network 172.16.0.0

R4#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
D        10.2.0.0/16 is a summary, 00:02:35, Null0
D        10.2.1.0/24 [90/2195456] via 10.2.2.2, 17:52:14, Ethernet0/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2195456] via 10.2.3.3, 00:32:22, Serial2/0

R4#show ip protocols | section Summar
  Automatic Summarization: disabled
  Address Summarization:
    10.2.0.0/16 for Se2/0
      Summarizing 3 components with metric 281600

R3#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
D        10.2.0.0/16 [90/2195456] via 10.2.3.4, 00:03:05, Serial2/0

■R2とR4でEIGRP自動集約に変更してみる。
 クラスフル間ではないので、「is a summary」もなく、経路も集約されない。

conf t
  router eigrp 65000
    auto-summary
    int s2/0
      no ip summary-address eigrp 65000 10.2.0.0 255.255.0.0
  end
write mem

R2#show ip protocols | section Summar
  Automatic Summarization: enabled

R4#show ip pro | section Summar
  Automatic Summarization: enabled

■R2とR4でEIGRP手動集約に戻す。

conf t
  router eigrp 65000
    no auto-summary
    int s2/0
      ip summary-address eigrp 65000 10.2.0.0 255.255.0.0
  end
write mem

■R1とR3をEIGRPスタブに変更する。

conf t
  router eigrp 65000
    eigrp stub
  end
write mem

R1#show ip protocols | section Stub
    Stub, connected, summary

R3#show ip protocols | section Stub
    Stub, connected, summary
R2#show ip eigrp neighbors detail 
EIGRP-IPv4 Neighbors for AS(65000)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
0   10.2.1.1                Se2/0                    10 00:02:12   18   108  0  35
   Version 18.0/2.0, Retrans: 0, Retries: 0
   Topology-ids from peer - 0 
   Stub Peer Advertising (CONNECTED SUMMARY ) Routes
   Suppressing queries
1   10.2.2.4                Et0/0                    12 18:25:22    6   100  0  59
   Time since Restart 00:09:36
   Version 18.0/2.0, Retrans: 1, Retries: 0, Prefixes: 2
   Topology-ids from peer - 0 
Max Nbrs: 0, Current Nbrs: 0

R4#show ip eigrp neighbors detail 
EIGRP-IPv4 Neighbors for AS(65000)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
1   10.2.3.3                Se2/0                    14 00:02:27   21   126  0  31
   Version 18.0/2.0, Retrans: 0, Retries: 0, Prefixes: 1
   Topology-ids from peer - 0 
   Stub Peer Advertising (CONNECTED SUMMARY ) Routes
   Suppressing queries
0   10.2.2.2                Et0/0                    11 18:25:41    7   100  0  67
   Time since Restart 00:09:55
   Version 18.0/2.0, Retrans: 2, Retries: 0, Prefixes: 1
   Topology-ids from peer - 0 
Max Nbrs: 0, Current Nbrs: 0

■R1はreceive-onlyオプションを追加する。

R1#show ip protocols | sec Stub
    Stub, receive-only

R2#show ip route eigrp            
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
D        10.2.0.0/16 is a summary, 00:19:09, Null0
D        10.2.3.0/24 [90/2195456] via 10.2.2.4, 18:34:53, Ethernet0/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2221056] via 10.2.2.4, 00:11:41, Ethernet0/0

■R2には経路集約が要らなくなったので削除

conf t
  router eigrp 65000
    int s2/0
      no ip summary-address eigrp 65000 10.2.0.0 255.255.0.0
  end
write mem

R2#show ip protocols | section Summ
  Automatic Summarization: disabled

R2#show ip route eigrp
...
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
D        10.2.3.0/24 [90/2195456] via 10.2.2.4, 18:39:06, Ethernet0/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2221056] via 10.2.2.4, 00:15:54, Ethernet0/0

R2#show ip route | inc Serial
C        10.2.1.0/24 is directly connected, Serial2/0
L        10.2.1.2/32 is directly connected, Serial2/0

■ルーティングテーブルを追ってみる。

R3#sho ip route | inc 10.2.1.|10.2.0.
D        10.2.0.0/16 [90/2195456] via 10.2.3.4, 00:19:36, Serial2/0

R4#sho ip route | inc 10.2.1.|10.2.0.
D        10.2.0.0/16 is a summary, 00:27:34, Null0
D        10.2.1.0/24 [90/2195456] via 10.2.2.2, 18:43:16, Ethernet0/0

R2#sho ip route | inc 10.2.1.|10.2.0.
C        10.2.1.0/24 is directly connected, Serial2/0
L        10.2.1.2/32 is directly connected, Serial2/0

R1#sho ip route | inc 10.2.1.|10.2.0.
C        10.2.1.0/24 is directly connected, Serial2/0
L        10.2.1.1/32 is directly connected, Serial2/0
D        10.2.2.0/24 [90/2195456] via 10.2.1.2, 00:07:05, Serial2/0
D        10.2.3.0/24 [90/2707456] via 10.2.1.2, 00:07:05, Serial2/0
D        172.16.1.0 [90/2733056] via 10.2.1.2, 00:15:31, Serial2/0

R3#tracer 10.2.1.1
Type escape sequence to abort.
Tracing the route to 10.2.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 10.2.3.4 9 msec 8 msec 8 msec
  2 10.2.2.2 9 msec 9 msec 8 msec
  3 10.2.1.1 14 msec 18 msec 14 msec

R1#show ip route | inc 172
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2733056] via 10.2.1.2, 00:19:03, Serial2/0

R2#show ip route | inc 172
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2221056] via 10.2.2.4, 00:24:09, Ethernet0/0

R4#show ip route | inc 172
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2195456] via 10.2.3.3, 00:24:07, Serial2/0

R3#show ip route | inc 172
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.1.0/24 is directly connected, Ethernet0/0
L        172.16.1.1/32 is directly connected, Ethernet0/0

R1#traceroute 172.16.1.1
Type escape sequence to abort.
Tracing the route to 172.16.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 10.2.1.2 9 msec 9 msec 9 msec
  2 10.2.2.4 9 msec 9 msec 9 msec
  3 10.2.3.3 17 msec 14 msec 18 msec