PDA

View Full Version : Khảo sát một số vấn đề về default-route trong routing



TGA_Certificationteam
22-07-2003, 01:12 PM
3 lệnh :

IP default-network x.x.x.x
IP route 0.0.0.0 0.0.0.0 x.x.x.x
IP default-gateway x.x.x.x

Lệnh nào khi dùng kèm với lệnh Default-information orriginated trogn 1 routing protocol sẽ inject cái default-route vào trong routing update?

rip
22-07-2003, 01:27 PM
IP route 0.0.0.0 0.0.0.0 x.x.x.x :D

ppp
22-07-2003, 11:34 PM
Bạn có thể dùng default information originate always . Lệnh này không cần dùng kèm với ip route 0.0.0.0 0.0.0.0 x.x.x.x .

Chúc vui !

sinhvienngheo
24-07-2003, 02:08 PM
3 lệnh :

IP default-network x.x.x.x
IP route 0.0.0.0 0.0.0.0 x.x.x.x
IP default-gateway x.x.x.x

Lệnh nào khi dùng kèm với lệnh Default-information orriginated trogn 1 routing protocol sẽ inject cái default-route vào trong routing update?

TGA,

Lệnh IP default-gateway chỉ dùng khi quá trình routing bị DISABLE.
Cả hai lệnh còn lại, ip default-network và ip route 0.0.0.0 0.0.0.0 xxxx đều sẽ lan truyền default-route về các down-stream router.
Cách mà các routing protocol lan truyền default-route rất khác nhau.


chúc TGA thành công,
-----------------------------------
ip default-gateway

The ip default-gateway command differs from the other two commands in that it should only be used when ip routing is disabled on the Cisco router.

For instance, if the router is a host in the IP world, you can use this command to define a default gateway for it. You might also use this command when your low end Cisco router is in boot mode in order to TFTP a Cisco IOS® Software image to the router. In boot mode, the router does not have ip routing enabled.

ip default-network

Unlike the ip default-gateway command, you can use ip default-network when ip routing is enabled on the Cisco router. When you configure ip default-network the router considers routes to that network for installation as the gateway of last resort on the router.

For every network configured with ip default-network, if a router has a route to that network, that route is flagged as a candidate default route. Look at the following routing table taken from a Cisco router:

2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 198.10.1.0 [1/0] via 161.44.192.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0

Note the static route to 198.10.1.0 via 161.44.192.2 and that the gateway of last resort is not set. If you configure ip default-network 198.10.1.0, the routing table changes to the following:

2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is 161.44.192.2 to network 198.10.1.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
S* 198.10.1.0 [1/0] via 161.44.192.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0
2513#show ip protocols
2513#

You can see the gateway of last resort has now been set as 161.44.192.2. This result is independent of any routing protocol, as shown by the show ip protocols command at the bottom of the output.

You can add another candidate default route simply by configuring another instance of ip default-network:

2513#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
2513(config)#ip route 171.70.24.0 255.255.255.0 131.108.99.2
2513(config)#ip default-network 171.70.24.0
2513(config)#^Z

2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is 161.44.192.2 to network 198.10.1.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
S* 198.10.1.0 [1/0] via 161.44.192.2
171.70.0.0 is variably subnetted, 2 subnets, 2 masks
S 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0

Notice that after entering the above command, the network was not flagged as a default network. The following section explains why.

Flagging a Default Network

Note: The ip default-network command is classful, which means if the router has a route to the subnet indicated by this command, it installs the route to the major net. At this point neither network has been flagged as the default network. The ip default-network command must be issued again, using the major net, in order to flag the candidate default route.

2513#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
2513(config)#ip default-network 171.70.0.0
2513(config)#^Z

2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is 161.44.192.2 to network 198.10.1.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
S* 198.10.1.0 [1/0] via 161.44.192.2
171.70.0.0 is variably subnetted, 2 subnets, 2 masks
S* 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0
If the original static route had been to the major network, the extra step of configuring the default network twice would not have been necessary.

There are still no IP protocols running here. Without any dynamic protocols running, you can configure your router to choose from a number of candidate default routes based on whether the routing table has routes to networks other than 0.0.0.0/0. This command allows you to configure robustness into the selection of a gateway of last resort. Rather than configuring static routes to specific next-hops, you can have the router choose a default route to a particular network by checking in the routing table.

If you lose the route to a particular network, the router selects the second candidate default, as specified above. You can remove the lost route by removing the static route in the configuration as follows:

2513#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
2513(config)#no ip route 198.10.1.0 255.255.255.0 161.44.192.2
2513(config)#^Z
2513#
%SYS-5-CONFIG_I: Configured from console by console
After removing the static route to the original default network, the routing table looks like this:

2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is 171.70.24.0 to network 171.70.0.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
* 171.70.0.0 is variably subnetted, 2 subnets, 2 masks
S* 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0
2513#

Using Different Routing Protocols

Gateways of last resort selected using the ip default-network command are propagated differently depending on which routing protocol is propagating the default route. For IGRP and EIGRP to propagate the route, the network specified by the ip default-network command must be known to IGRP or EIGRP. This means the network must be an IGRP- or EIGRP-derived network in the routing table, or the static route used to generate the route to the network must be redistributed into IGRP or EIGRP.

RIP advertises a route to 0.0.0.0. For example, note that the gateway of last resort on the router below was learned using the combination of the ip route and ip default-network commands. If you enable RIP on this router, RIP advertises a route to 0.0.0.0 (although not to the Token Ring network because of split-horizon):

2513(config)#router rip
2513(config-router)#network 161.44.0.0
2513(config-router)#network 131.108.0.0
2513(config-router)#^Z
2513#
2513#
2513#
%SYS-5-CONFIG_I: Configured from console by console
2513#debug ip rip
RIP protocol debugging is on
2513#
RIP: sending update to 255.255.255.255 via Ethernet0 (161.44.192.1)
default 0.0.0.0, metric 1
network 131.108.0.0, metric 1
RIP: sending update to 255.255.255.255 via TokenRing0 (131.108.99.1)
network 161.44.0.0, metric 1
2513#

Note: In IOS release 12.0T and later, RIP does not advertise the default router if the route is not learned via RIP. Therefore, it may be necessary to redistribute the route into RIP, or use the default-information originate command.

OSPF, like RIP, advertises a route for 0.0.0.0 0.0.0.0. However, with OSPF, the router originating the default route must be configured with the default-information originate command. For more detailed information, see How Does OSPF Generate Default Routes?.

ip route 0.0.0.0 0.0.0.0

Creating a static route to network 0.0.0.0 0.0.0.0 is another way to set the gateway of last resort on a router. As with the ip default-network command, using the static route to 0.0.0.0 is not dependent on any routing protocols. However, ip routing must be enabled on the router.

Note: IGRP does not understand a route to 0.0.0.0, therefore it cannot propagate default routes created using the ip route 0.0.0.0 0.0.0.0 command. Use the ip default-network command to have IGRP propagate a default route.

EIGRP propagates a route to network 0.0.0.0, but the static route must be redistributed into EIGRP. RIP and OSPF behave as described when using the ip default-network command. Keep in mind that the note above still applies.

Look at an example of configuring a gateway of last resort using the ip route 0.0.0.0 0.0.0.0 command:

router-3#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
router-3(config)#ip route 0.0.0.0 0.0.0.0 170.170.3.4
router-3(config)#^Z
router-3#

router-3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR

Gateway of last resort is 170.170.3.4 to network 0.0.0.0

170.170.0.0/24 is subnetted, 2 subnets
C 170.170.2.0 is directly connected, Serial0
C 170.170.3.0 is directly connected, Ethernet0
S* 0.0.0.0/0 [1/0] via 170.170.3.4
router-3#
router-3#
Note: If you configure multiple networks as candidate default routes using the ip default-network command, the network that has the lowest administrative distance is chosen as the network for the gateway of last resort. If all the networks have the same administrative distance then the network listed first in the routing table (show ip route lists the routing table) is chosen as the network for the gateway of last resort. If you use both the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default-network command is known statically, the network defined with the ip default-network command takes precedence and is chosen for the gateway of last resort. Otherwise if the network used by the ip default-network command is derived by a routing protocol, the ip route 0.0.0.0 0.0.0.0 command, which will have a lower administrative distance, takes precedence and is chosen for the gateway of last resort. Lastly, if you use multiple ip route 0.0.0.0 0.0.0.0 commands to configure a default route, traffic is load-balanced over the multiple routes.

Summary

To summarize, you can use the ip default-gateway command when ip routing is disabled on a Cisco router. Use the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to set the gateway of last resort on Cisco routers that have ip routing enabled. The way in which routing protocols propagate the default route information varies for each protocol.

R3
02-11-2003, 10:52 AM
Bài viết này hướng dẫn cách dùng các câu lệnh: ip default−gateway, ip default−network , and ip route 0.0.0.0 0.0.0.0 để cấu hình default route, hay gateway of last resort.

ip default−gateway
Lệnh ip default−gateway chỉ dùng khi disable ip routing trên router Cisco. Nếu một router trong mạng, có thể dùng lệnh này để định nghĩa ngõ ra mặc định cho nó. Cũng có thể dùng lệnh này để TFTP một image cho router khi ở boot mode.


ip default−network
Không như lệnh ip default-gateway , có thể dùng lệnh ip default-network khi ip routing đã enable trên router. Khi thực hiện lệnh này, router xem như route tới mạng đó đặt là ngõ ra cuối cùng (gateway of last resort) trên router.
Đối với mỗi mạng đã cấu hình ip default-network, nếu một router có route cho mạng đó, thì route đó được đánh dấu là candidate default. Xem bảng định tuyến trên router Cisco sau:


2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 198.10.1.0 [1/0] via 161.44.192.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0

Nếu cấu hình ip default-network 198.10.1.0 trên router thì bảng định tuyến thay đổi như sau:


2513#show ip route
...
Gateway of last resort is 161.44.192.2 to network 198.10.1.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
S* 198.10.1.0 [1/0] via 161.44.192.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0
2513#show ip protocols
2513#

Như vậy có thể thấy gateway of last resort đựơc đặt là 161.44.192.2. Kết quả này không phụ thuộc bất kỳ giao thức định tuyến nào.

Có thể thêm một route candidate default đơn giản bằng cách cấu hình ip default-network khác.


2513#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
2513(config)#ip route 171.70.24.0 255.255.255.0 131.108.99.2
2513(config)#ip default-network 171.70.24.0
2513(config)#^Z

2513#show ip route
...

Gateway of last resort is 161.44.192.2 to network 198.10.1.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
S* 198.10.1.0 [1/0] via 161.44.192.2
171.70.0.0 is variably subnetted, 2 subnets, 2 masks
S 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0

Chú ý, sau khi thực hiện lệnh trên, mạng không được đánh dấu là default network. Phần sau đây sẽ giải thích tại sao.


Đánh dấu một default network
Chú ý: Lệnh ip default-network là classfull, nghĩa là nếu router có một route tới mạng con chỉ bởi lệnh này, nó đặt route về major net. Lúc này không mạng nào mạng được đánh dấu là default network. Lệnh ip default-network phải đựơc đặt lại dùng major net, để đánh dấu route là candidate default.


2513#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
2513(config)#ip default-network 171.70.0.0
2513(config)#^Z

2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is 161.44.192.2 to network 198.10.1.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
S* 198.10.1.0 [1/0] via 161.44.192.2
171.70.0.0 is variably subnetted, 2 subnets, 2 masks
S* 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0

Ở đây vẫn chưa chạy giao thức IP. Không có chạy giao thức định tuyến động, có thể cấu hình router chọn từ một số route candidate default dựa trên bảng định tuyến. Lệnh này cho phép cấu hình thẳng vào phần gateway of last resort. Hơn là cấu hình static roue tới chặng kế nào đó, có thể router chọn default route tới mạng nào đó bằng cách kiểm tra bảng định tuyến.

Nếu route tới mạng bị mất, router chọn candidate default thứ hai. Có thể lọai bỏ route hỏng bằng cách loại static route như cấu hình dưới đây:


2513#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
2513(config)#no ip route 198.10.1.0 255.255.255.0 161.44.192.2
2513(config)#^Z
2513#
%SYS-5-CONFIG_I: Configured from console by console


2513#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is 171.70.24.0 to network 171.70.0.0

161.44.0.0 255.255.255.0 is subnetted, 1 subnets
C 161.44.192.0 is directly connected, Ethernet0
S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
* 171.70.0.0 is variably subnetted, 2 subnets, 2 masks
S* 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
131.108.0.0 255.255.255.0 is subnetted, 1 subnets
C 131.108.99.0 is directly connected, TokenRing0
2513#

Dùng các giao thức định tuyến khác

Gateways of last resort được chọn bằng lệnh ip default-network truyền đi khác nhau phụ thuộc vào giao thức định tuyến nào sẽ lan truyền default route. Với IGRP va EIGRP để lan truyền route, mạng xác định bởi lệnh ip default-network phải biết bởi IGRP hay EIGRP. Có nghĩa là mạng phải một mạng học được từ IGRP hay EIGRP trong bảng định tuyến, hay static route dùng để tạo route phải được redistribute vào IGRP hay EIGRP.

RIP quảng cáo route 0.0.0.0. Ví dụ, giả sử gateway of last resort trên router học được thông qua lệnh ip route và ip default-network, nếu chạy RIP trên router này, RIP sẽ quảng cáo route thành 0.0.0.0


2513(config)#router rip
2513(config-router)#network 161.44.0.0
2513(config-router)#network 131.108.0.0
2513(config-router)#^Z
2513#
2513#
2513#
%SYS-5-CONFIG_I: Configured from console by console
2513#debug ip rip
RIP protocol debugging is on
2513#
RIP: sending update to 255.255.255.255 via Ethernet0 (161.44.192.1)
default 0.0.0.0, metric 1
network 131.108.0.0, metric 1
RIP: sending update to 255.255.255.255 via TokenRing0 (131.108.99.1)
network 161.44.0.0, metric 1
2513#

Trong IOS release 12.0T và later, RIP không quảng cáo default route nếu route đó không được học từ RIP. Do đó, cần phải redistribute route này vào RIP, hay sử dụng lệnh default-information originate .

OSPF, giống như RIP, quảng cáo route cho 0.0.0.0 0.0.0.0. Tuy nhiên, với OSPF, router là nguồn của default route phải được cấu hình bằng lệnh default-information originate


ip route 0.0.0.0 0.0.0.0

Tạo static route tới mạng 0.0.0.0 0.0.0.0 là một cách khác để đặt gateway of last resort trên một router. Như đối với lệnh ip default-network, sử dụng static route tới 0.0.0.0 không phụ thuộc vào giao thức định tuyến. Tuy nhiên, ip routing phải được enable trên router.

Chú ý: IGRP không hiểu route tới 0.0.0.0, do đó nó không thể truyền các default route tạo bằng lệnh ip route 0.0.0.0 0.0.0.0 . Dùng lệnh ip default-network để được IGRP truyền default route.

EIGRP lan truyền thông tin route tới mạng 0.0.0.0, nhưng static route phải được redistribute vào EIGRP. RIP và OSPF cư xử như đã mô tả khi dùng lệnh ip default-network.

Xem ví dụ sau, cấu hình gateway of last resort dùng lệnh ip route 0.0.0.0 0.0.0.0


router-3#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
router-3(config)#ip route 0.0.0.0 0.0.0.0 170.170.3.4
router-3(config)#^Z
router-3#

router-3#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR

Gateway of last resort is 170.170.3.4 to network 0.0.0.0

170.170.0.0/24 is subnetted, 2 subnets
C 170.170.2.0 is directly connected, Serial0
C 170.170.3.0 is directly connected, Ethernet0
S* 0.0.0.0/0 [1/0] via 170.170.3.4
router-3#
router-3#


Chú ý:
- Nếu cấu hình nhiều mạng là candidate default route sử dụng lệnh ip default-network, mạng có AD nhỏ nhất sẽ được chọn là mạng cho gateway of last resort.
- Nếu tất cả các mạng có cùng AD thì mạng được liệt kê đầu tiên trong bảng định tuyến sẽ đựơc chọn là mạng cho gateway of last resort.
- Nếu dùng cả hai lệnh ip default-network và ip route 0.0.0.0 để cấu hình candidate default network, và mạng dùng bởi ip default-network biết bằng static route, mạng định nghĩa bằng lệnh ip default-network sẽ được xem xét trước và đựơc chọn cho gateway of last resort. Ngược lại nếu mạng dùng bởi ip default-network biềt được bằng giao thức định tuyến, lệnh ip route 0.0.0.0 0.0.0.0 , có AD nhỏ hơn, sẽ được ưu tiên và được chọn là gateway of last resort.
- Cuối cùng, nếu dùng nhiều lệnh ip route 0.0.0.0 0.0.0.0 để cấu hình default route, dữ liệu sẽ được load-balance trên các route.


Tóm lại
- Sử dụng ip default-gateway khi vô hiệu hoá ip routing trên router Cisco.
- Dùng lệnh ip default-network và ip route 0.0.0.0 0.0.0.0 để đặt gateway of last resort trên các router Cisco có enable ip routing.
- Các thức các giao thức định tuyến truyền thông tin default route khác nhau đối với mỗi giao thức.


:D
---------------------
Trích dịch từ CCO:
http://www.cisco.com/en/US/tech/tk365/tk554/technologies_tech_note09186a0080094374.shtml

netdevice
26-11-2003, 04:19 PM
Hi all,
Mình có một problem liên quan đến vấn đề này. Mình thử cấu hình trên router 2514 câu lệnh ip default-network 192.168.1.0. Bảng định tuyến như sau:

Gateway of last resort is not set

C* 192.168.1.0 is directly connected, Serial 0

Với kết quả này, mình không thể sử dụng 192.168.1.0/24 làm tuyến mặc định được. Nếu dùng ip route 0.0.0.0 0.0.0.0 192.168.1.2 thì hoạt động tốt. Mình còn thiếu điều gì chăng?

Mong được giúp đỡ.

dangquangminh
27-11-2003, 12:44 PM
hi netdevice,

ip default-network chỉ apply cho IGRP/EIGRP. Với RIP, nó có thể phụ thuộc vào IOS version.

netdevice dùng routing protocol gì?

Thân,

netdevice
27-11-2003, 03:10 PM
hi anh Minh,
Em thử cả 2 IGRP và RIP đều không được. Nhưng em nghĩ giao thức định tuyến đâu có liên quan đến điều này vì em muốn tạo một tuyến mặc định bằng ip default-network để có thể ping interface loopback của 1 router kết nối trực tiếp. Router 2514 có IOS 12.1.
Thanks.

admin
28-11-2003, 10:08 PM
netdevice,

Xem file đính kèm. Chú ý đến từng chi tiết.

Cấu hình này đã được test nhiều lần và working.

Thân,

themask
11-12-2003, 02:35 PM
hi,

Bạn thử cấu hình như sau xem thử có chạy được không.

ip route 192.168.1.0 255.255.255.0 192.168.1.2
ip default-network 192.168.1.0

Neo
02-03-2004, 11:02 AM
Wow, dạo này các bài thảo luận ở box routing rất hay :wink: .

Default route là một vấn đề cũng có rất nhiều bài thảo luận như gateway of last resort, default network...

Tuy nhiên mình có một số câu hỏi sau:

1. Khi sử dụng default route hay default network với RIP, nên sử dụng định tuyến dạng classfull hay classless (why?)

2. Trong IGRP, khi cấu hình ip default-network, có phải major network là network nào cũng được ko?

3. EIGRP xem route 0.0.0.0/0 như là default route, lệnh ip default-network cũng chỉ ra default route, vậy đâu là điểm khác biệt?

4. Trong OSPF, default route giữa NSSA ASBR và NSSA ABR có khác biệt gì, cấu hình như thế nào?

Thanks,

1''hpSky
02-03-2004, 02:53 PM
(1) RIPv1 là classful routing protocol, nhưng router chạy giao thức này có thể hiểu classless bằng lệnh ip classless (chú ý đây là router, chứ bản thân RIPv1 không có khả năng quảng bá SM trong bản tin cập nhật định tuyến)

RIPv2 là classless routing protocol, hiển nhiên hỗ trợ CIDR và VLSM.

Không hiểu ý câu hỏi ở đây là gì? classful theo nghĩa RIP1 và classless theo nghĩa RIP2, hay đang muốn nói đến việc chọn lựa giữa RIP1 với tính năng ip classless??

(2) Ý câu hỏi này có phải nói đến vấn đề discontigous network khi cấu hình ip default trong IGRP?? hay major network mà supmod nói đến chính là tham số trong câu lệnh ip default-network ip-network-address ??

Nếu là vấn đề discontigous net, và giải quyết bằng ip default-network, thì 1''hpSky cho rằng có thể thực hiện với major network bất kỳ.

(3) default network là giải pháp giảm thiểu kích thước bảng định tuyến dựa trên nguyên tắc gateway of last resort. Khác với static route, default route được include trong bản tin cập nhật định tuyến.

Có hai cách để thực hiện default-network: lệnh ip route 0.0.0.0/0 và ip default-network. Không hiểu câu hỏi có phải nói về sự khác biệt hai lệnh này??

(4) Mình cũng đang thắc mắc.

Thiển nghĩ,

themask
02-03-2004, 04:36 PM
Hi Neo,

1,2&3. Neo xem file đính kèm nha.
4. NSSA chấp nhận LSAs type 7 (format giống type 5) nhưng kô flood trong toàn miền OSPF mà convert sang LSAs type 5 trước khi quảng bá đến các miền (area) khác.

Chúc Neo vui,

03-03-2004, 01:04 PM
(1) ''hpSky, nghĩa là traffic có gửi đến default route hay không trong trường hợp ip classless và no ip classless?

(2) Theo cái link của themask thì lệnh ip default-network được dùng để chỉ định major network và đánh dấu mạng này là default network, major network phải là connected, và có hiệu lực khi network này tồn tại trong routing table.

(3) EIGRP có một điểm khác biệt cơ bản so với IGRP là EIGRP xem route 0.0.0.0/0 như là default route còn IGRP thì không.

(4) Cấu hình tạo default summary route vào NSSA area: (config-router)# area 1 nssa no-summary
Cấu hình Type 7 Default vào NSSA area: (config-router)# area 1 nssa default-information-originate

1'hpSky
16-03-2004, 06:45 PM
Hi all,
Mình có một problem liên quan đến vấn đề này. Mình thử cấu hình trên router 2514 câu lệnh ip default-network 192.168.1.0. Bảng định tuyến như sau:

Gateway of last resort is not set

C* 192.168.1.0 is directly connected, Serial 0

Với kết quả này, mình không thể sử dụng 192.168.1.0/24 làm tuyến mặc định được. Nếu dùng ip route 0.0.0.0 0.0.0.0 192.168.1.2 thì hoạt động tốt. Mình còn thiếu điều gì chăng?

Mong được giúp đỡ.

Đối với IGRP, lệnh #ip route 0.0.0.0 0.0.0.0 192.168.1.2 chỉ có tác dụng đặt gateway of last resort cho chính mình, nó không truyền default route này cho các router khác trong mạng.
lệnh #ip default-network 192.16.1.0 lại chỉ có tác dụng thông báo cho các router khác về một default-route, chứ không có tác dụng đặt con đường mặc định cho chính mình, vì thế
khi #show ip route thấy "gateway of last resoft is not set"

( IGRP does not recognize the network 0.0.0.0/0 and will not include it in update, you must you command:#ip default-network)

Như vậy đối với các router IGRP "cổng" cần gõ cả 2 lệnh:
#ip route 0.0.0.0 0.0.0.0 192.168.1.2 và
#ip default-network 192.168.1.0

Đối với RIP thì nó hiểu được route 0.0.0.0/0 và các update của nó chứa cả route này nên chỉ cần gõ 1 lệnh: #ip route 0.0.0.0 0.0.0.0 192.168.1.2 là đủ.

ý kiến nhỏ!

z
19-04-2004, 09:31 AM
Giả sử trong mạng có 3 con router chạy eigrp, 1 con có default route ra internet. Các bạn cho mình hỏi là làm sao để con router này tự động quảng bá default route này đến các router còn lại. Cám ơn

admin
19-04-2004, 10:56 AM
Z:

Theo link này trên cisco.com:
http://www.cisco.com/en/US/tech/tk365/tk554/technologies_tech_note09186a0080094374.shtml

với EIGRP/IGRP, bạn có thể dùng các lệnh ip default-network để một router có thể biết được gateway of last resort. Một cách khác nữa là dùng redistribution để đưa defaut-route vào EIGRP routing process.

Sau cùng, mời z tham khảo một số thảo luận rất hay trước đây của diễn đàn vnpro về vấn đề này:

Hỏi về static routing và default-network?
http://www.vnpro.org/forum/viewtopic.php?t=2283
http://www.vnpro.org/forum/viewtopic.php?t=676
http://vnpro.org/forum/viewtopic.php?t=2623

Nếu z có điều gì không rõ hoặc phát sinh những điểm mới chung quanh vấn đề này, vui lòng đặt câu hỏi trao đổi.

Cám ơn z,

nth14026
19-04-2004, 10:57 AM
Bạn phải Redistribute giữa Static route và EIGRP. Bạn xem ở đây nè:
http://www.vnpro.org/forum/viewtopic.php?t=2336
http://www.vnpro.org/forum/viewtopic.php?t=808

Thân chào

z
19-04-2004, 11:48 AM
A! Đúng rồi, có thể dùng lệnh Redistribute static or Redistribute connected để advertise static route vào dynamic routing protocols
Ngoài ra với RIP và OSPF thì xó thể dùng thêm lệnh the default-information originate. Thanks

cccp
21-04-2004, 03:20 AM
hi z

lệnh redistribute connected dùng để redistrubute các mạng nối trực tiếp với router vào routing protocol, lệnh này ko redistribute static route (dùng lênh redistribute static là đủ)

themask
26-04-2004, 02:22 PM
Hi, Nếu dùng default route ra khỏi một interface ( out of interface) thì dùng redistribute connected có được không? ; )

for example: ip route 0.0.0.0 0.0.0.0 serial0/7

request
05-05-2004, 04:29 PM
Được, vì default route này có AD=0 nên nó cũng như la` connected trên router. Nên default route này sẽ được quảng bá vào trong mạng.

dangquangminh
25-05-2004, 08:38 PM
Có 3 cách để đưa default-route vào trong một hệ thống mạng chạy EIGRP:

1. Bằng cách summary một default-route có dạng 0.0.0.0

Ví dụ:
R1(config-if)# ip summary-address eigrp autonomous-system 0.0.0.0 0.0.0.0

2. Dùng redistribute giống như trên đã đề cập:

3. Dùng lệnh ip default-network

R1(config)# ip default-network network-number

Cám ơn

nhanh
28-06-2004, 05:55 PM
>Có hai cách để thực hiện default-network: lệnh ip route 0.0.0.0/0 và ip default-network. Không hiểu câu hỏi có phải nói về sự khác biệt hai lệnh này??

Về cơ bản thì hai lệnh giống nhau, nhưng có 1 điểm khác biệt là: địa chỉ sau lệnh ip default-network là địa chỉ major network, vì ip default-network là classful, do đó khi dùng lệnh này với địa chỉ đã chia subnet thì route default sẽ không xác định cụ thể được, còn lệnh ip route 0.0.0.0 thì xác định chính xác địa chỉ của next hop.

Ví dụ :
Router3
|
192.168.10.96/27
|
router 2 --192.168.10.64/27---R4
|
192.168.10.32/27
|
Router 1
Giả sử lệnh ip default-network nhập ở router 2 để xác định route đến R1 là default thì phải vào : ip default-network 192.168.10.0, do đó nó sẽ không xác định được đường đến route 1 mà sẽ chọn đường nào có AD thấp nhất. Còn thực hiện bằng lệnh ip route 0.0.0.0 sẽ xác định chính xác đường đến R1 bằng lệnh: ip route 0.0.0.0 0.0.0.0 192.168.10.33(giả sử interface của R1 nối đến R2 có địa chỉ 192.168.10.33)

Còn khi mạng không chia subnet thì không có sự khác biệt giữa hai lệnh trên.

Mong nhận được ý kiến của các bạn

admin
19-11-2004, 07:10 AM
Cấu hình tuyến đường mặc định (default route)

Trong những hệ thống mạng lớn hơn, có thể cấu hình nhiều tuyến đường tĩnh. Nếu quá nhiều tuyến đường tĩnh được cấu hình, bạn có thể cấu hình một dạng tuyến đường tĩnh đặc biệt gọi là static default route.

Router(config)#ip route 0.0.0.0 0.0.0.0 s0

Khi thông tin định tuyến được truyền thông qua một giao thức định tuyến động, không cần yêu cầu một cấu hình gì thêm. Trong trường hợp của RIP, chỉ có thể có một default-route, network 0.0.0.0. Tuy nhiên trong trường hợp của IGRP, vài network có thể làm default route mặc dù chỉ một default-route là được dùng.

Nếu một router không có một network kết nối trực tiếp nhưng có một route về nó, route đó có thể xem xét như candidate default-route. Để cấu hình một default-route, dùng lệnh sau:

Router(config)#ip default-network network-number

Lệnh này sẽ tạo ra một tuyến đường mặc định được gửi trong các gói tin cập nhật. Nó sẽ không tạo ra một default route trên router được cấu hình và nó chỉ tạo ra một default route nếu route đó có tồn tại trong bảng định tuyến. Khi có nhiều default route trong bảng định tuyến, các default route này sẽ được kiểm tra. Đường đi mặc định tốt nhất sẽ được chọn lựa dựa trên giá trị AD và metric. Địa chỉ gateway của đường đi tốt nhất sẽ trở thành gateway of last resort của router. Thuật ngữ này còn có một tên gọi khác là default-router. Bạn có thể hiển thị gateway of last resort bằng lệnh:

Router#show ip route

Giá trị default route sẽ xuất hiện trong bảng định tuyến và được đánh dấu như một tuyến đường tĩnh với ký hiệu S*. Giá trị gateway of last resort sẽ được gán về network này.

ductv1
28-12-2008, 12:19 AM
Có 3 cách để đưa default-route vào trong một hệ thống mạng chạy EIGRP:

1. Bằng cách summary một default-route có dạng 0.0.0.0

Ví dụ:
R1(config-if)# ip summary-address eigrp autonomous-system 0.0.0.0 0.0.0.0

2. Dùng redistribute giống như trên đã đề cập:

3. Dùng lệnh ip default-network

R1(config)# ip default-network network-number

Cám ơn

Cái Sticky Thread này lâu lắm rồi mà vẫn stick :106:

Cái này em thấy anh Minh trả lời chính xác nhưng mà không giải thích thì nhiều bạn đọc chắc chắn vẫn không phân biệt nổi 3 cái này

Em trích ra thêm trong sách BSCI.Portable.Command.Guide

1. Redistribute static route
NOTE: Use this method when you want to draw all traffic to unknown destinations to a default route at the core of the network.

2. ip default-network

NOTE: For EIGRP to propagate the route, the network specified by the ip
default-network command must be known to EIGRP. This means the network must be an EIGRP-derived network in the routing table, or the static route used to generate the route to the network must be redistributed into EIGRP, or advertised into these protocols using the network command.

TIP: In a complex topology, many networks can be identified as candidate
defaults. Without any dynamic protocols running, you can configure your router to choose from a number of candidate default routes based on whether the routing table has routes to networks other than 0.0.0.0/0. The ip default-network command enables you to configure robustness into the selection of a gateway of last resort. Rather than configuring static routes to specific next hops, you can have the router choose a default route to a particular network by checking in the routing table.

3. Summarize Into 0.0.0.0

NOTE: Summarizing to a default route is effective only when you want to provide remote sites with a default route, and not propagate the default route toward the core of your network.

NOTE: Because summaries are configured per interface, you don't need to worry about using distribute lists or other mechanisms to prevent the default route from being propagated toward the core of your network.

ductv1
28-12-2008, 12:21 AM
ah , mình thấy quyển BSCI.Portable.Command.Guide rất hay, bạn nào còn thắc mắc vấn đề j thì cứ lôi cái quyển đó ra mà tra.

Mình ko có link, các bạn tự tìm nhé

tranmyphuc
28-12-2008, 03:29 AM
ah , mình thấy quyển BSCI.Portable.Command.Guide rất hay, bạn nào còn thắc mắc vấn đề j thì cứ lôi cái quyển đó ra mà tra.

Mình ko có link, các bạn tự tìm nhé
Chào !!


http://www.4shared.com/file/46121863/7e00f991/CCNP_BSCI_Portable_Command_Guide_May_2007.html?s=1

Chúc vui vẻ.