Indeed, as already mentioned, as-path-prepend is to (possibly) control traffic, ENTERING your ASN.
To manipulate exit point FROM your ASN, try to set highest localpref for the needed neighbor.
Worth mentioning that in case you set highest localpref for default or specific route towards one of BGP peers, it will not differentiate exit point based on the traffic source. Filter-based-forwarding (aka PBR - policy-based-routing) can solve this problem to override regular routing.
------------------------------
FARID AKHUNDOV
------------------------------
Original Message:
Sent: 06-12-2024 16:06
From: DEBTANU BISWAS
Subject: Need a urgent help regarding route manipulation
Hi Guys , Hope you guys are doing well , so my problem is i am trying to do a route manipulation in a customer network, So i have 3 ISPs .
ISP1- 10.10.10.1 , int-ge-0/0/0
ISP2-20.20.20.1, int-ge-0/0/1
ISP3-30.30.30.1, int - ge-0/0/2
LAN1 - 192.168.0.1/24 , int -0/0/3
LAN2-172.16.0.1/24 ,int-0/0/4
All the isps are connected via eBGP.
Now my preferences are :
172.16.0.1 - ISP3>ISP2>ISP1
192.168.0.1- ISP2>ISP3>ISP1
i am using as-path-prepand on export policy , it is taking the right interface (ge-0/0/2) but in trace route it is showing ISP2's IP as next hop.
root# run ping 8.8.8.8 source 172.16.0.1 detail
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8 via ge-0/0/2.0: icmp_seq=0 ttl=254 time=313.298 ms
64 bytes from 8.8.8.8 via ge-0/0/2.0: icmp_seq=1 ttl=254 time=83.119 ms
64 bytes from 8.8.8.8 via ge-0/0/2.0: icmp_seq=2 ttl=254 time=81.077 ms
64 bytes from 8.8.8.8 via ge-0/0/2.0: icmp_seq=3 ttl=254 time=14.460 ms
64 bytes from 8.8.8.8 via ge-0/0/2.0: icmp_seq=4 ttl=254 time=127.108 ms
64 bytes from 8.8.8.8 via ge-0/0/2.0: icmp_seq=5 ttl=254 time=217.713 ms
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max/stddev = 14.460/139.463/313.298/98.914 ms
[edit]
root# run traceroute 8.8.8.8 source 172.16.0.1
traceroute to 8.8.8.8 (8.8.8.8) from 172.16.0.1, 30 hops max, 52 byte packets
1 20.20.20.1 (20.20.20.1) 521.520 ms 519.456 ms 44.076 ms
2 192.168.25.2 (192.168.25.2) 238.321 ms * 63.903 ms
[edit]
root#
Can you guys please help me with it ?
------------------------------
DEBTANU BISWAS
------------------------------