Showing posts with label ipv6. Show all posts
Showing posts with label ipv6. Show all posts

Tuesday, November 19, 2013

ISIS Database Reading

 

ISIS is simple to operate normally while everything is working, most common deployments are flat network based on L2, however when there is a problem and we need to start troubleshooting then people start to get lost.

So I would like to provide some tools on how to read ISIS database.

 

  • notice to the “*” sign, that mean LSP was generated on the router you did the show command, you can see that host name from the show command match also host name on the LSPID,
  • LSPID identified by hostname.xx-yy,  xx is normally 00 unless that LSP is pseudo node LSP generated by DIS , yy is representing the number of fragments for that LSP 00 – FF (max 255 fragments, plenty), most cases all the important information will be in 00 unless there are many fragments.
  • LSP Holdtime is the amount of time an LSP will stay in database without any refresh.
  • ATT/P/OL - 0/0/0, ATT bit or attached bit is used on L1/L2 connected to L1 node, if set to 1 L1 node will generate default route to the best L1/L2 node (best metric)
  • ATT/P/OL - 0/0/0, OL bit or overload bit, in the past it was used when router was over loaded to set all links on the router as unusable, preventing others from transiting, that node, today it is used mostly to wait for bgp convergence.

 

P_london_someisp.net#show isis database 
IS-IS Level-2 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
P_london_somei.00-00* 0x00000005   0x65C5        1177              0/0/0
P_dublin_somei.00-00  0x00000004   0x8346        1176              0/0/0
P_cyprus_somei.00-00  0x00000005   0x5634        1183              0/0/0
P_LA_someisp.n.00-00  0x00000005   0xDE33        1175              0/0/0
PE_newyork_som.00-00  0x00000003   0x2EF0        1179              0/0/0
PE_telaviv_som.00-00  0x00000004   0x2877        1181              0/0/0
PE_Jerusalem_s.00-00  0x00000002   0x2994        1172              0/0/0
PE_Jerusalem_s.02-00  0x00000001   0x2ED2        1171              0/0/0

From the database each router build a topology using SPF (dijkstra algorithm), if I would like to understand how to get from one router to another I can look into the ISIS database detail and understand that:

For the example, I would like to see only with the database, how to get from my self
to PE_telaviv without looking into the topology or routing table (just for fun): 
Notice that according to my LSP I can see the neighbors I am connected to, and the net address
for each link along with metric.
P_london_someisp.net#$atabase  level-2 det P_london_someisp.net.00-00   
IS-IS Level-2 LSP P_london_somei.00-00
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
P_london_somei.00-00* 0x00000006   0x63C6        409               0/0/0
  Area Address: 49.0001
  NLPID:        0xCC 
  Hostname: P_london_someisp.net
  IP Address:   1.1.1.1
  Metric: 10         IS-Extended P_dublin_somei.00
  Metric: 10         IS-Extended P_cyprus_somei.00
  Metric: 10         IS-Extended P_LA_someisp.n.00
  Metric: 10         IS-Extended PE_newyork_som.00
  Metric: 10         IP 1.1.1.1/32
  Metric: 10         IP 10.100.1.4/30
  Metric: 10         IP 10.100.1.16/30
  Metric: 10         IP 10.100.1.20/30
  Metric: 10         IP 10.100.1.24/30
P_london_someisp.net#

 

 

now if I take the first neighbor from my LSP P_dublin and look into his LSP:
notice that one of his neighbors is PE_telaviv.
So 10 to reach dublin + 10 to reach telaviv = 20 total cost from london to telaviv 
I have taken the next neighbor cyprus and it looks like we have also 20 metric path using 
cyprus, so we will have load sharing between them.
notice that P_LA and PE_newyork does not have direct link to PE_telaviv, that mean we do not
need to explorer more in that direction as any route using them will have higher cost.

 

 

P_london_someisp.net#$atabase  level-2 det P_dublin_someisp.net.00-00
IS-IS Level-2 LSP P_dublin_somei.00-00
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
P_dublin_somei.00-00  0x00000006   0x7F48        1077              0/0/0
  Area Address: 49.0001
  NLPID:        0xCC 
  Hostname: P_dublin_someisp.net
  IP Address:   2.2.2.2
  Metric: 10         IS-Extended P_london_somei.00
  Metric: 10         IS-Extended P_cyprus_somei.00
  Metric: 10         IS-Extended P_LA_someisp.n.00
  Metric: 10         IS-Extended PE_telaviv_som.00
  Metric: 10         IP 2.2.2.2/32
  Metric: 10         IP 10.100.1.0/30
  Metric: 10         IP 10.100.1.12/30
  Metric: 10         IP 10.100.1.16/30
  Metric: 10         IP 10.100.1.36/30
P_london_someisp.net#$atabase  level-2 det P_cyprus_someisp.net.00-00
IS-IS Level-2 LSP P_cyprus_somei.00-00
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
P_cyprus_somei.00-00  0x00000007   0x5236        854               0/0/0
  Area Address: 49.0001
  NLPID:        0xCC 
  Hostname: P_cyprus_someisp.net
  IP Address:   3.3.3.3
  Metric: 10         IS-Extended P_london_somei.00
  Metric: 10         IS-Extended P_dublin_somei.00
  Metric: 10         IS-Extended P_LA_someisp.n.00
  Metric: 10         IS-Extended PE_telaviv_som.00
  Metric: 10         IS-Extended PE_Jerusalem_s.02
  Metric: 10         IP 3.3.3.3/32
  Metric: 10         IP 10.100.1.0/30
  Metric: 10         IP 10.100.1.4/30
  Metric: 10         IP 10.100.1.8/30
  Metric: 10         IP 10.100.1.32/30
  Metric: 10         IP 20.0.0.0/24
P_london_someisp.net#$atabase  level-2 det P_LA_someisp.net.00-00    
IS-IS Level-2 LSP P_LA_someisp.n.00-00
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
P_LA_someisp.n.00-00  0x00000007   0xDA35        690               0/0/0
  Area Address: 49.0001
  NLPID:        0xCC 
  Hostname: P_LA_someisp.net
  IP Address:   4.4.4.4
  Metric: 10         IS-Extended P_london_somei.00
  Metric: 10         IS-Extended P_dublin_somei.00
  Metric: 10         IS-Extended P_cyprus_somei.00
  Metric: 10         IS-Extended PE_newyork_som.00
  Metric: 10         IP 4.4.4.4/32
  Metric: 10         IP 10.100.1.8/30
  Metric: 10         IP 10.100.1.12/30
  Metric: 10         IP 10.100.1.20/30
  Metric: 10         IP 10.100.1.28/30
P_london_someisp.net#show isis database  level-2 det PE_newyork_someisp.net.00$
IS-IS Level-2 LSP PE_newyork_som.00-00
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
PE_newyork_som.00-00  0x00000005   0x2AF2        499               0/0/0
  Area Address: 49.0001
  NLPID:        0xCC 
  Hostname: PE_newyork_someisp.net
  IP Address:   5.5.5.5
  Metric: 10         IS P_london_somei.00
  Metric: 10         IS P_LA_someisp.n.00
  Metric: 10         IS-Extended P_london_somei.00
  Metric: 10         IS-Extended P_LA_someisp.n.00
  Metric: 10         IP 5.5.5.5/32
  Metric: 10         IP 10.100.1.24/30
  Metric: 10         IP 10.100.1.28/30
  Metric: 10         IP 5.5.5.5 255.255.255.255
  Metric: 10         IP 10.100.1.24 255.255.255.252
  Metric: 10         IP 10.100.1.28 255.255.255.252

 

 

To see the topology now and see if we are on the right track, notice that we are correct 20 metric
one with dublin and the other trough cyprus with 20 metric doing load sharing.

 

 

P_london_someisp.net#show isis topology 
IS-IS paths to level-2 routers
System Id            Metric     Next-Hop             Interface   SNPA
P_london_someisp.net --
P_dublin_someisp.net 10         P_dublin_someisp.net Se1/2       *HDLC*         
P_cyprus_someisp.net 10         P_cyprus_someisp.net Se1/1       *HDLC*         
P_LA_someisp.net     10         P_LA_someisp.net     Se1/0       *HDLC*         
PE_newyork_someisp.ne10         PE_newyork_someisp.neMu1         *PPP*          
PE_telaviv_someisp.ne20         P_dublin_someisp.net Se1/2       *HDLC*         
                                P_cyprus_someisp.net Se1/1       *HDLC*         
PE_Jerusalem_someisp.20         P_cyprus_someisp.net Se1/1       *HDLC*         

Wednesday, February 06, 2013

OSPFv3 Forwarding Address under NSSA vs Regular External

ospfv3_simple

I am sharing something I researched recently at work, and still do not have the final answer, however it is interesting so I decided to write about it, some of the development group asked us why and if it is really important to use the Forwarding address in OSPFv3 implementation.

I have used the above model (and another that may be I will share later).

External NSSA

External without NSSA

  • I am advertising from R6 and R5 net 2001:11:145:56::
  • On the External database of R1 there is only a single selected although under R3 both options (from R5 and R6) are there, so it looks like it is being filtered.

R1#sh ipv ospf database external

            OSPFv3 Router with ID (150.1.1.1) (Process ID 1)

                Type-5 AS External Link States

  …

  Routing Bit Set on this LSA

  LS age: 143

  LS Type: AS External Link

  Link State ID: 1

  Advertising Router: 150.3.3.3

  LS Seq Number: 80000002

  Checksum: 0xEC3F

  Length: 56

  Prefix Address: 2001:11:145:56::

  Prefix Length: 64, Options: None

  Metric Type: 2 (Larger than any link state path)

  Metric: 20

Forward Address: 2001:11:143:36::2

  External Route Tag: 600

  • R3 is the ABR and as such it translate the LSA-7 to 5
  • To reach Advertising router we must use link local

R1#sh ipv ospf database link

            OSPFv3 Router with ID (150.1.1.1) (Process ID 1)

                Link (Type-8) Link States (Area 0)

  LS age: 1175

  Options: (V6-Bit, E-Bit, R-bit, DC-Bit)

  LS Type: Link-LSA (Interface: FastEthernet1/1)

  Link State ID: 4 (Interface ID)

  Advertising Router: 150.1.1.1

  LS Seq Number: 80000001

  Checksum: 0x8CFC

  Length: 56

  Router Priority: 1

  Link Local Address: FE80::C800:19FF:FE9C:1D

  Number of Prefixes: 1

  Prefix Address: 2001:11:141:13::

  Prefix Length: 64, Options: None

  LS age: 1131

  Options: (V6-Bit, E-Bit, R-bit, DC-Bit)

  LS Type: Link-LSA (Interface: FastEthernet1/1)

  Link State ID: 5 (Interface ID)

Advertising Router: 150.3.3.3

  LS Seq Number: 80000001

  Checksum: 0xCC98

  Length: 56

  Router Priority: 1

Link Local Address: FE80::C802:19FF:FE9C:38

  Number of Prefixes: 1

  Prefix Address: 2001:11:141:13::

  Prefix Length: 64, Options: None

R1#

R1#show ipv route 2001:11:145:56::

Routing entry for 2001:11:145:56::/64

  Known via "ospf 1", distance 110, metric 20

  Tag 600, type extern 2

  Route count is 1/1, share count 0

  Routing paths:

FE80::C802:19FF:FE9C:38, FastEthernet1/1

      Last updated 00:16:00 ago

R1#

  • The FWD address used is the selected default gateway to reach the External prefix as it can have 2 paths (one from R5 and the other from R6)
  • However it looks like the FWD address is ignored as R3 install both paths and use both of them

R1#traceroute 2001:11:145:56::1

Type escape sequence to abort.

Tracing the route to 2001:11:145:56::1

  1  *

    2001:11:141:13::2 8 msec 4 msec

  2 2001:11:143:36::2 16 msec

    2001:11:143:35::2 16 msec

    2001:11:143:36::2 12 msec

R1#traceroute 2001:11:145:56::2

Type escape sequence to abort.

Tracing the route to 2001:11:145:56::2

  1 2001:11:141:13::2 4 msec 4 msec 8 msec

  2 2001:11:143:36::2 20 msec

    2001:11:143:35::2 8 msec

    2001:11:143:36::2 16 msec

R1#

  • On that case we both LSA to the External route

R1#show ipv os database external

            OSPFv3 Router with ID (150.1.1.1) (Process ID 1)

                Type-5 AS External Link States

  …

  Routing Bit Set on this LSA

  LS age: 54

  LS Type: AS External Link

  Link State ID: 7

  Advertising Router: 150.5.5.5

  LS Seq Number: 80000001

  Checksum: 0x442

  Length: 40

  Prefix Address: 2001:11:145:56::

  Prefix Length: 64, Options: None

  Metric Type: 2 (Larger than any link state path)

  Metric: 20

  External Route Tag: 500

Routing Bit Set on this LSA

  LS age: 28

  LS Type: AS External Link

  Link State ID: 4

  Advertising Router: 150.6.6.6

  LS Seq Number: 80000001

  Checksum: 0xAC35

  Length: 40

  Prefix Address: 2001:11:145:56::

  Prefix Length: 64, Options: None

  Metric Type: 2 (Larger than any link state path)

  Metric: 20

  External Route Tag: 600

  • To reach them R3 the ABR is advertising an Inter area router (similar to LSA 4)

R1#show ipv os database inter-area router

            OSPFv3 Router with ID (150.1.1.1) (Process ID 1)

                Inter Area Router Link States (Area 0)

  Routing Bit Set on this LSA

  LS age: 143

  Options: (V6-Bit, E-Bit, R-bit, DC-Bit)

  LS Type: Inter Area Router Links

  Link State ID: 2516911365

  Advertising Router: 150.3.3.3

  LS Seq Number: 80000001

  Checksum: 0x45D5

  Length: 32

  Metric: 1

  Destination Router ID: 150.5.5.5

  Routing Bit Set on this LSA

  LS age: 116

  Options: (V6-Bit, E-Bit, R-bit, DC-Bit)

  LS Type: Inter Area Router Links

  Link State ID: 2516977158

  Advertising Router: 150.3.3.3

  LS Seq Number: 80000001

  Checksum: 0x4BC9

  Length: 32

  Metric: 1

  Destination Router ID: 150.6.6.6

R1#

  • And again we need link local to reach ABR

R1#show ipv os database link

            OSPFv3 Router with ID (150.1.1.1) (Process ID 1)

                Link (Type-8) Link States (Area 0)

  LS age: 1959

  Options: (V6-Bit, E-Bit, R-bit, DC-Bit)

  LS Type: Link-LSA (Interface: FastEthernet1/1)

  Link State ID: 4 (Interface ID)

  Advertising Router: 150.1.1.1

  LS Seq Number: 80000001

  Checksum: 0x8CFC

  Length: 56

  Router Priority: 1

  Link Local Address: FE80::C800:19FF:FE9C:1D

  Number of Prefixes: 1

  Prefix Address: 2001:11:141:13::

  Prefix Length: 64, Options: None

  LS age: 34

  Options: (V6-Bit, E-Bit, R-bit, DC-Bit)

  LS Type: Link-LSA (Interface: FastEthernet1/1)

  Link State ID: 5 (Interface ID)

  Advertising Router: 150.3.3.3

  LS Seq Number: 80000002

  Checksum: 0xCA99

  Length: 56

  Router Priority: 1

Link Local Address: FE80::C802:19FF:FE9C:38

  Number of Prefixes: 1

  Prefix Address: 2001:11:141:13::

  Prefix Length: 64, Options: None

R1#

· Forwarding is correctly.

R1#traceroute 2001:11:145:56::1

Type escape sequence to abort.

Tracing the route to 2001:11:145:56::1

  1 2001:11:141:13::2 4 msec 8 msec 4 msec

  2 2001:11:143:35::2 8 msec

    2001:11:143:36::2 32 msec

    2001:11:143:35::2 12 msec

R1#traceroute 2001:11:145:56::2

Type escape sequence to abort.

Tracing the route to 2001:11:145:56::2

  1 2001:11:141:13::2 4 msec 4 msec 8 msec

  2 2001:11:143:35::2 8 msec

    2001:11:143:36::2 20 msec

    2001:11:143:35::2 16 msec

R1#

I have to say that the following implementation was based on Cisco IOS 15.2, older versions, do not use the Forwarding address at all although from the results above technically I do not see how it is used here as well forwarding wise.

As for the RFC’s the reference is https://tools.ietf.org/html/rfc5340

  • The forwarding address is present in the AS-external-LSA if and only if the AS-external-LSA's bit F is set.
  • case the F bit is marked:
  • It MUST NOT be set to the IPv6 Unspecified Address (0:0:0:0:0:0:0:0) or an IPv6 Link-Local Address (Prefix FE80/10)
  • forwarding address MUST advertise a global IPv6 address
  • Section A.4.8.  NSSA-LSAs

"The selection should proceed the same as OSPFv2 NSSA support [NSSA]with additional checking to ensure IPv6 link-local address are not selected."

  • that is referencing to NSSA RFC 3031 where it clearly indicate under section 2.3  Type-7 LSAs

          "6. Those Type-7 LSAs that are to be translated into Type-5 LSAs must have their forwarding address set."

What do you think?

Wednesday, November 14, 2012

ISIS - Intermediate System to Intermediate System Intro

 

There is much information about ISIS history and present state, when I want to study something new I am looking for the small bullets that make subject easier to understand, once I got the basics I am taking each point and digging into it, here I would like to give the key elements for understanding ISIS and I would have to say  from the start that every point can be elaborated into at least an article if not a book (exaggerating) by itself:

  • ISIS link state protocol (most important key to start with and easiest to remember)
  • ISO protocol working based on CLNP (Connection Less Network Protocol)
  • Support IP Routing
  • Router (Node or IS) Addressing use 8 – 20 byte hex format address ( AREA + SYS-ID + NSEL )
  • ISIS have 2 hierarchy called Level 1 and Level 2
  • IS can be either Level 1 or Level 2 or Level 1 + 2
  • Level 1 may only have neighbor relations within the same area and only with L1 or L1 + L2 IS
  • Level 2 may establish neighbors relation with other areas, Level 2 also refer to as backbone (some time compared to OSPF area 0)
  • In case level-1-2 is used and the neighbor IS is also level-1-2 and both systems are in the same area, the IS will form 2 neighbors 1 for Level 1 and another for Level 2.
  • DIS – Designated IS very similar to DR function in OSPF to reduce the size of the database and allowing efficient scalability, one exist in every broadcast domain and level
  • DIS is preemptive eligible meaning that is a IS will come up with stronger parameters it will take the DIS role
  • Only 2 types of interfaces, broadcast and point to point
  • Authentication can be done separately on Hello messages or link state updates
  • Support extensions using different TLV’s (Type length value) like Graceful restart, TE…

 

image

What you see from below is that R3 is the the DIS, according to the pseudonode see at the bottom of the output generated by the DIS LSP with metric 0 to each of the routers on the LAN.

 

R1#show isis database detail
IS-IS Level-1 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
R1.00-00            * 0x00000006   0x1919        1114              0/0/0
  Area Address: 49.0001
  NLPID:        0xCC
  Hostname: R1
  IP Address:   10.123.0.1
  Metric: 10         IP 10.123.0.0 255.255.255.0
  Metric: 10         IS R3.01
R2.00-00              0x00000004   0x0CBF        1165              0/0/0
  Area Address: 49.0001
  NLPID:        0xCC
  Hostname: R2
  IP Address:   10.123.0.2
  Metric: 10         IP 10.123.0.0 255.255.255.0
  Metric: 10         IS R3.01
R3.00-00              0x00000004   0xFA68        960               0/0/0
  Area Address: 49.0001
  NLPID:        0xCC
  Hostname: R3
  IP Address:   10.123.0.3
  Metric: 10         IP 10.123.0.0 255.255.255.0
  Metric: 10         IS R3.01
R3.01-00              0x00000004   0x3195        1101              0/0/0
  Metric: 0          IS R3.00
  Metric: 0          IS R1.00
  Metric: 0          IS R2.00
IS-IS Level-2 Link State Database:
LSPID                 LSP Seq Num  LSP Checksum  LSP Holdtime      ATT/P/OL
R1.00-00            * 0x00000007   0x0E23        1004              0/0/0
  Area Address: 49.0001
  NLPID:        0xCC
  Hostname: R1
  IP Address:   10.123.0.1
  Metric: 10         IS R3.01
  Metric: 10         IP 10.123.0.0 255.255.255.0
R2.00-00              0x00000003   0x05C7        354               0/0/0
  Area Address: 49.0001
  NLPID:        0xCC
  Hostname: R2
  IP Address:   10.123.0.2
  Metric: 10         IS R3.01
  Metric: 10         IP 10.123.0.0 255.255.255.0
R3.00-00              0x00000004   0xF171        1120              0/0/0
  Area Address: 49.0001
  NLPID:        0xCC
  Hostname: R3
  IP Address:   10.123.0.3
  Metric: 10         IS R3.01
  Metric: 10         IP 10.123.0.0 255.255.255.0
R3.01-00              0x00000004   0xE26C        1180              0/0/0
  Metric: 0          IS R3.00
  Metric: 0          IS R1.00
  Metric: 0          IS R2.00
R1#

 

Monday, December 12, 2011

MPLS VPN

 

image

Ok now the fun stuff start, MPLS VPN’s, I have created nice topology with ISP “someisp.net” and two customers that have connected their branches in NY and Tel Aviv, “google.net” a small company and “shirannet.net” an innovative company working Native IPv6.

Now this time I would go in a different approach instead of talking and talking (I mean writing and writing) I will give you all configurations and .net file I did and let you play around.

MPLS VPN Topology configuration + .net

Some pointers:

1) You can divide the topology into 2 main sections Provider and Customer and 3 virtual divisions (explained below):

image

a) Provider Back Bone, relatively simple configuration P router are set only with IGP (OSPF flat area 0)
b) PE’s are the complex part, holding both the Customer Interconnecting protocol Provider Topology and doing the conversion between them.
c) Customer Edge again simple configuration

2) ttl propagation in the configuration files I have provided you I have left the default behavior of ttl propagation where the inner ttl field (original packet) is decremented along the path reveling Service Provider path, normally it is not what you will have, and the way to change that behavior is very simple with single command on each PE router see below example:

PE_newyork_someisp.n(config)#no mpls ip propagate-ttl

another scenario is where “shirannet.net” customer is using native IPv6 and you will notice that if you perform a trace and and the ttl propagation is enabled your trace will not function properly and that is because the backbone routers P routers are not IPv6 enabled at all they do not know what is IPv6!!!

! Before diableing ttl propagation 
CE_newyork_shirannet.net#traceroute  2001:CE72:68::2
Type escape sequence to abort.
Tracing the route to 2001:CE72:68::2
  1 2001:CE92:68::1 52 msec 16 msec 8 msec
  2  *  *  *
  3  *
CE_newyork_shirannet.net#ping  2001:CE72:68::2
!
! altoug there is nothing wrong with End To End Connectivity
!
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:CE72:68::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/64/88 ms
!
! After diableing ttl propagation also trace is fine :-)
!
CE_newyork_shirannet.net#traceroute  2001:CE72:68::2
Type escape sequence to abort.
Tracing the route to 2001:CE72:68::2
  1 2001:CE92:68::1 36 msec 36 msec 24 msec
  2 2001:CE72:68::1 52 msec 56 msec 32 msec
  3 2001:CE72:68::2 52 msec 48 msec 60 msec
CE_newyork_shirannet.net#traceroute  2001:CE72:68::2

 

3) Another last thing I would like to point your attention again concerning IPv6, notice to the vrf configuration, using the new method:

! This is the new way of define vrf's and the only supported
! When working with IPv6 and vrf's
vrf definition shirannet.net
 rd 20000:40
 route-target export 20000:40
 route-target import 20000:40
 !
 address-family ipv6
 exit-address-family
!
!I did both methods just to get your attention on both ways
!
ip vrf google.net
 rd 10000:80
 route-target export 10000:80
 route-target import 10000:80
!

 

Ok, That is it I hope you will have fun, I think that the basic configuration will allow you to play and test all kind of scenarios and get better understanding on the subject.

Friday, November 04, 2011

IPV6 NAT-PT Dynamic

 

image

IPv6 NAT-PT is one of the methods out there for migration between V4 to V6, the NAT-PT is not a normal NAT as with normal NAT you would translate one address to another, in our case NAT-PT we do a translation between 2 different protocols ipv6 to ipv4 (and vice versa).

In the above scenario I have done a simple topology R1 is a host running only IPv6, R2 is my translator between IPv6 to IPv4 and R3 is my gateway out side (Only IPv4), on R3 as you can see from above I have connected it to my home network so I have done Normal IPv4 NAT between the what is coming in from f0/0 and going out f0/1 (my home net)

R1 R2 R3
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2001:100:100::1/64
 ipv6 address FE80::1 link-local
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
!
!
ip http server
no ip http secure-server
!
ipv6 route ::/0 2001:100:100::2
!
!
!
!
!
ipv6 unicast-routing
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2001:100:100::2/64
 ipv6 address FE80::2 link-local
 ipv6 nat
!
interface FastEthernet0/1
 ip address 100.100.0.1 255.255.255.0
 duplex auto
 speed auto
 ipv6 nat
!
ip route 0.0.0.0 0.0.0.0 100.100.0.2
!
!
ip http server
no ip http secure-server
!
ipv6 nat v6v4 source list NAT_TRANSLATIONS pool V4POOL
ipv6 nat v6v4 pool V4POOL 100.100.0.101 100.100.0.110 prefix-length 24
ipv6 nat prefix 2001::/96 v4-mapped NAT_TRANSLATIONS
!
!
!
!
ipv6 access-list NAT_TRANSLATIONS
 permit ipv6 any 2001::/96
!
!
!
!
interface FastEthernet0/0
 ip address 100.100.0.2 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address dhcp
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!
!
!
ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/1 overload
!
access-list 100 permit ip 100.100.0.0 0.0.0.255 any
!

 

As you can see from above configuration R1 in IPv6 only, and R3 is IPv4 only

IPV6_HOST#ping 2001::808:808
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001::808:808, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 128/142/184 ms
IPV6_HOST#
From above you can see I ping 2001::808:808, the 2001:: is the prefix I use
for the NAT-PT and the 32 last bits 0808:0808 is translated to 8.8.8.8 (Google DNS)

to verify the translation on the NAT-PT router:

NAT_PT_ROUTER#sh ipv nat translations
Prot  IPv4 source              IPv6 source
      IPv4 destination         IPv6 destination
---   ---                      ---
      10.0.0.2                 2001::A00:2
icmp  100.100.0.102,3764       2001:100:100::1,3764
      8.8.8.8,3764             2001::808:808,3764
---   100.100.0.102            2001:100:100::1
      10.0.0.2                 2001::A00:2
---   100.100.0.102            2001:100:100::1
      ---                      ---
NAT_PT_ROUTER#debug ipv6 nat
IPv6 NAT-PT debugging is on
NAT_PT_ROUTER#
*Mar  1 14:12:06.104: IPv6 NAT: icmp src (2001:100:100::1) -> (100.100.0.102), dst (2001::808:808) -> (8.8.8.8)
*Mar  1 14:12:06.236: IPv6 NAT: icmp src (8.8.8.8) -> (2001::808:808), dst (100.100.0.102) -> (2001:100:100::1)
*Mar  1 14:12:06.256: IPv6 NAT: icmp src (8.8.8.8) -> (2001::808:808), dst (100.100.0.102) -> (2001:100:100::1)
*Mar  1 14:12:06.264: IPv6 NAT: icmp src (8.8.8.8) -> (2001::808:808), dst (100.100.0.102) -> (2001:100:100::1)
*Mar  1 14:12:06.280: IPv6 NAT: icmp src (8.8.8.8) -> (2001::808:808), dst (100.100.0.102) -> (2001:100:100::1)
default timeout for the translation rule to expire from the table is 60 sec, to save some
work from the router i would suggest to increase that timeout
ipv nat translation timeout 300 (increase to 5 min)
now with that said you can increase or decrease timeout for tcp , udp , icmp , I would love if there would be also the
option to specifically decrease the timeout for SYN (prevent from SYN flood attack) currently there is an option only 
for FIN or RST flags (and I suggest to decrease their time out.
ipv nat translation finrst-timeout 10