Background
I run a server with two external IPv4 addresses. IP-address A (IP-A) and IP-address B (IP-B).
Goal
I would like to access IP-A over HTTPS port 443 and SSH port 22 only. IP-B shouldn't listen to any incoming traffic.
Then I'd like the server to use IP-B only for all outgoing traffic. Or at least to tell the server to use IP-B for outgoing traffic only for specific commands.
Example in pseudo code:
1: I connect to the server over IP-A and call `ping example.com`
2: The server executes it and sends the ping requests outgoing from IP-B to example.com.
3: I can read the output of the command on my connection with IP-A
Why would I want this?
Because the management console I'll be using is on IP-A. I want IP-A not to be directly related to IP-B (at least for the outside world). Instead I want example.com to see "I got a ping request from IP-B.". And when someone connects to IP-B that IP address is not listening to anything. While IP-A is nowhere in their logs.
Ultimately I'd like to add even more addresses and be able to tell IP-A:
- Use IP-B for this command
- Use IP-C for this command
- Use IP-D for this command
- ...
Any thoughts on how to configure the above scenario? I'm currently using Ubuntu but I'm open to suggestions for other Linux distributions.