Define source IP for router traffic generated

The router normally chooses a local source address for each route based on the subnet of that route’s gateway IP, and you can specify a particular address to use on that route for locally originated traffic.

Where this is not sufficient, like in your case where the public adddress is not assigned to the internet-facing interface, EDIT: you can use src-nat. (was: an ugly way to src-nat a locally originated packet exists).