0

while i was testing Junos in a virtual environment, i accidentally deleted an entry in the forwarding base (do not clearly remember which command i used to let that happen), but because of this the device did not want to install the route (ospf) anymore in the fib, also not when i tried with a static route, it was still showing in the RIB btw.

What can i do in the future to readd a route to the fib, incase I or someone else accidentally deletes route(s) from the forwarding base?

tia!


update:

so i was able to find the command which made me delete an entry in the fib, it was the clear-route forwarding table "network/mask" "next-hop" command. Does anyone know how to re-add routes incase something like this happens? (my motive for running this command was so i could refresh that route)

shut/noshut and/or adding a static route for the same dest. network and next-hop did not do the trick.

root# run show route

inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.0/24         *[OSPF/10] 00:00:11, metric 2
                    > to 2.2.2.1 via ge-0/0/0.0


root# run show route forwarding-table
Routing table: default.inet
Internet:
Destination        Type RtRef Next hop           Type Index    NhRef Netif
default            perm     0                    rjct       36     1
0.0.0.0/32         perm     0                    dscd       34     1
1.1.1.0/24         user     0 2.2.2.1            ucst      557     3 ge-0/0/0.0



========= command - root# run clear route forwarding-table 1.1.1.0/24 2.2.2.1

==== after

root# run show route

inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.0/24         *[OSPF/10] 00:07:30, metric 2
                    > to 2.2.2.1 via ge-0/0/0.0

root# run show route forwarding-table
Routing table: default.inet
Internet:
Destination        Type RtRef Next hop           Type Index    NhRef Netif
default            perm     0                    rjct       36     1
0.0.0.0/32         perm     0                    dscd       34     1
2.2.2.0/24         intf     0                    rslv      554     1 ge-0/0/0.0
5
  • There is not enough information to answer your question. We would need configurations and show commands to add context to what you are asking. Can you provide any other details? Commented Oct 7, 2019 at 18:31
  • 2
    I never heard of anyone 'accidentally' deleting FIB entries. That's not something you just do. You need to be more clear on what you did if you want anyone to help you.
    – Teun Vink
    Commented Oct 7, 2019 at 20:36
  • Did you try rebooting?
    – Jesse P.
    Commented Oct 9, 2019 at 13:05
  • Is the next-hop for the route you tried to add manually reachable and visible in the routing table?
    – Teun Vink
    Commented Oct 9, 2019 at 14:45
  • @TeunVink visible on rib: yeah, reachable no (gives an error that no route to host is available) before-after RIB is also on the edit output btw. restarting also works if i remember correctly but anyhow my question got answered. thanks anyway.
    – Loco
    Commented Oct 15, 2019 at 10:08

1 Answer 1

2

If you use clear ospf database, OSPF will flush the LSDB (and RIB) and re-learn the link-state database from it's neighbours. This will in turn re-install the route in the forwarding table.

Just be aware that there is no way to flush only the affected route from the table, so you there will be a brief interruption depending on how big your OSPF domain is.

2
  • thanks, it worked, do you know by any chance if there is a similar command for static routes. i dont want to keep this topic going on for too long, but i think that this knowledge can come in handy, if someone were to do this in a production network.
    – Loco
    Commented Oct 15, 2019 at 10:04
  • I would imagine that for static routes you'd have to delete them (from the config) and then re-add them (eg: rollback 1). Bear in mind that if you did this and they were being redistributed into another protocol that you'd lose them during this operation Commented Oct 15, 2019 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.