Cisco – Update-source loopback and next-hop-self

bgpciscojuniperrouting

I've a question related to BGP configuration. If I'm using the update-source loopback or next-hop-self commands, will they modify the source IP address in the packet?

Assume R1 has an eBGP session with R2 and iBGP session with R3 and R4. R1 uses the command update-source loopback and sends the packet to R3. Now, the source IP address of the packet has been changed. R3 forwards the packet to its destination through some other peer. Now, when the packet comes from destination, it wont be having the correct source address from where packet came because of the command update-source loopback. So, does BGP handle this case?

Same for the next-hop-self command. R2 can use this command while sending the packets to R3 or R4, and further they can send to their peers.

Can someone please clarify my doubts?

Best Answer

The two commands are for completely different reasons, and they do not modify addresses on packets. The update-source command will try to form a neighbor relationship using an address different than the directly connected address, while the next-hop-self command tells a neighbor where to send packets when the neighbor doesn't know how to reach the advertising router.

If you are using eBGP, and the update-source command, you must understand a few things. The eBGP peer must have a route to the interface in the update-source command in order to form a neighbor. That would involve using a different routing protocol or static routing for the eBGP neighbor to be able to reach the interface in the update-source command. That is why it is normally only used for iBGP. Also, with eBGP, you muse use the ebgp multihop command, otherwise it will not work. This command is for forming the BGP neighbor connection.

The next-hop-self command has nothing to do with the addresses on packets. That command simply tells the neighbor that it should send packets toward the destination to the router with that command. It is used in cases where the neighbor router doesn't know how to reach the advertising router, but the router with the next-hop-self command does. This command is for advertising route direction.

Related Topic