Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configuration of static and default routes based on [IPv6]

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Configuration Based on IPv6 Static Routing and Default Routing

Experimental environment:

Background: Configure three loopback interfaces IPv6 addresses on router R1, simulate three different IPv6 prefixes as IPv6 target networks, then configure static routes for three IPv6 prefixes on router R2, and detect their connectivity. Finally, replace static route entries with IPv6 default routes.

Step 1: Complete the basic configuration for routers R1 and R2, including initiating IPv6 and address configuration, and activating the relevant interfaces. The configuration is as follows:

Configuration on R1:

R1(config)#ipv6 unicast-routing //Enable IPv6 routing, otherwise static routing cannot be completed//

R1(config)#int f0/0 //Enter f0/0 interface

R1(config-if)#ipv6 add 2001:10::1/64 //Configure IPv6 addresses for this interface

R1(config-if)#no sh

R1(config)#interface lo1

R1(config-if)#ipv6 add 2001:2::1/64

R1(config-if)#ex

R1(config)#int lo2

R1(config-if)#ipv6 add 2001:3::1/64

R1(config-if)#ex

R1(config)#int lo3

R1(config-if)#ipv6 add 2001:4::1/64

R1(config-if)#ex

Configuration on R2:

R2(config)#ipv6 unicast-routing

R2(config)#int f0/0

R2(config-if)#ipv6 add 2001:10::2/64

R2(config-if)#no sh

Step 2: Ping the loopback IPv6 address on router R1 on router R2, and the result is ping failed, because there is no route to the destination address on router R2. This technical knowledge point is the same as that of IPv4. To configure IPv6 static and default routes, the functions are similar to IPv4, but there are certain differences in the writing form. The default route is a special static route.

IPv6 static routing format:

ipv6 route [destination IPv6 prefix][outbound interface][next-hop IPv6 address]

Target IPv6 prefix: Indicates the target IPv6 network, which has the same meaning as IPv4 target subnet.

Outbound interface: The outbound interface on which the current router forwards packets. If the IPv6 local link address of an adjacent router is used as the next-hop address, the static route syntax must include the outbound interface keyword.

Next-hop IPv6 address: The IPv6 address of the next-hop router to go through to reach the destination network, which is the same environment as IPv4. Note: According to RFC2461, the router must be able to determine the local link address of the next-hop router. Therefore, when configuring IPv6 static routing, it is recommended that the next-hop address be configured as the IPv6 address of the local link of the adjacent router. In this lab, you can use show ipv6 interface f0/0 on R1 to see:

R1#sho ipv6 int f0/0

FastEthernet0/0 is up, line protocol is up

IPv6 is enabled, link-local address is FE80::C800:1AFF:FE74:8

No Virtual link-local address(es):

Global unicast address(es):

2001:10::1, subnet is 2001:10::/64

Joined group address(es):

FF02::1

FF02::2

FF02::1:FF00:1

FF02::1:FF74:8

MTU is 1500 bytes

ICMP error messages limited to one every 100 milliseconds

ICMP redirects are enabled

ICMP unreachables are sent

ND DAD is enabled, number of DAD attempts: 1

ND reachable time is 30000 milliseconds (using 19434)

ND advertised reachable time is 0 (unspecified)

ND advertised retransmit interval is 0 (unspecified)

ND router advertisements are sent every 200 seconds

ND router advertisements live for 1800 seconds

ND advertised default router preference is Medium

Hosts use stateless autoconfig for addresses.

Configure static routes on R2:

R2(config)#ipv6 route 2001:2::/64 f0/0 FE80::C800:1AFF:FE74:8

R2(config)#ipv6 route 2001:3::/64 f0/0 FE80::C800:1AFF:FE74:8

R2(config)#ipv6 route 2001:4::/64 f0/0 FE80::C800:1AFF:FE74:8

After configuration, check your routing table (show ipv6 route), you can see the three static routes added, and then test communication with the target segment again.

R2#sho ipv6 route

IPv6 Routing Table - Default - 6 entries

Codes: C - Connected, L - Local, S - Static, U - Per-user Static route

B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1

I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP

EX - EIGRP external

O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2

ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

S 2001:2::/64 [1/0]

via FE80::C800:1AFF: FE74:8, FastEthernet0/0 //added

S 2001:3::/64 [1/0] static routing//

via FE80::C800:1AFF:FE74:8, FastEthernet0/0

S 2001:4::/64 [1/0]

via FE80::C800:1AFF:FE74:8, FastEthernet0/0

C 2001:10::/64 [0/0]

via FastEthernet0/0, directly connected

L 2001:10::2/128 [0/0]

via FastEthernet0/0, receive

L FF00::/8 [0/0]

via Null0, receive

R2#ping 2001:2::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:2::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/48 ms

R2#ping 2001:3::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:3::1, timeout is 2 seconds:

!.!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 24/36/48 ms

R2#ping 2001:4::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:4::1, timeout is 2 seconds:

!!!!!

Next, delete the static route entry just configured (add no directly in front of the command, OK), and do the default route below.

R2(config)#no ipv6 route 2001:2::/64 f0/0 FE80::C800:1AFF:FE74:8

R2(config)#no ipv6 route 2001:3::/64 f0/0 FE80::C800:1AFF:FE74:8

R2(config)#no ipv6 route 2001:4::/64 f0/0 FE80::C800:1AFF:FE74:8

Check the routing table again. There should be no static routing entries in the routing table, and testing connectivity is not possible.

R2#sho ipv route

IPv6 Routing Table - Default - 3 entries

Codes: C - Connected, L - Local, S - Static, U - Per-user Static route

B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1

I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP

EX - EIGRP external

O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2

ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

C 2001:10::/64 [0/0]

via FastEthernet0/0, directly connected

L 2001:10::2/128 [0/0]

via FastEthernet0/0, receive

L FF00::/8 [0/0]

via Null0, receive

R2#ping 2001:2::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:2::1, timeout is 2 seconds:

% No valid route for destination

Success rate is 0 percent (0/1)

Configure default routes on R2:

(Check the routing table for default routing entries. If yes, test connectivity. In one step, OKl)

R2(config)#ipv6 route ::/0 f0/0 FE80::C800:1AFF:FE74:8

R2(config)#end

*Jun 9 09:26:01.619: %SYS-5-CONFIG_I: Configured from console by console

R2#sho ipv6 route

IPv6 Routing Table - Default - 4 entries

Codes: C - Connected, L - Local, S - Static, U - Per-user Static route

B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1

I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP

EX - EIGRP external

O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2

ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

S ::/0 [1/0]

via FE80::C800:1AFF: FE74:8, FastEthernet0/0 //Default route added//

C 2001:10::/64 [0/0]

via FastEthernet0/0, directly connected

L 2001:10::2/128 [0/0]

via FastEthernet0/0, receive

L FF00::/8 [0/0]

via Null0, receive

R2#ping 2001:2::1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2001:2::1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/29/44 ms

The above is today's experiment; in fact, in principle, it is basically similar to IPv4, there is not much difference, that is, the command has been changed.

As long as you have the basics of IPv4, understanding IPv6 is easy.

Okay, that's it for today!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report