I have ~20 public IP addresses defined on my server. Now, when I connect to a remote server via terminal, it gets connected from the primary IP of my server.
But I want to use terminal from my another IP address. Is this possible?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
If you are using ssh to connect to the remote host then you can use the
BindAddress directive to specify a local address to us for the connection
BindAddress Use the specified address on the local machine as the source address of the connection. Only useful on systems with more than one address. Note that this option does not work if UsePrivilegedPort is set to “yes”.
You can use this like so
ssh email@example.com -o BindAddress=ip.add.re.ss
You can also configure your ~/.ssh/config file to do this on a per host basis.
Host remote.tld BindAddress ip.add.re.ss Host another BindAddress ss.er.dda.pi
Note that the Host matched has to be the same as that specified on the command line but you can use wildcards.
If you're using telnet then use the -b switch
-b address Use bind(2) on the local socket to bind it to a specific local address.
telnet -b ip.add.re.ss remote.tld