labunix's blog

labunixのラボUnix

GNS3でIPv6/OSPFv3環境を構築してみる。

■GNS3でIPv6/OSPFv3環境を構築してみる。
 c3725の4台構成とした。

$ echo "[R1] -- [R2] -- VLINK -- [R3] -- [R4]"
[R1] -- [R2] -- VLINK -- [R3] -- [R4]

f:id:labunix:20160925155801p:plain

■以下を参考に、エリア番号等細かい値は若干変更した。

 OSPFv3 仮想リンクの設定例
 http://www.cisco.com/cisco/web/support/JP/110/1109/1109560_ospfv3-vlink-config.html

■IPv6の設定

$ for n in `seq 1 4`;do \
    echo -e "en\nconf t\nhostname R${n}"; \
    echo "ipv6 unicast-routing"; \
    echo "ipv6 cef"; \
    echo "ipv6 router ospf 1"; \
    echo "  router-id ${n}.${n}.${n}.${n}"; \
    echo "int fa0/0"; \
    echo "  ipv6 enable"; \
    if [ $n -eq 1 -o $n -eq 3 ];then \
      echo "  ipv6 address 2011:8:8:${n}::${n}/64"; \
      echo "  no shut"; \
    elif [ $n -eq 4 -o $n -eq 2 ];then \
      echo "  ipv6 address 2011:8:8:$(($n-1))::${n}/64"; \
      echo "  no shut"; \
    fi; \
    if [ $n -eq 2 -o $n -eq 3 ];then \
      echo "int s1/0"; \
      echo "  clock rate 64000"; \
      echo "  ipv6 enable"; \
      if [ $n -eq 2 ];then \
        echo "  ipv6 address 2011:8:8:${n}::${n}/64"; \
      elif [ $n -eq 3 ];then \
        echo "  ipv6 address 2011:8:8:$(($n-1))::${n}/64"; \
      fi
      echo "  no shut"; \
    fi; \
    echo "int lo0"; \
    echo "  ipv6 enable"; \
    echo "  ipv6 address FE01:${n}::${n}/64"; \
    echo "  no shut"; \
    echo -e "end\nwrite memory\n"; \
  done

■OSPFv3エリアをインターフェイスに紐付け

! R1
en
conf t
int lo0
  ipv6 ospf 1 area 0
int f0/0
  ipv6 ospf 1 area 0
end
write memory


! R2
en
conf t
int lo0
  ipv6 ospf 1 area 0
ipv6 router ospf 1
  area 1 virtual-link 3.3.3.3
int f0/0
  ipv6 ospf 1 area 0
int s1/0
  ipv6 ospf 1 area 1
end
write memory

! R3
en
conf t
int lo0
  ipv6 ospf 1 area 1
ipv6 router ospf 1
  area 1 virtual-link 2.2.2.2
int f0/0
  ipv6 ospf 1 area 2
int s1/0
  ipv6 ospf 1 area 1
end
write memory

! R4
en
conf t
int lo0
  ipv6 ospf 1 area 2
int f0/0
  ipv6 ospf 1 area 2
end
write memory

■OSPFv3の状態確認

R1#show ipv6 ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
2.2.2.2           1   2WAY/DROTHER    00:00:38    4               FastEthernet0/0

R2#show ipv6 ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
1.1.1.1           1   FULL/BDR        00:00:38    4               FastEthernet0/0
3.3.3.3           1   FULL/  -           -        15              OSPFv3_VL0
3.3.3.3           1   FULL/  -        00:00:30    6               Serial1/0

R3#show ipv6 ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
2.2.2.2           1   FULL/  -           -        15              OSPFv3_VL0
2.2.2.2           1   FULL/  -        00:00:36    6               Serial1/0
4.4.4.4           1   FULL/DR         00:00:32    4               FastEthernet0/0

R4#show ipv6 ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface
3.3.3.3           1   FULL/BDR        00:00:31    4               FastEthernet0/0

R1#show ipv6 route ospf 
IPv6 Routing Table - 11 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
OI  2011:8:8:2::/64 [110/74]
     via FE80::C001:6CFF:FE94:0, FastEthernet0/0
OI  2011:8:8:2::2/128 [110/10]
     via FE80::C001:6CFF:FE94:0, FastEthernet0/0
OI  2011:8:8:3::/64 [110/84]
     via FE80::C001:6CFF:FE94:0, FastEthernet0/0
O   FE01:2::2/128 [110/10]
     via FE80::C001:6CFF:FE94:0, FastEthernet0/0
OI  FE01:3::3/128 [110/74]
     via FE80::C001:6CFF:FE94:0, FastEthernet0/0
OI  FE01:4::4/128 [110/84]
     via FE80::C001:6CFF:FE94:0, FastEthernet0/0

R2#show ipv6 route ospf 
IPv6 Routing Table - 11 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
OI  2011:8:8:3::/64 [110/74]
     via FE80::C002:6CFF:FE94:0, Serial1/0
O   FE01:1::1/128 [110/10]
     via FE80::C000:6CFF:FE94:0, FastEthernet0/0
O   FE01:3::3/128 [110/64]
     via FE80::C002:6CFF:FE94:0, Serial1/0
OI  FE01:4::4/128 [110/74]
     via FE80::C002:6CFF:FE94:0, Serial1/0

R3#show ipv6 route ospf 
IPv6 Routing Table - 12 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
O   2011:8:8:1::/64 [110/74]
     via FE80::C001:6CFF:FE94:0, Serial1/0
O   2011:8:8:2::2/128 [110/64]
     via FE80::C001:6CFF:FE94:0, Serial1/0
O   FE01:1::1/128 [110/74]
     via FE80::C001:6CFF:FE94:0, Serial1/0
O   FE01:2::2/128 [110/64]
     via FE80::C001:6CFF:FE94:0, Serial1/0
O   FE01:4::4/128 [110/10]
     via FE80::C003:6CFF:FE94:0, FastEthernet0/0

R4#show ipv6 route ospf 
IPv6 Routing Table - 11 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
OI  2011:8:8:1::/64 [110/84]
     via FE80::C002:6CFF:FE94:0, FastEthernet0/0
OI  2011:8:8:2::/64 [110/74]
     via FE80::C002:6CFF:FE94:0, FastEthernet0/0
OI  2011:8:8:2::2/128 [110/74]
     via FE80::C002:6CFF:FE94:0, FastEthernet0/0
OI  FE01:1::1/128 [110/84]
     via FE80::C002:6CFF:FE94:0, FastEthernet0/0
OI  FE01:2::2/128 [110/74]
     via FE80::C002:6CFF:FE94:0, FastEthernet0/0
OI  FE01:3::3/128 [110/10]
     via FE80::C002:6CFF:FE94:0, FastEthernet0/0

■OSPFv3の疎通確認

R1#ping ipv6 FE01:4::4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE01:4::4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/71/88 ms

R4#ping ipv6 FE01:1::1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE01:1::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/61/76 ms

■GNS3のトポロジー

=> show run
autostart = False
[127.0.0.1:7203]
    workingdir = /tmp
    udp = 10301
    [[3725]]
        image = /Images/ios/c3725-adventerprisek9-mz.124-15.T14.image
        idlepc = 0x601c9390
        sparsemem = True
        ghostios = True
    [[ROUTER R4]]
        model = 3725
        console = 2104
        aux = 2504
        cnfg = /Projects/ccnp_IPv6/configs/R4.cfg
        f0/0 = R3 f0/0
    [[ROUTER R1]]
        model = 3725
        console = 2101
        aux = 2501
        cnfg = /Projects/ccnp_IPv6/configs/R1.cfg
        f0/0 = R2 f0/0
    [[ROUTER R2]]
        model = 3725
        console = 2102
        aux = 2502
        cnfg = /Projects/ccnp_IPv6/configs/R2.cfg
        f0/0 = R1 f0/0
        slot1 = NM-4T
        s1/0 = R3 s1/0
    [[ROUTER R3]]
        model = 3725
        console = 2103
        aux = 2503
        cnfg = /Projects/ccnp_IPv6/configs/R3.cfg
        f0/0 = R4 f0/0
        slot1 = NM-4T
        s1/0 = R2 s1/0