Thursday 6 October 2016

Understanding IPv6 Address through examples

Network diagram:

Router0-----------------------------------------Router1

Two routers directly connected using  cross over cable.

Example 1.

Router 0: Router(config)#int g0/0
Router(config-if)#ipv6 add
Router(config-if)#ipv6 address 1::1/64
Router(config-if)#no shut 
Router(config)#ipv6 unicast-routing


Router1:
Router(config)#int g0/0
Router(config-if)#ipv6 add
Router(config-if)#ipv6 address 1::2/64
Router(config-if)#no shut
Router(config)#ipv6 unicast-routing

Ping works Both ends.

Router#ping ipv6 1::2

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

Router#ping ipv6 1::1

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

Example2:

I change IP address prefix to
ipv6 address 1::2/65 ...still pings
/63 pings,...even /0 pings

/0 to /124 Pings.........

but
/125 to /128 does not ping with the IP's 1::1 and 1::2

Why ?
simply put the last Hexadecimal on the right in either case
varies, 1 and 2.And upto 124 bits they match.above 124 bits
they do not match.

IPv6 Address is 32 Hexadecimal numbers.
Each Hexadecimal is represented by 4 binary numbers.
Therefore 32*4 = 128 Bits in a Total. 

Hence the prefix part must match.
The /part Bits the prefix bits must match.

Note one IP can have /64 as prefix and the other IP /124 as prefix.
No problem , Ping works between IP's 1::1 and 1::2.

I just add another hex value say convert the IP 1::2 to 1::A2
now no Ping as bits miss-match.

Now if Ping should work I should use 1::A2/120
Reduce the /124 prefix by 4 bits to /120. 






No comments:

Post a Comment