I’m running VyOS as a BGP router for a public ipv4 network. When you ping one of the IP’s behind the router (eg 12.34.5.2), it shows the routers IP address as the one provided to me by my transit provider. but I would like it to show my IP address instead (12.34.5.1), any help on how to accomplish this is appreciated!
afaik, ping reply is always sourced from the ip as used in the destination in echo-request.
otherwise , remote host will be confused, by seeing a reply from another address than ping was sent to.
Hower, traceroute ttl timeouts will be sent from source IP on interface sending the packet.
For traceroute either the interface where the packet arrived at will be used to send the “ICMP TTL Exceeded” or the loopback interface if such exists - I dont recall which one the Linux kernel prefer.
If you for whatever reason want to manipulate this you can setup a SNAT rule for that.
After some digging I found that setting net.ipv4.icmp_errors_use_inbound_ifaddr to zero will make the kernel repose to be originated by the address, not the interface.
aldemaro@staging-1-4-0# set system sysctl parameter net.ipv4.icmp_errors_use_inbound_ifaddr value 0