I''m not sure I follow your need, but I think you are saying:
- peer A customer sends prefix with some prepended AS added
- peer B customer sends prefix without any prepend
- normal operation you send these on to the upstream peers
What you want to do then is:
- peer A remove the customer prepend and send to upstream peers
- peer B add prepended AS and send to upstream peers
For removal of AS see,
If the AS is a private one you could use remove-private
http://www.juniper.net/techpubs/en_US/junos11.4/topics/concept/bgp-remove-private-as-understanding.html
For public AS the as-override may work for you but is not as flexible.
http://www.juniper.net/techpubs/en_US/junos11.4/topics/reference/configuration-statement/as-override-edit-protocols-bgp.html
To add prepending this is the example
https://www.juniper.net/documentation/en_US/junos/topics/example/routing-policy-security-routing-policy-to-prepend-to-as-path-configuring.html
Naturally you need to change the policy from one to the other manually on your side. This is why we prefer the community solution where the customer can add the community on their own and our policy can perform the requested action on demand for that community.
------------------------------
Steve Puluka BSEET - Juniper Ambassador
IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
http://puluka.com/home------------------------------
Original Message:
Sent: 01-18-2021 05:57
From: Abed AL-Rahman Bishara
Subject: Auto controlling as-path on BGP peers
Hi
Here is the issue:
We have two BGP peers, on each MX machine.
Both BGP peers are receiving the same prefixes from the other side, but, first peer receive the prefixes without as-path, and the other one with as-path.
------------------------------
Abed AL-Rahman Bishara
------------------------------