In-depth discussion on the next-hop option (discard/receive/reject) of Static Routing)

Source: Internet
Author: User

Previous post posted on Junipers:

Recently, I did a BGP test in JNCIA and studied the next-hop option (discard/receive/reject) of Static Routing. I will share some of my experiences with you. If the statement is incorrect, click it!

The following is the text. The attachment contains the topology and initial interface configuration file.

 

650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131227/031T33C3-0.jpg "width =" 160 "height =" 120 "/>

Configure STATIC_MS/STATIC_CBL and specify static routes respectively.
Muscat:
Static 10.20.1.0/24 next-hop 172.16.21.2
Static 10.20.2.0/24 next-hop 172.16.21.2
Chablis:
Static 10.20.3.0/24 next-hop 172.16.23.2
Static 10.20.4.0/24 next-hop 172.16.23.2

1. Q &:
If static2bgp is configured separately in Muscat or Chablis, neither Shiraz nor Chablis can learn BGP routing. in Shiraz, 10.20.1.0/10.20.2.0/10.20.3.0/10.20.4.0/both are hidden and the status is unusable.
Analysis: Because Shiraz/Chablis does not know how to reach the 10.20.1.0/10.20.2.0 route on Muscat, it is precisely that they do not have a route for the Muscat direct connection interface fxp1.21 (172.16.21.0/30, so they won't put the two routes into BGP.
2. Q &:
After direct2bgp is configured, Shiraz/Chablis can learn the BGP Route
Analysis: When direct2bgp is configured, The fxp1.21 network segment (172.16.21.0/30) of the direct connection interface on the Muscat is actually declared to BGP, so that Shiraz/Chablis will know how to reach 10.20.1.0/10.20.2.0.

2. Analysis of JNCIA F8.13 _ 5Routers Topology
 

650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131227/031T31605-1.jpg "width =" 160 "height =" 120 "/>

Delete STATIC_MS/STATIC_CBL and fpx1.21/FXP1.23
Muscat (only interfaces fxp1.100/Lo0.6 are available, and there is no interface for 10.20.1.0/10.20.2.0)
Static Routing:
Static 10.20.1.0/24 discard
Static 10.20.2.0/24 discard
Chablis (only interfaces fxp2.101/Lo0.7 are available, and there is no interface for 10.20.3.0/10.20.4.0)
Static Routing:
Static 10.20.3.0/24 discard
Static 10.20.4.0/24 discard

1. Q &:
If static2bgp is configured separately in Muscat or Chablis, Shiraz/Chablis can learn these static routes.
Analysis: see the next-hop option explanation IJNR_P355:
Once in the configuration, static routes appear in the routing table if they are active. active static routes have a valid next-hop option. routes with reject or discard options as next hops always are active and present in the routing table. routes with an IP address as a next hop are present only if that address is reachable within ss a directly connected interface on the router.
According to the above explanation, static 10.20.3.0/24 discard actually creates a certain present route in the routing table of Muscat, so that BGP will load it into the BGP table.
Discuss about BGP routing in jncia sg:
BGP routers by default advertise only active BGP routes in the routing table. this creates a sort of chicken-and-egg problem. A route can appear in the routing table as a BGP route only if it is already ed from a BGP peer, but a BGP peer can only advertise a route if it's already in the routing table as a BGP route.

2. Q:
What is the receive/reject parameter of the static route next-hop? If there are no interfaces for 10.20.1.0/16, 10.20.2.0/16, 10.20.3.0/16, and 10.20.4.0/16, how can I verify the accessibility of these network segments?
Verification:
Chablis static route:
Static 10.20.3.0/24 discard
Static 10.20.4.0/24 receive
Static 10.20.5.0/24 reject
Conclusion:
The configuration of Chablis static route next-hop to discard/receive/reject does not affect the BGP Route on Shiraz/Muscat, and can be learned correctly on Shiraz/Muscat.

3. Q:
Do I need to configure loopback to 192.168.7.7/32, 10.20.3.1/32, 10.20.4.1/32 in Chablis?
Meng Shiyu blog: http://jncie.wordpress.com/category/ospf/ ----->
JNCIP case study-Juniper/Cisco OSPF interoperates with Part1. Multiple addresses are configured on the loopback interface, and each address belongs to the network segment of the static route.

Reference Documentation:
Help reference routing-options static
The loop interface is automatically declared.
Not Automatically announced after version 8.1

3. Introduce a static route with the next-hop option in IGP.
1. Muscat/Shiraz/Chablis
Deactivate prot bgp
Muscat:
1. policy static2ospf, then export to ospf
2. routing-options {
Static {
Route 10.20.1.0/24 discard;
Route 10.20.2.0/24 reject;
Route 10.20.7.0/24 receive;
Route 10.20.6.0/24 discard;
}
3. verification:
Lab @ FSJ # run ping 10.20.1.1 logical-router Chablis
PING 10.20.1.1 (10.20.1.1): 56 data bytes
^ C
--- 10.20.1.1 ping statistics ---
35 packets transmitted, 0 packets received, 100% packet loss
[Edit logical-routers Chablis]
Lab @ FSJ # run ping 10.20.7.1 logical-router Chablis
PING 10.20.7.1 (10.20.7.1): 56 data bytes
^ C
--- 10.20.7.1 ping statistics ---
16 packets transmitted, 0 packets received, 100% packet loss
Ping 10.20.1.1/10.20.7.1 does not return any messages. This indicates that the message is directly sent to the discard after it reaches the Muscat, but the Muscat does not send a message to the source.
The problem is that ping a non-existent address from Chablis without any feedback. This is exactly the same as discard/receive. In this way, it is impossible to verify whether Chablis to 10.20.1.1/10.20.7.1 is truly reachable.
Lab @ FSJ # run ping 1.1.1.2 logical-router Chablis
PING 1.1.1.2 (1.1.1.2): 56 data bytes
^ C
--- 1.1.1.2 ping statistics ---
6 packets transmitted, 0 packets received, 100% packet loss
Of course, the above is based on the olive logical router. It should not be like this on the real Juniper Router, for example:
Lab @ FSJ # run ping 1.1.1.2
PING 1.1.1.2 (1.1.1.2): 56 data bytes
Ping: sendto: No route to host
Ping: sendto: No route to host
^ C
--- 1.1.1.2 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
It is also a nonexistent address (1.1.1.2), but the olive result is different from the olive logical router. It should be the correct information returned by olive.

Lab @ FSJ # run ping 10.20.2.1 logical-router Chablis
PING 10.20.2.1 (10.20.2.1): 56 data bytes
36 bytes from 192.168.100.2: Destination Host Unreachable
Vr hl tos Len ID Flg off TTL Pro cks Src Dst
4 5 00 0054 9709 0 0000 fe 01 f3df 192.168.101.2 10.20.2.1
Ping 10.20.2.1 to view the message returned from 192.168.100.2: Destination Host Unreachable. This indicates that the message has successfully arrived at Muscat, but is configured with discard. Therefore, after the Muscat packet is discarded, a message "Destination Host Unreachable" is sent to source"

4. Configure the second lo0.6 address 10.20.6.1/32 on the Muscat and declare it in area 0.
Lo0 {
Unit 6 {
Family inet {
Address 192.168.6.6/32;
Address 10.20.6.1/32;
}
}
Ospf {
Export static2ospf;
Area 0.0.0.0 {
Interface lo0.6;
Interface fxp1.100;
}
}
Policy-statement static2ospf {
Term static2ospf {
From protocol static;
Then accept;
}
}
Routing-options {
Static {
Route 10.20.1.0/24 discard;
Route 10.20.2.0/24 reject;
Route 10.20.7.0/24 receive;
Route 10.20.6.0/24 discard;
}
Change the next-hop option of 10.20.6.0/24, whether it is discard or reject/receive. The feedback messages obtained from ping 10.20.6.1 from Chablis are the same.
Lab @ FSJ # run ping 10.20.6.1 logical-router Chablis
PING 10.20.6.1 (10.20.6.1): 56 data bytes
64 bytes from 10.20.6.1: icmp_seq = 0 ttl = 254 time = 0.294 MS
64 bytes from 10.20.6.1: icmp_seq = 1 ttl = 254 time = 0.279 MS
^ C
--- 10.20.6.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
Round-trip min/avg/max/stddev = 0.279/0.286/0.294/0.008 MS

However, ping 10.20.6.2 from Chablis and change the next-hop option (discard/recieve/reject) of 10.20.60.0/24 to get the same feedback message as 3. verfication.

5. Finally, let's take a look at the ospf routes on Chablis:
Lab @ FSJ # run show route protocol ospf logical-router Chablis
Inet.0: 15 destinations, 15 routes (15 active, 0 holddown, 0 hidden)
+ = Active Route,-= Last Active, * = Both
10.20.1.0/24 * [OSPF/150] 00:11:19, metric 0, tag 0
> To 192.168.101.1 via fxp2.101
10.20.2.0/24 * [OSPF/150] 00:11:19, metric 0, tag 0
> To 192.168.101.1 via fxp2.101
10.20.6.0/24 * [OSPF/150] 00:11:19, metric 0, tag 0
> To 192.168.101.1 via fxp2.101
10.20.6.1/32 * [OSPF/10] 00:11:19, metric 2
> To 192.168.101.1 via fxp2.101
10.20.7.0/24 * [OSPF/150] 00:11:19, metric 0, tag 0
> To 192.168.101.1 via fxp2.101
192.168.5.5/32 * [OSPF/10] 00:11:19, metric 1
> To 192.168.101.1 via fxp2.101
192.168.6.6/32 * [OSPF/10] 00:11:19, metric 2
> To 192.168.101.1 via fxp2.101
192.168.100.0/24 * [OSPF/10] 00:11:19, metric 2
> To 192.168.101.1 via fxp2.101
224.0.0.5/32 * [OSPF/10] 01:11:49, metric 1
MultiRecv
The next-hop values of 10.20.1.0-7.0 are 192.168.101.1, the Preference Value is 150 (OSPF external routes), and the metric Value is 0.
The next-hop of 10.20.6.1/32 is 192.168.101.1, the Preference Value is 10 (OSPF internal routes), and the metric Value is 2
Analysis: 10.20.1.0-7.0 is imported as static2ospf, so it is treated as OSPF external routes. In addition, external type and metric are not specified in static2ospf, so it is OSPF external type 1, and metric is 0.
10.20.6.1/32 itself is the lo0.6 interface IP address of Muscat and is declared in area 0. Therefore, it is regarded as OSPF internal routes and has two hops from Chablis-Shiraz-Muscat, therefore, metric is 2.

Based on the above, we can draw the following conclusions:
1. The next-hop (discard/receive/reject) option is added to the static route to create a certain present route so that they can be put into the routing table, further, these static routes can be passed to other routers with the policy.
2. There is no relationship between the routes with the next-hop option and interfaces. That is to say, there is no need to add an address such as 10.20.1.1/32 to lo0.6 of Chablis. These static routes can be any routes that do not exist at all, in this way, you can list all the customer's network segments, which is equivalent to simulating the customer's network.
3. To simulate the customer network, there is no need to use a topology like JNCIA F8.13 _ 9Routers based on the two points above. You can use the JNCIA F8.13 _ 5Routers topology. Of course, we need to list all the network segments of the customer using static routes and configure the next-hop option. Item
4. Based on 3: Introduce a static route with the next-hop option in IGP. I personally think reject is better.

 

Tonyblair: The Next Hop of receive can respond to ICMP-ECHO information for any traffic that belongs to this static route.

I don't know if you have done this. I have verified the receive option:

3. Introduce a static route with the next-hop option in IGP.

Muscat:

1. policy static2ospf, then export to ospf
2. routing-options {
Static {
Route 10.20.1.0/24 discard;
Route 10.20.2.0/24 reject;
Route 10.20.7.0/24 receive; 650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'border =" 0 "alt =" "src = \ '# \'"/smilies/default/y106.gif "smilieid =" 90 "/>

Lab @ FSJ # run ping 10.20.7.1 logical-router Chablis
PING 10.20.7.1 (10.20.7.1): 56 data bytes
^ C
--- 10.20.7.1 ping statistics ---
16 packets transmitted, 0 packets received, 100% packet loss

Lab @ FSJ # run ping 10.20.1.1 logical-router Chablis
PING 10.20.1.1 (10.20.1.1): 56 data bytes
^ C
--- 10.20.1.1 ping statistics ---
35 packets transmitted, 0 packets received, 100% packet loss

Lab @ FSJ # run ping 10.20.2.1 logical-router Chablis
PING 10.20.2.1 (10.20.2.1): 56 data bytes
36 bytes from 192.168.100.2: Destination Host Unreachable
Vr hl tos Len ID Flg off TTL Pro cks Src Dst
4 5 00 0054 9709 0 0000 fe 01 f3df 192.168.101.2 10.20.2.1

The result obtained with receive is exactly the same as discard, Muscat does not respond to the ICMP-ECHO information, and no feedback is visible in Chablis, not knowing why. The reject option shows the feedback.


In fact, I have not really understood this receive option. Please advise!
Tonyblair:
There must be a problem. RECEIVE is the best option to respond without the local interface address.

This is a bit strange. I verified it again today. receive did not respond. My olive is 7.2.

What does a response look like? Is that true? This is the result of my direct ping on Muscat.
Lab @ OLIVE # run ping 10.20.7.1 logical-router Muscat
PING 10.20.7.1 (10.20.7.1): 56 data bytes
Ping: sendto: Can't assign requested address
Ping: sendto: Can't assign requested address
Ping: sendto: Can't assign requested address

In addition, the "RECEIVE" mentioned above is the best practice. You don't need to configure the local interface address to respond. "Does it mean that discard/reject must be configured with the local interface address? Tonyblair: back upstairs, yes. discard/reject must be configured locally to respond. Example:

R1 -- fe-0/0/0 ------------- fe-0/0/0-R3


[Edit]
Jnpr @ R1 # show interfaces fe-0/0/0
Unit 0 {
Family inet {
Filter {
Output test1;
}
Address 13.13.13.1/24;
}
Family iso;
}

[Edit]
Jnpr @ R1 # show interfaces lo0
Unit 0 {
Family inet {
Address 1.1.1.1/32;
}
Family iso {
Address 49.4949.1111.1111.1111.00;
}
}


[Edit]
Jnpr @ R1 # show protocols isis
Level 1 disable;
Interface fe-0/0/0.0;
Interface lo0.0;

R1.


[Edit]
Jnpr @ R3 # show protocols isis
Export redis-static;
Level 1 disable;
Interface fe-0/0/0.0;
Interface lo0.0;

[Edit]
Jnpr @ R3 # show policy-options policy-statement redis-static
Term 1 {
From {
Protocol static;
Route-filter 3.0.0.0/8 exact;
Route-filter 4.0.0.0/8 exact;
}
Then accept;
}


[Edit]
Jnpr @ R3 # show routing-options static
/* This static route is to show to Kelvin how to optimize customer deployments */
Route 3.0.0.0/8 receive;
Route 4.0.0.0/8 receive;

Note: No interface IP addresses in the 3/8 or 4/8 CIDR blocks exist on R3.

All right, configure and paste the results.



[Edit]
Jnpr @ R1 # run ping 4.1.1.1 rapid count 10
PING 4.1.1.1 (4.1.1.1): 56 data bytes
!!!!!!!!!!
--- 4.1.1.1 ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
Round-trip min/avg/max/stddev = 0.861/0.920/1.321/0.134 MS

[Edit]
Jnpr @ R1 # run ping 3.3.23.100 rapid count 10
PING 3.3.23.100 (3.3.23.100): 56 data bytes
!!!!!!!!!!
--- 3.3.23.100 ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
Round-trip min/avg/max/stddev = 0.862/1.116/2.581/0.509 MS

[Edit]
Jnpr @ R1 # run ping 3.4.146.100 rapid count 10
PING 3.4.146.100 (3.4.146.100): 56 data bytes
!!!!!!!!!!
--- 3.4.146.100 ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
Round-trip min/avg/max/stddev = 0.862/0.914/1.269/0.118 MS

[Edit]
Jnpr @ R1 # run ping 4.234.19.100 rapid count 10
PING 4.234.19.100 (4.234.19.100): 56 data bytes
!!!!!!!!!!
--- 4.234.19.100 ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
Round-trip min/avg/max/stddev = 0.871/0.929/1.314/0.130 MS

650) this. width = 650; "onclick = 'window. open (" http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'border =" 0 "alt =" "src = \ '# \'"/smilies/default/y100.gif "smilieid =" 84 "/>

The IP addresses to be pinged do not exist in R3. we can see that the actual Juniper router is used upstairs, and my tests are based on olive + logical router. this is probably the result difference of 650) this. width = 650; "onclick = 'window. open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. src) 'border =" 0 "alt =" "src = \ '# \'"/smilies/default/y100.gif "smilieid =" 84 "/>

In addition, if "discard/reject must be configured locally to respond" is mentioned above, does it mean to configure the corresponding number of local interfaces for how many static routes? For example, in R2, if discard/reject is used:
. Jnpr @ R2 # show interfaces lo0
Unit 0 {
Family inet {
Address 1.1.1.1/32;
Address 4.4.4.4/32;
Address 5.5.5.4/32;
}

If there is a static route similar to 6.0.0.0/8--9.0.0.0/8, add?


I am not really a guy. I can only rely on olive to learn, but I don't want to be misled by this difference, nor do I want my tests to mislead others. Can I ask the Tmall Moderator to add a discard/reject sample and test feedback?

KKBlue:

Tell me what I think
Maybe it's too simple.
It may be that the owner thought it was too complicated.
In fact, you don't have to think so much about it.
First, the role of Static Routing is to create a route table and specify the next one. This is the king channel, right?
Second, if there is no next hop in a static route, it will be tricky. For example, in a static route, the special aggregate or generate have default actions, if you haven't done this experiment, forget it.
Third, no matter how complicated the environment is, the role of Static Routing is that there is a route table entry in inet.0. When the router receives the data packet, it processes the data according to the next-hop of the static route, right?
So what are the solutions? We can see that there is a specified next hop. This is the router's score.
You can also learn about discard, reject and receive.
What I want to say is whether the packet is routed, whether it is discard, reject or receive? I'm afraid the answer is no. Well, if data packets are not routed, they will all be killed. Only Heaven will find the shadow of this data packet. Then the router targets the data packet sender, there will be some operations

As follows:
Discard, --- router said it would be lost if it was lost. I don't care about you, so what you may see is icmp timeout, the killer of silence.
Reject --- router said that I had a conscience and lost your package. I also told you to give you an icmp unreachable, kill a person, yell at me, and read the name cast, think about the last paragraph
Receive --- this is too bad, obviously not, it is not reachable, obviously the package has been lost, you can router or give you an echo reply, it makes you feel like !!!!!, It's interesting.
In a sense, reject and receive are the same.
Packet, at least not sent, but the icmp message generated by the router is different.
Just as if you write a love letter to a girl, you need to transfer it through her parents,
The best result was handed over by the parents -- your kid is lucky -- this is next-hop.
Other results
If your parents have lost the email and don't tell you, you can wait. This is discard.
My parents have lost the letter and tell you, You kid should not be a hooligan to my girl. This is reject.
My parents lost the email and told you that the email was sent, boy. This is receive.

Some personal opinions may be immature. I hope you can correct them.

 

This article is from the "Hongqiao walk" blog, please be sure to keep this source http://cnahqmb.blog.51cto.com/55591/527987

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.