1 VPS with 2 IP addresses. How to make them independent?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I setup a VPS recently with 2 IP addresses and the second address would not work untill I shutdown the VPS and started it again. A reboot did not work, need to shutdown and restart, give it a try...
That may sound strange but the recommendation came from my VPS service provider and it worked.
The IP's are working, both have access to the internet.
But the traffic done by the interface ens3:0 passes through the interface ens3, and that's what I did not want.
I wanted two independent interfaces.
Well your interfaces file looks about the same as mine, except that I have a debian system and interface names are different.
I recall from my research at that time it was important to ensure only one gateway which you have. It's late here but tomorrow I can check what I have in my interfaces file.
Contact your VPS provider. It's most likely that your VPS is provisioned with only a single virtual NIC and that this is your VPS providers prefered way of providing multiple IP addresses.
But with the current configuration the traffic off the interface ens3:0 passes through interface ens3.
Yes, you said that too.
Just because you've two IPV4 addresses assigned doesn't mean your VPS has two virtual NICS assigned. From the information you've provided, where both IPs are being presented through the one virtual NIC, this appears to be the case.
Just because you've two IPV4 addresses assigned doesn't mean your VPS has two virtual NICS assigned. From the information you've provided, where both IPs are being presented through the one virtual NIC, this appears to be the case.
... and how can I put those IP's in separate NICs?
Do I have to configure my "/etc /network/interfaces" file differently?
... and how can I put those IP's in separate NICs?
Do I have to configure my "/etc /network/interfaces" file differently?
Nobody here can tell you because you've not told us any useful information about the VPS.
Is this one you've set up yourself on your own host?
Is this one that you're paying for from a hosting provider?
If it's on your own host then on the host you'll need to assign another NIC to the virtual instance.
If it's from a hosting provider then you'll need to ask them to assign another NIC to it, and good luck with that as they'll most likely not be interested in providing you with a custom environment.
What you have configured is called IP aliasing. It allows the same network interface to have more then one IP address. As stated you need two network interfaces and we need the answers to the above questions.
If it's from a hosting provider then you'll need to ask them to assign another NIC to it, and good luck with that as they'll most likely not be interested in providing you with a custom environment.
I have sent a request for clarification to my hosting provider.
I verify that all data leaves the VPS normally by one of two IP's. As for the input, the data to reach the interface ens3:0 passes through the interface ens3.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.