Sip and Natting

Wish to find out if its possible to have to different external IP’s on sip extensions and sip trunks for example

we want sip extensions to have a external IP of

externip=10.0.0.1

And sip trunks to have a external IP of

externip=20.0.0.1

Would something like this be possible within asterisk, and if so how would one do it.

Asterisk has no concept of the difference between trunks and extensions.

To achieve this you would need to set up the OS routing tables so that all outgoing traffic to peers you consider trunks used one interface and all outgoing traffic to peers you consider extensions used the other.

Knowing the underlying reason for this requirement might help get a better solution.