I am a beginner in BGP. I have query regarding network command in BGP.
what's the correct way of applying network command on routers running BGP.
In the attached topology, I have created 2 loopbacks on R5 (18.104.22.168/32 & 22.214.171.124/24) & 2 loopbacks on R7 (126.96.36.199/32 & 188.8.131.52/32) and then advertised in BGP by using network command in R5 & R7 respectively, so in R1 routing table, I see routes for these Loop backs, In BGP table, these routes were best routes , but the problem was these networks were not reachable from R1.
So I tried 2 methods to fix this connectivity issue.
1) I advertised all networks like 10.1.24.0/24,10.1.36.0/24, 10.1.45.0/24, 10.1.57.0/24, 10.1.67.0/24 in R1 by using network command, so ping started working.
2) I used network command and redistribute connected on all routers(Except R1) , here also connectivity issue fixed
Kindly confirm which is the correct one. Please find the attached topology for more details.
Both approaches work. As to which is better I would suggest that 1 is probably better. My reason for this is that all of the necessary changes are made on a router where you have administrative control. In a lab environment you actually have administrative control of all routers. But in a live environment when you are using EBGP you typically have administrative control of devices within your own AS but do not have administrative control in external AS.
You are welcome. This community is an excellent place to ask questions and to learn about networking. I hope to see you continue to be active in the community.