src nat based on connection mark

Hi,

I have an router with two public addresses on the same interface from the same ISP but with different subnets. The router will act as an ppp server.

I need the ppp connected to the public ip 1.1.1.1 src nated to 1.1.1.1
and ppp connection to the public ip 2.2.2.2 src nated to 2.2.2.2

Can I mark the incoming connection and then use that connection mark to srcnat to the right adress?

regards

if i were you. i would introduce two different local ip addresses and for two different gateway. and i would use two gateway on mh router and with help of mangle i could mark route the packet and then use them in 1st or second gateway.
with this you can generate different ppp secret and automatically they will use predefined gateway

Sent from my SM-N910C using Tapatalk