labunix's blog

labunixのラボUnix

Cisco IOU L3でEIGRP検証環境を作ってみる。

■Cisco IOU L3でEIGRP検証環境を作ってみる。

EIGRP-R1#show ver | inc ^Cisco IOS
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.5(2)T, DEVELOPMENT TEST SOFTWARE

f:id:labunix:20180725011220p:plain

■GNS3上でフレームリレーを構成

$ find GNS3/projects/home-labo-3 -type f -name "*.gns3" | \
    awk '/>mapping/{gsub(".*>mapping|</text.*","\n",$0);print "[mapping]"$0}' `xargs` | xargs -0 echo -e
[mapping]

1:102 = 2:201
1:103 = 3:301
2:203 = 3:302

■IPアドレスを付与。

L2SW-base#show ip interface brief | inc \.
Vlan1                  192.168.0.20    YES NVRAM  up                    up 

L2SW-base#show vlan id 1

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/0, Et0/1, Et0/2, Et0/3, Et1/0, Et1/1, Et1/2, Et1/3, Et2/0, Et2/1, Et2/2, Et2/3
                                                Et3/0, Et3/1, Et3/2, Et3/3, Et4/0, Et4/1, Et4/2, Et4/3, Et5/0, Et5/1, Et5/2, Et5/3
                                                Et6/0, Et6/1, Et6/2, Et6/3, Et7/0, Et7/1, Et7/2, Et7/3

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0   

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------

L2SW-base#show run | section interface Ethernet0/0|interface Ethernet0/1|interface Ethernet0/2|interface Ethernet0/3
interface Ethernet0/0
 description [L2SW-base]--[host-br1]
 duplex auto
interface Ethernet0/1
 description [L2SW-base]--[EIGRP-R1]
 switchport mode access
 duplex auto
interface Ethernet0/2
 description [L2SW-base]--[EIGRP-R2]
 switchport mode access
 duplex auto
interface Ethernet0/3
 description [L2SW-base]--[EIGRP-R3]
 switchport mode access
 duplex auto

EIGRP-R1#show run | section interface Ethernet0/1|interface Serial2/0
interface Ethernet0/1
 ip address 192.168.0.21 255.255.255.0
interface Serial2/0
 ip address 172.16.14.21 255.255.255.0
 encapsulation frame-relay
 serial restart-delay 0
 passive-interface Ethernet0/1

EIGRP-R2#show run | section interface Serial2/0|interface Ethernet0/0|interface Ethernet0/2
interface Ethernet0/0
 ip address 172.16.15.22 255.255.255.0
interface Ethernet0/2
 ip address 192.168.0.22 255.255.255.0
 shutdown
interface Serial2/0
 ip address 172.16.14.22 255.255.255.0
 encapsulation frame-relay
 serial restart-delay 0
 passive-interface Ethernet0/2

EIGRP-R3#show run | section interface Serial2/0|interface Ethernet0/0|interface Ethernet0/3
interface Ethernet0/0
 ip address 172.16.15.23 255.255.255.0
interface Ethernet0/3
 ip address 192.168.0.23 255.255.255.0
 shutdown
interface Serial2/0
 ip address 172.16.14.23 255.255.255.0
 encapsulation frame-relay
 serial restart-delay 0

■フレームリレー設定の確認

EIGRP-R1#show frame-relay map 
Serial2/0 (up): ip 172.16.14.22 dlci 102(0x66,0x1860), dynamic,
              broadcast,, status defined, active
Serial2/0 (up): ip 172.16.14.23 dlci 103(0x67,0x1870), dynamic,
              broadcast,, status defined, active

EIGRP-R2#show frame-relay map 
Serial2/0 (up): ip 172.16.14.21 dlci 201(0xC9,0x3090), dynamic,
              broadcast,
              CISCO, status defined, active
Serial2/0 (up): ip 172.16.14.23 dlci 203(0xCB,0x30B0), dynamic,
              broadcast,
              CISCO, status defined, active

EIGRP-R3#show frame-relay map 
Serial2/0 (up): ip 172.16.14.21 dlci 301(0x12D,0x48D0), dynamic,
              broadcast,
              CISCO, status defined, active
Serial2/0 (up): ip 172.16.14.22 dlci 302(0x12E,0x48E0), dynamic,
              broadcast,, status defined, active

EIGRP-R1#traceroute 172.16.14.22
Type escape sequence to abort.
Tracing the route to 172.16.14.22
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.14.22 5 msec 6 msec 6 msec
EIGRP-R1#traceroute 172.16.14.23
Type escape sequence to abort.
Tracing the route to 172.16.14.23
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.14.23 6 msec 6 msec 6 msec

EIGRP-R2#traceroute 172.16.14.21
Type escape sequence to abort.
Tracing the route to 172.16.14.21
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.14.21 6 msec 10 msec 6 msec
EIGRP-R2#traceroute 172.16.14.23
Type escape sequence to abort.
Tracing the route to 172.16.14.23
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.14.23 9 msec 9 msec 9 msec

EIGRP-R3#traceroute 172.16.14.21
Type escape sequence to abort.
Tracing the route to 172.16.14.21
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.14.21 7 msec 6 msec 6 msec
EIGRP-R3#traceroute 172.16.14.22
Type escape sequence to abort.
Tracing the route to 172.16.14.22
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.14.22 9 msec 10 msec 9 msec

■telnetサーバの有効化

EIGRP-R2#show run | section line vty|enable
enable password cisco
line vty 0 4
 password cisco
 login
 transport input telnet

■EIGRPルーティングを設定

EIGRP-R1#show run | section eigrp
router eigrp 65001
 network 172.16.0.0
 passive-interface Ethernet0/1

EIGRP-R2#show run | section eigrp
router eigrp 65001
 network 172.16.0.0
 passive-interface Ethernet0/2

EIGRP-R3#show run | section eigrp
router eigrp 65001
 network 172.16.0.0
 passive-interface Ethernet0/3

■192.168.0.0/24セグメントのパッシブインターフェイス設定が有効に働くのは、
 eigrpのnetworkで許可しているセグメントの場合。
 今回、192.168.0.0/24はL2の管理用なので、誤操作などの影響範囲外とするため。

EIGRP-R1#show running-config | section eigrp
router eigrp 65001
 network 172.16.0.0
 network 192.168.0.0
 passive-interface Ethernet0/1

EIGRP-R1#show ip protocols | section Passive
  Passive Interface(s):
    Ethernet0/1

■EIGRPの動作確認

EIGRP-R1#show ip eigrp interfaces 
EIGRP-IPv4 Interfaces for AS(65001)
                              Xmit Queue   PeerQ        Mean   Pacing Time   Multicast    Pending
Interface              Peers  Un/Reliable  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
Se2/0                    2        0/0       0/0         117       0/16         608           0

EIGRP-R2#show ip eigrp interfaces
EIGRP-IPv4 Interfaces for AS(65001)
                              Xmit Queue   PeerQ        Mean   Pacing Time   Multicast    Pending
Interface              Peers  Un/Reliable  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
Se2/0                    2        0/0       0/0          11       0/16          76           0
Et0/0                    1        0/0       0/0           5       0/2           50           0

EIGRP-R3#show ip eigrp interfaces
EIGRP-IPv4 Interfaces for AS(65001)
                              Xmit Queue   PeerQ        Mean   Pacing Time   Multicast    Pending
Interface              Peers  Un/Reliable  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
Se2/0                    2        0/0       0/0         313       0/16        1388           0
Et0/0                    1        0/0       0/0          14       0/2           72           0

EIGRP-R1#show ip eigrp neighbors  
EIGRP-IPv4 Neighbors for AS(65001)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
1   172.16.14.22            Se2/0                   134 00:47:38  222  1332  0  33
0   172.16.14.23            Se2/0                   157 00:47:38   13   100  0  31

EIGRP-R2#show ip eigrp neighbors 
EIGRP-IPv4 Neighbors for AS(65001)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
2   172.16.14.21            Se2/0                   126 00:47:53   11   100  0  17
1   172.16.14.23            Se2/0                   142 00:47:53   12   100  0  26
0   172.16.15.23            Et0/0                    12 00:48:42    6   100  0  30

EIGRP-R3#show ip eigrp neighbors 
EIGRP-IPv4 Neighbors for AS(65001)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
2   172.16.14.22            Se2/0                   162 00:48:07  407  2442  0  28
1   172.16.14.21            Se2/0                   170 00:48:07  219  1314  0  17
0   172.16.15.22            Et0/0                    11 00:48:56  138   828  0  32[EIGRP-R1][show ip protocols]の結果

EIGRP-R1#show ip protocols 
*** IP Routing is NSF aware ***

Routing Protocol is "application"
  Sending updates every 0 seconds
  Invalid after 0 seconds, hold down 0, flushed after 0
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Maximum path: 32
  Routing for Networks:
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 4)

Routing Protocol is "eigrp 65001"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP-IPv4 Protocol for AS(65001)
    Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
    Soft SIA disabled
    NSF-aware route hold timer is 240
    Router-ID: 192.168.0.21
    Topology : 0 (base) 
      Active Timer: 3 min
      Distance: internal 90 external 170
      Maximum path: 4
      Maximum hopcount 100
      Maximum metric variance 1

  Automatic Summarization: disabled
  Maximum path: 4
  Routing for Networks:
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    172.16.14.22          90      00:00:30
    172.16.14.23          90      00:00:30
  Distance: internal 90 external 170[EIGRP-R1]から172.16.15.0/24のネットワークに対しては等コスト。

EIGRP-R1#show ip eigrp topology all-links 
EIGRP-IPv4 Topology Table for AS(65001)/ID(192.168.0.21)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 

P 172.16.14.0/24, 1 successors, FD is 2169856, serno 2
        via Connected, Serial2/0
P 172.16.15.0/24, 2 successors, FD is 2195456, serno 4
        via 172.16.14.22 (2195456/281600), Serial2/0
        via 172.16.14.23 (2195456/281600), Serial2/0

EIGRP-R2#show ip eigrp topology all-links 
EIGRP-IPv4 Topology Table for AS(65001)/ID(192.168.0.22)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 

P 172.16.14.0/24, 1 successors, FD is 2169856, serno 3
        via Connected, Serial2/0
        via 172.16.15.23 (2195456/2169856), Ethernet0/0
P 172.16.15.0/24, 1 successors, FD is 281600, serno 2
        via Connected, Ethernet0/0
        via 172.16.14.23 (2195456/281600), Serial2/0

EIGRP-R3#show ip eigrp topology all-links 
EIGRP-IPv4 Topology Table for AS(65001)/ID(192.168.0.23)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status 

P 172.16.14.0/24, 1 successors, FD is 2169856, serno 3
        via Connected, Serial2/0
        via 172.16.15.22 (2195456/2169856), Ethernet0/0
P 172.16.15.0/24, 1 successors, FD is 281600, serno 2
        via Connected, Ethernet0/0
        via 172.16.14.22 (2195456/281600), Serial2/0

■telnetを他のサーバから接続する場合のsocatでの転送設定

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

$ telnet 172.31.31.92 2123
Trying 172.31.31.92...
Connected to 172.31.31.92.
Escape character is '^]'.

User Access Verification

Password: 
EIGRP-R1>exit
Connection closed by foreign host.
$ telnet 172.31.31.92 2223
Trying 172.31.31.92...
Connected to 172.31.31.92.
Escape character is '^]'.

User Access Verification

Password: 
EIGRP-R2>exit
Connection closed by foreign host.
$ telnet 172.31.31.92 2323
Trying 172.31.31.92...
Connected to 172.31.31.92.
Escape character is '^]'.

User Access Verification

Password: 
EIGRP-R3>exit
Connection closed by foreign host.

■時刻同期設定(共通)

#show run | section ntp
ntp update-calendar
ntp server 192.168.0.5

#show ntp associations 

  address         ref clock       st   when   poll reach  delay  offset   disp
*~192.168.0.5     172.31.31.252    3      8     64     1  0.871   0.206 188.48
 * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured