Score:0

How to switch between multiple ip addresses

us flag

As an example, I have 2 IP addresses on my NIC:

enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000
link/ether 02:00:17:06:ac:05 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.25/24 brd 10.0.0.255 scope global enp0s3
   valid_lft forever preferred_lft forever
inet 192.XXX.1.25/24 brd 192.168.1.255 scope global enp0s3
   valid_lft forever preferred_lft forever
inet6 fe80::17ff:fe06:ac02/48 scope link 
   valid_lft forever preferred_lft forever

I can login to my server via both IPs but how can I tell the server that it should use the public who I am logged in for example if I logged in with IP XXX.XXX.XXX.1 public IP should the same and if I logged in with XXX.XXX.XXX.2 it should use it as public IP. If I send request to ifconfig I got same IP response, I think it's the default IP is the first.

Nikita Kipriyanov avatar
za flag
It is silly to mask private IPs, especially like this. I certainly use 192.168.1.25 too somewhere, this discloses absolutely nothing. Don't do this, leave them exactly as they were.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.