How to add a 2nd IP address?

Hello,

I have a dedicated server which has two IP addresses. The first IP is already assigned during installation as default.

How do I assign the second IP address to the system?

When I go to “Addresses and Networking” --> “Shared IP Addresses” the default IP is already there. But when I try to add the 2nd IP to “Shared addresses for any servers” I always get this error: “Failed to save shared IP addresses : ‘85.xxx.xx.xx’ is not currently active on the system - use the Network Configuration module to enable it”. Then I’m trying to find the “Network Configuration module” to enable it but I don’t simply find that module. Where do I have to go to enable the second IP address?

Thanks in advance.

under the webmin tab go to Networking - Network Configuration
Then go to Network Interfaces and add a new interface (virtual or physical) with assigned IP.

Also look in the other options like Routing and Gateways to see if this might help you getting the IP active

Thanks, Ronald.

It was a little bit tricky for me to figure out how to add a virtual interface. I did the following:

  • On the Boot Time tab I selected "eth0". Then I added there a "virtual interface". I set "Broadcast" to the same as "IP Address".

Now it works – thank you very much.

Karl

Great that it works.
broadcast usually ends in .255 though
normally it would look something like this:
destination: 123.123.123.0
gateway 123.123.123.1
Subnet mask 255.255.255.0
broadcast 123.123.123.255

I’ve set “Broadcast” to the same as “IP Address” because on the “real” interface eth0 it’s the same.

I don’t really know much what I’m doing with this setup. In other control panels like PLESK I only setup the second IP address and that’s it. Don’t know why it is so complicated here, there must be reasons.

Don't know why it is so complicated here, there must be reasons.

Just one reason: You did it the hard way. :wink:

I’d suggest you just let Virtualmin (not Webmin–you don’t ever even need to see the Network Configuration module for this) manage your IPs for you. Don’t be afraid to poke around in Server Templates…you’re going to make a lot of things more complicated for yourself, if you go straight to Webmin rather than checking Server Templates (and occasionally Module Configuration).

Specifically, in Server Templates, there is a section called "Virtual IP address", which allows you to define a range of IP addresses that new virtual servers can use IPs from. They use the interface set in Module Configuration.

I guess I should take this opportunity to point out a philosophical difference between Virtualmin and Webmin, and what that means for the way you interact with the system (and why Virtualmin+Webmin is vastly more powerful than any other product on the market…though it may seem more difficult to use if you don’t grok the differences between these two distinct, but very tightly integrated, tools).

Webmin is a general purpose system administration tool. It’ll do nearly everything you would ever need to do on the command line from a web-based UI. It is not designed to make system administration “easy”. It is a tool for people who know how to administer UNIX systems. It can make learning system administration somewhat faster (because it hides stuff like the complexity of configuration files–Webmin always gets the syntax right, and you don’t have to check man pages or search the web to be sure), and it can make it easier for people who aren’t deeply familiar with every specific service on the system keep things running. But, it is not, in any way, designed to compete with Plesk or cPanel. They are completely different tools with completely different audiences…those audiences happen to have a bit of intersection in the web hosting market, though, so Webmin is very popular amongst administrators of web servers…sometimes even beside cPanel and Plesk. But it doesn’t compete with them, and never will (it also has an order of magnitude more installations worldwide than cPanel).

Virtualmin, on the other hand, is designed to make things easy. It’s goal is to remove the majority of the tedium and repetition, as well as a large swath of visible complexity, from a web hosting system. It doesn’t do nearly as much as Webmin (Webmin has 114 standard modules and a couple hundred third party modules…no web-based administration tool does as much as Webmin), and is merely one more Webmin module. So, when you’re looking at the Virtualmin menu in a properly configured Virtualmin system, you should be seeing the most “easy and automatic” way available to do anything. The moment you click “Webmin”, you’re leaving “easy” and going over to “comprehensive and flexible”. There are a few occasions where you have to go over to Webmin to configure things that effect Virtualmin, but that’s rare, and usually means you’re entering a world of things that no other product can do.

This duality of purpose has some drawbacks…as you’ve noticed it can sometimes be hard to find things, because there are so many possibilities. We’re working on making this better. The UI is getting upgraded with just about every release. We added module search a while back, there’s pretty solid documentation for most of Webmin in the Webmin wiki (and things will get better and more nicely searchable in the next version of the website, when everything at Webmin.com and Virtualmin.com gets merged into a single system with shared bug tracker, wiki, and forums–once that’s done docs search within the product will get better, too). But, that “Webmin” menu is always going to lead to a place where you’re expected to know what you’re doing. (Even if, “know what you’re doing” means “looking at the documentation, and comprehending it”.) :wink:

Joe wrote:

I guess I should take this opportunity to point out a philosophical difference between Virtualmin and Webmin...

Thank you Joe, for the explanation.

Yes, that’s what I was thinking of Webmin and Virtualmin.

Thats’ why I wasn’t happy to setup just the second IP in Webmin the “hard way”. I just followed ronald’s recommendation.

in Server Templates, there is a section called "Virtual IP address", which allows you to define a range of IP addresses that new virtual servers can use IPs from.

This makes me confused because
a) I don’t have a “range of IP addresses”. I only have two different addresses.
b) If I click on “Ranges for automatic IP allocation” the help window says: “If SSL or FTP virtual hosts will be created using this template, you may specify a range of IP addresses to allocate from”. But on this point I don’t want to set up neither SSL nor FTP virtual hosts.

But now I did what you recommended but it does not work. I wrote my first IP into the first row of "Starting address" and "Ending address" and my second IP into the second row of "Starting address" and "Ending address". Then I tried to create a Virtual Server but there on "IP address and forwarding" I can not select the two IP addresses, I see only my first standard IP address. Before that I deleted the under Webmin added "virtual interface".

What do I wrong?

Trying to edit my post: “Oops! You’ve hit a bug in the forum software. It’ll be fixed soon.”

b) If I click on "Ranges for automatic IP allocation" the help window says: "If SSL or FTP virtual hosts will be created using this template, you may specify a range of IP addresses to allocate from". But on this point I don't want to set up neither SSL nor FTP virtual hosts.

Then why do you want another IP address? There’s no reason to use multiple addresses, if you aren’t using services that require them.

Joe wrote:

Then why do you want another IP address? There's no reason to use multiple addresses...
OK, maybe I asked a wrong question. Let me do it again:

I have a dedicated web server which is hosted at a hosting provider. This web server has two IP addresses. The provider gives the second address just for free. So I can just select under which of the two addresses a domain will work.

The first IP is already assigned to Virtualmin during installation as default.

How do I assign the second IP address to the system?

Under Plesk I can do it simply under "System" --> "IP Addresses" --> "Add IP Address". Where can I do this under Virtualmin?

Joe wrote:

Just one reason: You did it the hard way. ;-)
Obviously the "hard way" is the only way to solve this problem (at least for the GPL version -- don't know if the Pro version is different)

To my knowing the versions do not differ in that respect.

adding a second IP in a shared environment is only useful if you are going to use that 2nd IP for SSL or FTP

If you plan to just switch between IP’s for normal websites…then don’t. There is no need for it at all.

You need 1 IP and you can put hundreds of domains on this IP. Apache looks at names to serve the correct pages (name-based virtual hosting).

The first and default IP you can even use for SSL on your main domain and use the second IP for a clients SSL website.

The reason I said to add the IP through webmin is because you might have had a second interface card or wanted a different IP for a nameserver on a virtual interface (it’s how I did it)

This is a little confusing.

Virtually all host give you two IP addresses
and they are set up as name servers

e.g. ns1.mydomain.com --> 174.352.34.53
and ns2.mydomain.com --> 174.352.34.58

But when we come to the server that is serving the websites
we only get to use the first IP: 174.352.34.53

Can someone please explain what the point of setting up "ns2" is.

I am probably mixing up name-servers with web servers or something, but I would really love to understand this.

My appreciation to anyone that can shed some light on this.

David.

Hi David,

I was not talking about name server. I don’t use the name server on my web server. I was only talking about two different IP addresses for my web server to host different websites under different IP addresses.

Regarding name server (DNS) I could recommend reading this: http://en.wikipedia.org/wiki/Domain_Name_System

Karl

Thanks Karl, I read that stuff, plys aload more but I still dont get the answer to my question.

Anyway - I dont want to hijack your thread, so I sent this off to my hosting company:


hi,

The zone: greenhoster.com has these address records:

greenhoster.com 65.23.155.163
www.greenhoster.com 65.23.155.163
ftp.greenhoster.com 65.23.155.163
mail.greenhoster.com 65.23.155.163
ns1.greenhoster.com 65.23.155.163
and
ns2.greenhoster.com 65.23.155.167

In the name server record of heavyhoster.com zone
there is:

greenhoster.com --> ns1.greenhoster.com
greenhoster.com --> ns2.greenhoster.com

Noıw, I assume that these last two records are what allows other zones to use the DNS
e.g.
In the "system-guide.com" zone in the address records we have

system-guide.com 65.23.155.163
www.system-guide.com 65.23.155.163
ftp.system-guide.com 65.23.155.163
m.system-guide.com 65.23.155.163
mail.system-guide.com 65.23.155.163

And in the name server record,
we just have:

system-guide.com --> greenhoster.com

Hopefully that is correct.

Actually ALL the virtual servers point at 65.23.155.163.

I assume that that is the IP address on the server.

What is 65.23.155.167 ?
Where does that point to ?

Is "ns2.greenhoster.com" a place on my server ?
Is it a file ?

What is the benefit of ns2 ? What is it doing ?

I have read a lot about name servers but nowhere do I get answer to this question of the second reference.

Thanks for any light you can shed on this.

If anyone here knows and can give some pointers,
that would be great.

Thanks

the easiest way to explain is that having 2 nameservers is a regulation. it is mandatory.
If you register a name at some company and want to point it to a server by NS records than you will need at least 2 of them. that’s it.

Why 2 nameservers…for redundancy…if one goes down then the other will still direct the surfer to the correct website.

Of course if you only have 1 machine and it goes down then even 5 nameservers wont do any good.

Can the IP that is only being used for "ns2" also be used for something else ?

EG for SSL websites ?

Sure. That’s not an issue at all. They’re on different ports.

The next version of Virtualmin also supports UCC (multi-domain) certificates. This is a special, somewhat well-supported, type of certificate file that stores certificates for many domains that live on one IP. It has some limitations over proper certificates (and does not validate in the same way, since it always shows “issued to” for a single domain), but it’s better than no SSL certificate and better than not using SSL at all. And for some folks, multiple IPs is a challenge or an onerous expense.

Does anyone have a step by step tutorial on how to add that second IP?
I’d really like to use a separate IP with one of my sites.

Until now:… I’ve created, in virtualmin, the virtual server and specified, in the IP address and forwarding > Network interface > Virtual with IP the second IP. In the Network Configuration > Network Interfaces I can see is there (I think). See first pic.

So, the big picture is this: I have 4 domains sharing one IP and 1 domain supposed to be single, on the other IP. However, this single one is showing the last registered site from the first IP.

Joe, I don’t see much of you said in the Server Templates. See second pic, please.

Karl, you think it will work if I’ll just delete the eth0:1 (first pic) and do it your way?

A simple step-by-step tutorial would be nice, for noobs.
Thank you!

The pictures (bug in the software, :slight_smile: )

[file name=Desktop.zip size=20097]http://www.virtualmin.com/components/com_fireboard/uploaded/files/Desktop.zip[/file]