このブログを検索

2015/02/11

IPv6アドレス

interface GigabitEthernet2/0
 ip address 100.0.2.1 255.255.255.252
 negotiation auto
 ipv6 address autoconfig
!






R2#sho ipv6 interface
GigabitEthernet2/0 is up, line protocol is up
  IPv6 is enabled, link-local address is FE80::C802:10FF:FEDC:38
  No global unicast address is configured
  Joined group address(es):
    FF02::1
    FF02::2
    FF02::1:FFDC:38
  MTU is 1500 bytes
  ICMP error messages limited to one every 100 milliseconds
  ICMP redirects are enabled
  ND DAD is enabled, number of DAD attempts: 1
  ND reachable time is 30000 milliseconds
  ND advertised reachable time is 0 milliseconds
  ND advertised retransmit interval is 0 milliseconds
  ND router advertisements are sent every 200 seconds
  ND router advertisements live for 1800 seconds
  Hosts use stateless autoconfig for addresses.



FE80で始まっているのが、自動的に設定されたIPv6アドレスか。



R2#sho interfaces gigabitEthernet 2/0
GigabitEthernet2/0 is up, line protocol is up
  Hardware is 82543, address is ca02.10dc.0038 (bia ca02.10dc.0038)
  Internet address is 100.0.2.1/30
  MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 1000Mb/s, link type is autonegotiation, media type is SX
  output flow-control is unsupported, input flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:01, output 00:00:01, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     2265 packets input, 221225 bytes, 0 no buffer
     Received 1254 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     2292 packets output, 224989 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 pause output
     0 output buffer failures, 0 output buffers swapped out
R2#


show interfaceでみると、 mac address は ca02.10dc.0038

EUI-64方式のアドレス決定方式に当てはめてみる。

二つにわけて、間にFFFEをはさむ

ca0210 fffe dc0038

先頭から7ビット目を反転する

c → 00001100 → 00001110 → e

ea0210fffedc0038

あれ、違う

ca → 11001010 → 11001000 → c8

c802... あってる。






R2#ping ipv6 fe80::c803:aff:fedc:38
Output Interface: gigabitethernet2/0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::C803:AFF:FEDC:38, timeout is 2 seconds:
Packet sent with a source address of FE80::C802:10FF:FEDC:38
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/246/1104 ms
R2#



なんでpingのときにインターフェイスを指定させられるんだろう?


今のはlink local addressだった。


prefixを指定して、global unicastアドレスを自動設定することもできる。



R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#interface gigabitEthernet 1/0
R2(config-if)#ipv6 address ?
  WORD                General prefix name
  X:X:X:X::X          IPv6 link-local address
  X:X:X:X::X/<0-128>  IPv6 prefix
  autoconfig          Obtain address using autoconfiguration

R2(config-if)#ipv6 address 1234::/48 ?
  anycast  Configure as an anycast
  eui-64   Use eui-64 interface identifier
  <cr>

R2(config-if)#ipv6 address 1234::/48 eui-64
R2(config-if)#end


R2#sho ipv6 interface
GigabitEthernet1/0 is up, line protocol is up
  IPv6 is enabled, link-local address is FE80::C802:10FF:FEDC:1C
  Global unicast address(es):
    2002::, subnet is 2002::/64
    2002::C802:10FF:FEDC:1C, subnet is 2002::/64 [EUI]
  Joined group address(es):
    FF02::1
    FF02::2
    FF02::1:FF00:0
    FF02::1:FFDC:1C
  MTU is 1500 bytes
  ICMP error messages limited to one every 100 milliseconds
  ICMP redirects are enabled
  ND DAD is enabled, number of DAD attempts: 1
  ND reachable time is 30000 milliseconds
  ND advertised reachable time is 0 milliseconds
  ND advertised retransmit interval is 0 milliseconds
  ND router advertisements are sent every 200 seconds
  ND router advertisements live for 1800 seconds
  Hosts use stateless autoconfig for addresses.