このブログを検索

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

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#



2015/01/14

aggressive mode

TARO#sho running-config
Building configuration...

Current configuration : 1613 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname TARO
!
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
 encr 3des
 hash md5
 authentication pre-share
 group 2
 lifetime 28800
crypto isakmp key CISCO address 200.0.0.2 255.255.255.0
crypto isakmp keepalive 100
!
crypto isakmp peer address 200.0.0.2
 set aggressive-mode password CISCO
 set aggressive-mode client-endpoint fqdn TARO
!
!
crypto ipsec transform-set IPSEC esp-3des esp-md5-hmac
!
crypto map MAP1 1 ipsec-isakmp
 set peer 200.0.0.2
 set transform-set IPSEC
 match address 101
!
!
!
!
interface FastEthernet0/0
 ip address 172.16.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 100.0.0.1 255.255.255.0
 negotiation auto
 crypto map MAP1
!
interface GigabitEthernet2/0
 no ip address
 shutdown
 negotiation auto
!
ip route 0.0.0.0 0.0.0.0 100.0.0.2
ip route 172.16.2.0 255.255.255.0 100.0.0.2
!
no ip http server
no ip http secure-server
!
!
access-list 101 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
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











HANAKO#sho run
Building configuration...

Current configuration : 1552 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname HANAKO
!
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
 encr 3des
 hash md5
 authentication pre-share
 group 2
 lifetime 28800
crypto isakmp key CISCO hostname TARO
crypto isakmp keepalive 100
!
!
crypto ipsec transform-set IPSEC esp-3des esp-md5-hmac
!
crypto dynamic-map DYNA1 10
 set transform-set IPSEC
 match address 101
!
!
!
crypto map MAINMAP 1 ipsec-isakmp dynamic DYNA1
!
!
!
!
interface FastEthernet0/0
 ip address 172.16.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 200.0.0.2 255.255.255.0
 negotiation auto
 crypto map MAINMAP
!
ip route 0.0.0.0 0.0.0.0 200.0.0.1
ip route 172.16.1.0 255.255.255.0 100.0.0.1
ip route 172.16.1.0 255.255.255.0 200.0.0.1
!
no ip http server
no ip http secure-server
!
!
access-list 101 permit ip 172.16.2.0 0.0.0.255 172.16.1.0 0.0.0.255
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














TARO#sho cry isa sa
dst             src             state          conn-id slot status
200.0.0.2       100.0.0.1       QM_IDLE              2    0 ACTIVE

TARO#sho cry ipsec sa

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

   protected vrf: (none)
   local  ident (addr/mask/prot/port): (172.16.1.0/255.255.255.0/0/0)
   remote ident (addr/mask/prot/port): (172.16.2.0/255.255.255.0/0/0)
   current_peer 200.0.0.2 port 500
     PERMIT, flags={origin_is_acl,}
    #pkts encaps: 14, #pkts encrypt: 14, #pkts digest: 14
    #pkts decaps: 14, #pkts decrypt: 14, #pkts verify: 14
    #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.: 100.0.0.1, remote crypto endpt.: 200.0.0.2
     path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet1/0
     current outbound spi: 0x78C3B43C(2026091580)

     inbound esp sas:
      spi: 0x9B9A8F46(2610597702)
        transform: esp-3des esp-md5-hmac ,
        in use settings ={Tunnel, }
        conn id: 2001, flow_id: SW:1, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4554095/3565)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0x78C3B43C(2026091580)
        transform: esp-3des esp-md5-hmac ,
        in use settings ={Tunnel, }
        conn id: 2002, flow_id: SW:2, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4554095/3565)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:
TARO#

IPsec

GNS3で。



172.16.1.0/24 - TARO [.1]-(100.0.0.0/24)-[.2] RT [.1]-(200.0.0.0)-[.2] HANAKO - 172.16.2.0/24




TARO#ter len 0
TARO#sho run
Building configuration...

Current configuration : 1490 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname TARO
!
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
 encr 3des
 hash md5
 authentication pre-share
 group 2
 lifetime 28800
crypto isakmp key CISCO address 200.0.0.2 255.255.255.0
crypto isakmp keepalive 100
!
!
crypto ipsec transform-set IPSEC esp-3des esp-md5-hmac
!
crypto map MAP1 1 ipsec-isakmp
 set peer 200.0.0.2
 set transform-set IPSEC
 match address 101
!
!
!
!
interface FastEthernet0/0
 ip address 172.16.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 100.0.0.1 255.255.255.0
 negotiation auto
 crypto map MAP1
!
interface GigabitEthernet2/0
 no ip address
 shutdown
 negotiation auto
!
ip route 0.0.0.0 0.0.0.0 100.0.0.2
ip route 172.16.2.0 255.255.255.0 100.0.0.2
!
no ip http server
no ip http secure-server
!
!
access-list 101 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
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










HANAKO#sho run
Building configuration...

Current configuration : 1492 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname HANAKO
!
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
 encr 3des
 hash md5
 authentication pre-share
 group 2
 lifetime 28800
crypto isakmp key CISCO address 100.0.0.1 255.255.255.0
crypto isakmp keepalive 100
!
!
crypto ipsec transform-set IPSEC esp-3des esp-md5-hmac
!
crypto map MAP1 1 ipsec-isakmp
 set peer 100.0.0.1
 set transform-set IPSEC
 match address 101
!
!
!
!
interface FastEthernet0/0
 ip address 172.16.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 200.0.0.2 255.255.255.0
 negotiation auto
 crypto map MAP1
!
ip route 0.0.0.0 0.0.0.0 200.0.0.1
ip route 172.16.1.0 255.255.255.0 200.0.0.1
!
no ip http server
no ip http secure-server
!
!
access-list 101 permit ip 172.16.2.0 0.0.0.255 172.16.1.0 0.0.0.255
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

HANAKO#





TARO#ping 172.16.2.254 source 172.16.1.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.254, timeout is 2 seconds:
Packet sent with a source address of 172.16.1.254
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 68/94/116 ms
TARO#
TARO#
TARO#
TARO#sho cry isa sa
dst             src             state          conn-id slot status
200.0.0.2       100.0.0.1       QM_IDLE              1    0 ACTIVE

TARO#sho cry ipsec sa

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

   protected vrf: (none)
   local  ident (addr/mask/prot/port): (172.16.1.0/255.255.255.0/0/0)
   remote ident (addr/mask/prot/port): (172.16.2.0/255.255.255.0/0/0)
   current_peer 200.0.0.2 port 500
     PERMIT, flags={origin_is_acl,ipsec_sa_request_sent}
    #pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4
    #pkts decaps: 4, #pkts decrypt: 4, #pkts verify: 4
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 1, #recv errors 0

     local crypto endpt.: 100.0.0.1, remote crypto endpt.: 200.0.0.2
     path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet1/0
     current outbound spi: 0xD05FC0B9(3495936185)

     inbound esp sas:
      spi: 0xA794FBD4(2811558868)
        transform: esp-3des esp-md5-hmac ,
        in use settings ={Tunnel, }
        conn id: 2001, flow_id: SW:1, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4540909/3589)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0xD05FC0B9(3495936185)
        transform: esp-3des esp-md5-hmac ,
        in use settings ={Tunnel, }
        conn id: 2002, flow_id: SW:2, crypto map: MAP1
        sa timing: remaining key lifetime (k/sec): (4540909/3589)
        IV size: 8 bytes
        replay detection support: Y
        Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:
TARO#






2014/10/23

行き詰まり

最近行き詰っている。

ルーティングとは何か?ルータとは何か?インターネットとは何か?

TCP/IPとは?ウェブとは?クラウドとは?L3スイッチとは?

BGPとは?OSPFとは?

冗長?経路?アドレス?


一応、どんなものでどんな風に使われどんな風に設定しどんな風に動くのかはなんとなく理解している。

しかし、なぜこうでなくてはならないのか、ほかにもっといい方法がないのか、とか、

どうしてOSPFなのか、どうしてBGPなのか、

なぜ冗長化するのか、なぜcatalystなのか、nexusなのか、という、根拠というか理由というか、
動機というのか、そういうものがわからない。



そもそも、ネットワークとはなんだろう。

そんなことすら考える。


ネットワークとは、「接続」のことか。

一番単純なネットワークは、2点間の間を結ぶことだ。

糸電話のような。


「通信」とはなにか。「接続」と「通信」の何が違うのか。

ルーティングとスイッチングとは、それぞれどういうことか。


両方「ネットワーク」に分類されるが、違うものである。

よく言われるのはL3(えるさん)、L2(えるに、えるつー)であるが、
果たしてそれらはそれぞれどういうものなのか。

本当にみんなわかっているのか?



1秒の通信断が発生すると、何が起きるのか。
パケットが一つ落ちると、どうなるのか。


電車の中でスマホでウェブを見ている人に何が起きるのか。

家のパソコンでオンラインゲームをしている人にどんな影響があるのか。


メールを受信中に、メールサーバとクライアントの間のどこかで0.5秒の通信断が発生したら、
どうなるのか。



「TCPは再送機能があるがUDPにはないからドロップする」というが、
youtubeを視聴中にパケットが一個おちたらどうなるのか。


マルチキャストを利用した通信というかサービスは具体的に何か?


ウェブ(グーグル)で検索して得られる情報、資格試験受験のための参考書に書いてあること、
その他一般的に言われること、

それらと自分がインターネットやATMやiPhoneや漫画喫茶などで通信・サービスを利用していることの間に、もやもやとしたものがある。

もしかして私は重要な誤解をしている、あるいは重大な認識不足があるのではないか?

そんな気がしてならない。


とりあえず、「インターネットルーティング入門」という本を買った。

2008/12/23

続続続・IPsecをやってみる (NEC & FITELnet)

では次に、FITELnetとNEC

PC1 ---- F100 ---- IX2004 --- PC2

シリアルケーブル買ってきました。IX2004のために。
要は、モデムとつなぐときはストレート、PC同士はクロス、ということです。

あっさりできた。

FITEL#sho cry isa sa
[ 1] 100.0.0.2
<--> 100.0.0.1
 Main Mode UP pre-shared key DES MD5
Lifetime : 600secs
Current : 19secs,1kbytes
mcfg config-mode: off
mcfg addr: off
mcfg apl-version:
IKE Keepalive: dpd
ICMP Keepalive: off
release on addr-change: off

FITEL#sho cry isa policy
Protection suite priority [1]
authentication method : preshared key
encryption algorithm : DES - Data Encryption Standard (56 bit keys)
Diffie-Hellman Group : #1 (768 bit)
hash algorithm : Message Digest 5
lifetime : 600 seconds, no volume limit
Disabled frequency : 0

Default protection suite
authentication method : preshared key
encryption algorithm : DES - Data Encryption Standard (56 bit keys)
hash algorithm : Message Digest 5
Diffie-Hellman Group : #1 (768 bit)
lifetime : 1000 seconds, no volume limit


FITEL#sho running.cfg
!
! FITELnet-F100
! Firmware version: V02.07(02) 032307
!
ip route 0.0.0.0 0.0.0.0 100.0.0.2
!
access-list 1 permit 192.168.1.0 0.0.0.255
!
vpn enable
vpnlog enable
!
ipsec access-list 1 ipsec ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
ipsec access-list 64 bypass ip any any
ipsec transform-set P2-des-md5 esp-des esp-md5-hmac
!
service dhcp-server
!
hostname FITEL
!
ip dhcp pool lan1
exit
!
interface ewan 1
crypto map kyoten
ip address 100.0.0.1 255.255.255.0
ip nat inside source list 1 interface
exit
interface ewan 2
exit
interface lan 1
ip address 192.168.1.254 255.255.255.0
exit
!
!
crypto isakmp policy 1
authentication prekey
encryption des
group 1
hash md5
idtype-pre userfqdn
key ascii secret
lifetime 600
negotiation-mode main
peer-identity address 100.0.0.2
exit
crypto map kyoten 1
match address 1
set peer address 100.0.0.2
set transform-set P2-des-md5
exit
crypto security-association
exit
!
end





Router(config)# sho running-config
!
ip route 192.168.1.0/24 Tunnel0.0
ip access-list list1 permit ip src 192.168.2.0 0.0.0.255 dest 192.168.1.0 0.0.0.255
!
ike proposal ike-prop encryption des hash md5 lifetime 600
!
ike policy ike-policy peer 100.0.0.1 key secret ike-prop
!
ipsec autokey-map ipsec-policy list1 peer 100.0.0.1 default
ipsec local-id ipsec-policy 192.168.2.0/24
ipsec remote-id ipsec-policy 192.168.1.0/24
!
telnet-server ip enable
!
device FastEthernet0
!
device FastEthernet1
!
interface FastEthernet0.0
ip address 100.0.0.2/24
no shutdown
!
interface FastEthernet1.0
ip address 192.168.2.254/24
no shutdown
!
interface Loopback0.0
no ip address
!
interface Null0.0
no ip address
!
interface AutoTunnel0.0
no ip address
shutdown
!
interface Tunnel0.0
tunnel mode ipsec
ip unnumbered FastEthernet1.0
ipsec policy tunnel ipsec-policy out
no shutdown
Router(config)#
Router(config)# sho ike sa
ISAKMP SA - 1 configured, 1 created
Local address is 100.0.0.2
Remote address is 100.0.0.1
IKE policy name is ike-policy
Direction is responder
Initiator's cookie is 0xfc6bbe87ce000000
Responder's cookie is 0xba77d813c2ce6e0d
Exchange type is main mode
State is established
Authentication method is pre-shared
Encryption algorithm is des
Hash algorithm is md5
DH group is modp768, lifetime is 414 seconds
#ph1 success: 1, #ph1 failure: 0
#ph1 hash err: 0, #ph1 timeout: 0, #ph1 resend: 0
#ph2 success: 1, #ph2 failure: 0
#ph2 hash err: 0, #ph2 timeout: 0, #ph2 resend: 0
Router(config)#
Router(config)# sho ike statistics
Phase1 Statistics:
1 success, 0 failure, 0 hash errors
0 config errors, 0 timeout errors, 0 resend packet

Phase2 Statistics:
1 success, 0 failure, 0 request errors, 0 hash errors
0 config errors, 0 timeout errors, 0 resend packet

IKE Informations:
Notify message type
Rcvd: 0 invalid payload type, 0 doi not supported
0 situation not supported, 0 invalid cookie
0 invalid major version, 0 invalid minor version
0 invalid exchange type, 0 invalid flags, 0 invalid message id
0 invalid protocol id, 0 invalid spi, 0 invalid transform id
0 attributes not supported, 0 no proposal chosen
0 bad proposal syntax, 0 payload malformed
0 invalid key information, 0 invalid id information
0 invalid cert encoding, 0 invalid certificate
0 cert type unsupported, 0 invalid cert authority
0 invalid hash information, 0 authentication failed
0 invalid signature, 0 address notification
0 notify sa lifetime, 0 certificate unavailable
0 unsupported exchange type, 0 unequal payload lengths
0 connected
0 responder lifetime, 0 replay status, 1 initial contact
0 keepalive, 0 keepalive ack
0 unknown type
Sent: 0 invalid payload type, 0 doi not supported
0 situation not supported, 0 invalid cookie
0 invalid major version, 0 invalid minor version
0 invalid exchange type, 0 invalid flags, 0 invalid message id
0 invalid protocol id, 0 invalid spi, 0 invalid transform id
0 attributes not supported, 0 no proposal chosen
0 bad proposal syntax, 0 payload malformed
0 invalid key information, 0 invalid id information
0 invalid cert encoding, 0 invalid certificate
0 cert type unsupported, 0 invalid cert authority
0 invalid hash information, 0 authentication failed
0 invalid signature, 0 address notification
0 notify sa lifetime, 0 certificate unavailable
0 unsupported exchange type, 0 unequal payload lengths
0 connected
0 responder lifetime, 0 replay status, 0 initial contact
0 keepalive, 0 keepalive ack
0 unknown type
Delete protocol type
Rcvd: 0 isakmp, 0 ah, 0 esp
0 unknown type
Sent: 0 isakmp, 0 ah, 0 esp
0 unknown type
Router(config)#
sho ipsec sa
IPsec SA - 1 configured, 2 created
Interface is Tunnel0.0
Key policy map name is ipsec-policy
Tunnel mode, 4-over-4, autokey-map
Local address is 100.0.0.2
Remote address is 100.0.0.1
Outgoing interface is FastEthernet0.0
Interface MTU is 1446, path MTU is 1500
Inbound:
ESP, SPI is 0x9566dd14(2506546452)
Transform is ESP-DES-HMAC-MD5-96
Remaining lifetime is 393 seconds
Replay detection support is on
Outbound:
ESP, SPI is 0x3ae07975(987789685)
Transform is ESP-DES-HMAC-MD5-96
Remaining lifetime is 393 seconds
Replay detection support is on
Perfect forward secrecy is off
Router(config)#

というわけで・・・

ix2004,
FITELnet F100 x 3,
シリアルケーブル(クロス) for FITELnet、
シリアルケーブル(ストレート) for IX,
某ソフト registration・・・
Dynamipsインストール、
Catalyst引っ張り出し・・・

シリアルのストレートケーブルというのは、昔モデムに接続するときに使ったものである。多分、コンシューマ向け(?)のちっちゃいルータ(IX2004とか)は、それと同じケーブルでつなげるようにと、ストレートでつなぐようになっているのだろう。

一方、FITELnet F100はシリアルのリバース(クロス)ケーブルでつなぐ。
このケーブルは、PC同士をつないでデータ転送をするような時に使う。

私も昔、かってつないだような記憶がある。 「ある程度の大きなルータになると、PC扱いになるのでクロスでつなぐ・・・」というのは私の覚え方。

結線は

1 --- 7&8
2 --- 3
3 --- 2
4 --- 6
5 --- 5
6 --- 4
7&8 --- 1
フレーム --- フレーム

だとさ

続続・IPsecをやってみる (Cisco & FITELnet)

ここまでは、サンプルをいれただけなのでできて当然。 

問題は、異なる機種間での相互接続である。

 それじゃ、まず、cisco --- FITELnet をやってみようか?

PC1 ---- F100 --- R1 --- R2

PC1: 192.168.1.10
F100: 192.168.1.254, 100.0.0.1
R1: 100.0.0.2, 192.168.2.254
R2: 192.168.2.1

 R1とR2はDynamipsでemulateしたCisco7200


R1#sho running-config

Building configuration...

Current configuration : 1811 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
!
!
ip cef
!
!
crypto isakmp policy 1
hash md5
authentication pre-share
lifetime 600
crypto isakmp key secret address 100.0.0.1 255.255.255.0
!
crypto ipsec security-association lifetime seconds 1000
!
crypto ipsec transform-set IPSEC esp-des esp-md5-hmac
!
crypto map MAP1 1 ipsec-isakmp
set peer 100.0.0.1
set transform-set IPSEC
match address 101
!
!
!
!
interface FastEthernet0/0
ip address 100.0.0.2 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
crypto map MAP1
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 192.168.2.254 255.255.255.0
serial restart-delay 0
no fair-queue
!
!
ip route 0.0.0.0 0.0.0.0 100.0.0.1
!
no ip http server
no ip http secure-server
!
ip nat inside source list 1 interface FastEthernet0/0 overload
!
access-list 1 permit 192.168.2.0 0.0.0.255
access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
!





FITEL#sho running.cfg

!
! FITELnet-F100
! Firmware version: V02.07(02) 032307
!
!
!
ip route 0.0.0.0 0.0.0.0 100.0.0.2
!
access-list 1 permit 192.168.1.0 0.0.0.255
!
vpn enable
vpnlog enable
!
ipsec access-list 1 ipsec ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
ipsec access-list 64 bypass ip any any
ipsec transform-set P2-des-md5 esp-des esp-md5-hmac
!
service dhcp-server
!
hostname FITEL
!
!
ip dhcp pool lan1
exit
!
interface ewan 1
crypto map kyoten
ip address 100.0.0.1 255.255.255.0
ip nat inside source list 1 interface
exit
interface ewan 2
exit
interface lan 1
ip address 192.168.1.254 255.255.255.0
exit
!
!
crypto isakmp policy 1
authentication prekey
encryption des
group 1
hash md5
idtype-pre userfqdn
key ascii secret
lifetime 600
negotiation-mode main
peer-identity address 100.0.0.2
exit
crypto map kyoten 1
match address 1
set peer address 100.0.0.2
set transform-set P2-des-md5
exit
crypto security-association
exit
!
end








FITEL#sho cry isa sa
[ 1] 100.0.0.2
<--> 100.0.0.1
 Main Mode UP pre-shared key DES MD5
Lifetime : 600secs
Current : 527secs,1kbytes
mcfg config-mode: off
mcfg addr: off
mcfg apl-version:
IKE Keepalive: dpd
ICMP Keepalive: off
release on addr-change: off

FITEL#sho cry ipsec sa
IPSEC SA
current insa : 1
current outsa : 1
[ 1] 192.168.2.0,255.255.255.0 ALL ALL
<--> 192.168.1.0,255.255.255.0 ALL ALL
peer: 100.0.0.2

 UP ESP DES HMAC-MD5 PFS:off
Lifetime: 600secs,4608000kbytes
Anti-Replay: Enable
O-SPI: 0x3b56eeb5 Current: 531secs,1kbytes
out packet : 4 error packet : 0
I-SPI: 0x105e8a87 Current: 531secs,1kbytes
in packet : 4 auth packet : 4
decrypt packet : 4 discard packet : 0
replay packet : 0 auth error packet : 0

FITEL#sho cry isakmp policy
Protection suite priority [1]
authentication method : preshared key
encryption algorithm : DES - Data Encryption Standard (56 bit keys)
Diffie-Hellman Group : #1 (768 bit)
hash algorithm : Message Digest 5
lifetime : 600 seconds, no volume limit
Disabled frequency : 0

Default protection suite
authentication method : preshared key
encryption algorithm : DES - Data Encryption Standard (56 bit keys)
hash algorithm : Message Digest 5
Diffie-Hellman Group : #1 (768 bit)
lifetime : 1000 seconds, no volume limit





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

R1#sho cry isa sa ?
active Shows HA-enabled ISAKMP SAs in the active state
detail Show ISAKMP SA Detail
nat Show ISAKMP SA NAT Detail
standby Shows HA-enabled ISAKMP SAs in the standby state
vrf Show ISAKMP SA as per VRF
| Output modifiers


R1#sho cry isa sa det
R1#sho cry isa sa detail
Codes: C - IKE configuration mode, D - Dead Peer Detection
K - Keepalives, N - NAT-traversal
X - IKE Extended Authentication
psk - Preshared key, rsig - RSA signature
renc - RSA encryption

C-id Local Remote I-VRF Status Encr Hash Auth DH Lifetime Cap.
1 100.0.0.2 100.0.0.1 ACTIVE des md5 psk 1 00:00:42
Connection-id:Engine-id = 1:1(software)
R1#
R1#sho cry ipsec sa

interface: FastEthernet0/0
Crypto map tag: MAP1, local addr 100.0.0.2

protected vrf: (none)
local ident (addr/mask/prot/port): (192.168.2.0/255.255.255.0/0/0)
remote ident (addr/mask/prot/port): (192.168.1.0/255.255.255.0/0/0)
current_peer 100.0.0.1 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4
#pkts decaps: 4, #pkts decrypt: 4, #pkts verify: 4
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 1, #recv errors 0

local crypto endpt.: 100.0.0.2, remote crypto endpt.: 100.0.0.1
path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0/0
current outbound spi: 0x105E8A87(274631303)

inbound esp sas:
spi: 0x3B56EEB5(995552949)
transform: esp-des esp-md5-hmac ,
in use settings ={Tunnel, }
conn id: 2001, flow_id: SW:1, crypto map: MAP1
sa timing: remaining key lifetime (k/sec): (4421774/438)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE

inbound ah sas:

inbound pcp sas:

outbound esp sas:
spi: 0x105E8A87(274631303)
transform: esp-des esp-md5-hmac ,
in use settings ={Tunnel, }
conn id: 2002, flow_id: SW:2, crypto map: MAP1
sa timing: remaining key lifetime (k/sec): (4421774/437)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE

outbound ah sas:

outbound pcp sas:

R1#R1#sho cry isakmp policy

Global IKE policy
Protection suite of priority 1
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Message Digest 5
authentication method: Pre-Shared Key
Diffie-Hellman group: #1 (768 bit)
lifetime: 600 seconds, no volume limit
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
R1#

続・IPsecをやってみる (FITELnet)

今度はfitelnetでやってみました。

PC1 ---- R1 ---- R2 ---- PC2

PC1: 192.168.1.13
R1: 192.168.1.254, 100.0.0.1
R2: 192.168.2.254, 100.0.0.2
PC2: 192.168.2.1

natあり

R1#sho running.cfg
!
! FITELnet-F100
! Firmware version: V02.07(02) 032307
!
ip route 0.0.0.0 0.0.0.0 ewan 1
!
access-list 1 permit 192.168.1.0 0.0.0.255
!
vpn enable
vpnlog enable
!
ipsec access-list 1 ipsec ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
ipsec access-list 64 bypass ip any any
ipsec transform-set P2-des-md5 esp-des esp-md5-hmac
!
service dhcp-server
!
hostname R1
!
ip dhcp pool lan1
exit
!
interface ewan 1
crypto map kyoten
ip address 100.0.0.1 255.255.255.0
ip nat inside source list 1 interface
exit
interface ewan 2
exit
interface lan 1
ip address 192.168.1.254 255.255.255.0
exit
!
crypto isakmp policy 1
authentication prekey
encryption des
hash md5
idtype-pre userfqdn
key ascii secret
negotiation-mode main
peer-identity address 100.0.0.2
exit
crypto map kyoten 1
match address 1
set peer address 100.0.0.2
set transform-set P2-des-md5
exit
!
end


R2#sho running.cfg
!
! FITELnet-F100
! Firmware version: V02.07(02) 032307
!
ip route 0.0.0.0 0.0.0.0 ewan 1
ip route 192.168.1.0 255.255.255.0 100.0.0.1
!
access-list 1 permit 192.168.2.0 0.0.0.255
!
vpn enable
!
ipsec access-list 1 ipsec ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
ipsec access-list 64 bypass ip any any
ipsec transform-set P2-des-md5 esp-des esp-md5-hmac
!
service dhcp-server
!
hostname R2
!
ip dhcp pool lan1
exit
!
interface ewan 1
crypto map center
ip address 100.0.0.2 255.255.255.0
ip nat inside source list 1 interface
exit
interface ewan 2
exit
interface lan 1
ip address 192.168.2.254 255.255.255.0
exit
!
crypto isakmp policy 1
authentication prekey
encryption des
hash md5
idtype-pre userfqdn
key ascii secret
my-identity kyoten
negotiation-mode main
peer-identity address 100.0.0.1
exit
crypto map center 1
match address 1
set peer address 100.0.0.1
set transform-set P2-des-md5
exit
!
end




R1#sho crypto isakmp sa
[ 1] 100.0.0.2
<--> 100.0.0.1
 Main Mode UP pre-shared key DES MD5
Lifetime : 1000secs
Current : 43secs,1kbytes
mcfg config-mode: off
mcfg addr: off
mcfg apl-version:
IKE Keepalive: dpd
ICMP Keepalive: off
release on addr-change: off

R1#sho cry isakmp policy
Protection suite priority [1]
authentication method : preshared key
encryption algorithm : DES - Data Encryption Standard (56 bit keys)
hash algorithm : Message Digest 5
Disabled frequency : 0

Default protection suite
authentication method : preshared key
encryption algorithm : DES - Data Encryption Standard (56 bit keys)
hash algorithm : Message Digest 5
Diffie-Hellman Group : #1 (768 bit)
lifetime : 1000 seconds, no volume limit


R1#sho crypto ipsec sa
IPSEC SA
current insa : 1
current outsa : 1
[ 1] 192.168.2.0,255.255.255.0 ALL ALL
<--> 192.168.1.0,255.255.255.0 ALL ALL
peer: 100.0.0.2

UP ESP DES HMAC-MD5 PFS:off
Lifetime: 600secs
Anti-Replay: Enable
O-SPI: 0x2c159090 Current: 60secs,1kbytes
out packet : 4 error packet : 0
I-SPI: 0x2b91a660 Current: 60secs,1kbytes
in packet : 4 auth packet : 4
decrypt packet : 4 discard packet : 0
replay packet : 0 auth error packet : 0

2008/12/21

IPsecをやってみる (Dynamips)

Dynamipsは Vista64でも動いた。
ただし、フォルダが読み取り専用になっていたのでそれを直すのと、 telnetはデフォルトで無効になっている(クライアントも)ので有効にする必要がある。 IPsecをやってみます。

  192.168.1.0/24    10.10.10.0/24    192.168.2.0/24
+----+        +----+             +----+        +----+
| R3 +--------+ R1 +-------------+ R2 +--------+ R4 |
+----+.2    .1+----+.1         .2+----+.1    .2+----+

R1


R1#sho running-config
Building configuration...

Current configuration : 1695 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
ip cef
!
crypto isakmp policy 1
encr 3des
hash md5
authentication pre-share
lifetime 28800
crypto isakmp key cisco address 10.10.10.2 255.255.255.0
crypto isakmp keepalive 100
!
crypto ipsec transform-set IPSEC esp-3des esp-md5-hmac
!
crypto map MAP1 1 ipsec-isakmp
set peer 10.10.10.2
set transform-set IPSEC
match address 101
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
duplex half
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 10.10.10.1 255.255.255.0
serial restart-delay 0
crypto map MAP1
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/7
no ip address
shutdown
serial restart-delay 0
!
ip route 192.168.1.0 255.255.255.0 10.10.10.2
ip route 192.168.2.0 255.255.255.0 10.10.10.2
!
no ip http server
no ip http secure-server
!
access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
!
control-plane
!
gatekeeper
shutdown
!
line con 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
!
end


R2

R2#sho running-config
Building configuration...

Current configuration : 1710 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
no aaa new-model
!
ip cef
!
crypto isakmp policy 1
encr 3des
hash md5
authentication pre-share
lifetime 28800
crypto isakmp key cisco address 10.10.10.1 255.255.255.0
crypto isakmp keepalive 100
!
crypto ipsec transform-set IPSEC esp-3des esp-md5-hmac
!
crypto map MAP1 1 ipsec-isakmp
set peer 10.10.10.1
set transform-set IPSEC
match address 101
!
interface FastEthernet0/0
ip address 192.168.2.1 255.255.255.0
duplex half
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 10.10.10.2 255.255.255.0
serial restart-delay 0
no fair-queue
crypto map MAP1
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/4
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/5
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/6
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/7
no ip address
shutdown
serial restart-delay 0
!
ip route 192.168.1.0 255.255.255.0 10.10.10.1
ip route 192.168.2.0 255.255.255.0 10.10.10.1
!
no ip http server
no ip http secure-server
!
access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
!
control-plane
!
gatekeeper
shutdown
line con 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login
end


R3

R3#sho running-config
Building configuration...

Current configuration : 621 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
!
ip cef
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 192.168.1.1
!
no ip http server
no ip http secure-server
!
control-plane
!
gatekeeper
shutdown
!
line con 0
stopbits 1
line aux 0
line vty 0 4
!
end


R4

R4#sho running-config
Building configuration...

Current configuration : 621 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
no aaa new-model
!
ip cef
!
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 192.168.2.1
!
no ip http server
no ip http secure-server
!
control-plane
!
gatekeeper
shutdown
!
line con 0
stopbits 1
line aux 0
line vty 0 4
!
end

設定しただけではIPsec SAは確立しません。
この設定だと、192.168.0/24 <---> 192.168.2.0/24 の通信が発生したときのみ、IPsec 通信が行われます。


R3#ping 192.168.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 220/260/356 ms
R3#


R1#show crypto isakmp sa
dst src state conn-id slot status
10.10.10.2 10.10.10.1 QM_IDLE 1 0 ACTIVE

R1#
R1#sho crypto isakmp peers
Peer: 10.10.10.2 Port: 500 Local: 10.10.10.1
Phase1 id: 10.10.10.2
R1#
R1#sho crypto isakmp policy

Global IKE policy
Protection suite of priority 1
encryption algorithm: Three key triple DES
hash algorithm: Message Digest 5
authentication method: Pre-Shared Key
Diffie-Hellman group: #1 (768 bit)
lifetime: 28800 seconds, no volume limit
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
R1#

08/12/22(Mon) 08:36
R1#sho cry ipsec sa

interface: Serial1/0
Crypto map tag: MAP1, local addr 10.10.10.1

protected vrf: (none)
local ident (addr/mask/prot/port): (192.168.1.0/255.255.255.0/0/0)
remote ident (addr/mask/prot/port): (192.168.2.0/255.255.255.0/0/0)
current_peer 10.10.10.2 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 18, #pkts encrypt: 18, #pkts digest: 18
#pkts decaps: 17, #pkts decrypt: 17, #pkts verify: 17
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 2, #recv errors 0

local crypto endpt.: 10.10.10.1, remote crypto endpt.: 10.10.10.2
path mtu 1500, ip mtu 1500, ip mtu idb Serial1/0
current outbound spi: 0x193624A0(422978720)

inbound esp sas:
spi: 0xC5E6FB2A(3320249130)
transform: esp-3des esp-md5-hmac ,
in use settings ={Tunnel, }
conn id: 2001, flow_id: SW:1, crypto map: MAP1
sa timing: remaining key lifetime (k/sec): (4482477/2342)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE

inbound ah sas:

inbound pcp sas:

outbound esp sas:
spi: 0x193624A0(422978720)
transform: esp-3des esp-md5-hmac ,
in use settings ={Tunnel, }
conn id: 2002, flow_id: SW:2, crypto map: MAP1
sa timing: remaining key lifetime (k/sec): (4482477/2341)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE

outbound ah sas:

outbound pcp sas:
R1#
R1#sho cry ipsec transform-set
Transform set IPSEC: { esp-3des esp-md5-hmac }
will negotiate = { Tunnel, },


R1#sho cry ipsec ?
policy Show IPSEC client policies
profile Show ipsec profile information
sa IPSEC SA table
security-association Show parameters for IPSec security associations
transform-set Crypto transform sets

R1#sho cry ipsec se
R1#sho cry ipsec security-association
Security association lifetime: 4608000 kilobytes/3600 seconds

R1の S1/0をキャプチャしてみると、ISAKMP Identity Protectionが3往復、ISAKMP Quick Modeが1往復半した後に、ESPパケットの通信が開始されている。

 これは vista ultimate 64bitバージョンで、Dynamipsを使って4台の7200をエミュレートしたものである。 

このとき、teratermのログを保存したのだが、そのファイルが見つからなくなった。 しかし、teratermでログを保存するメニューを出すと、ちゃんとファイルが表示される。 と、エクスプローラのメニューに「互換性ファイル」という文字が。 そこをクリックすると表示された。しかし今度は他のファイルが見えなくなる。 エクスプローラをいったん閉じて、再び開くと、またログファイル以外が見える。 この「互換性ファイル」問題は、bitcometを使ったときに出くわしたのだが、 いまだに意味がよくわからない。 まあ、スレ違いの話題なので、これについてはまたの機会に。