How to add a 2nd IP address?

35 posts / 0 new
Last post
#1 Sun, 11/09/2008 - 01:44
Karl

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.

Sun, 11/09/2008 - 02:52
ronald
ronald's picture

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

Sun, 11/09/2008 - 06:44 (Reply to #2)
Karl

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

Sun, 11/09/2008 - 10:15 (Reply to #3)
ronald
ronald's picture

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

Sun, 11/09/2008 - 11:21 (Reply to #4)
Karl

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.

Sun, 11/09/2008 - 11:38 (Reply to #5)
Joe
Joe's picture

<div class='quote'>Don't know why it is so complicated here, there must be reasons. </div>

Just one reason: You did it the hard way. ;-)

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 &quot;Virtual IP address&quot;, 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.

--

Check out the forum guidelines!

Sun, 11/09/2008 - 12:03 (Reply to #6)
Joe
Joe's picture

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 &quot;easy&quot;. It is a tool for people who know how to administer UNIX systems. It <i>can</i> 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, <i>is</i> 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 &quot;easy and automatic&quot; way available to do anything. The moment you click &quot;Webmin&quot;, you're leaving &quot;easy&quot; and going over to &quot;comprehensive and flexible&quot;. 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 &quot;Webmin&quot; menu is always going to lead to a place where you're expected to know what you're doing. (Even if, &quot;know what you're doing&quot; means &quot;looking at the documentation, and comprehending it&quot;.) ;-)

--

Check out the forum guidelines!

Mon, 02/29/2016 - 07:30 (Reply to #7)
emind

Great explanation for a newbie like me to get a grasp of what Im getting myself into. Still a bit intimidating ... especially when you start reading the webmin documentation.

Wed, 04/13/2016 - 11:36 (Reply to #8)
emind

excellent description !

Sun, 11/09/2008 - 12:28 (Reply to #9)
Karl

<b>Joe wrote:</b>
<div class='quote'>I guess I should take this opportunity to point out a philosophical difference between Virtualmin and Webmin...</div>

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 &quot;hard way&quot;. I just followed ronald's recommendation.

<div class='quote'>in Server Templates, there is a section called &quot;Virtual IP address&quot;, which allows you to define a range of IP addresses that new virtual servers can use IPs from.</div>

This makes me confused because
a) I don't have a &quot;range of IP addresses&quot;. I only have two different addresses.
b) If I click on &quot;Ranges for automatic IP allocation&quot; the help window says: &quot;If SSL or FTP virtual hosts will be created using this template, you may specify a range of IP addresses to allocate from&quot;. 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 &quot;Starting address&quot; and &quot;Ending address&quot; and my second IP into the second row of &quot;Starting address&quot; and &quot;Ending address&quot;. Then I tried to create a Virtual Server but there on &quot;IP address and forwarding&quot; I can not select the two IP addresses, I see only my first standard IP address. Before that I deleted the under Webmin added &quot;virtual interface&quot;.

What do I wrong?

Sun, 11/09/2008 - 13:15 (Reply to #10)
Joe
Joe's picture

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

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.

--

Check out the forum guidelines!

Sun, 11/09/2008 - 12:30 (Reply to #11)
Karl

Trying to edit my post: &quot;Oops! You've hit a bug in the forum software. It'll be fixed soon.&quot;

Sun, 11/09/2008 - 22:12 (Reply to #12)
Karl

<b>Joe wrote:</b>
<div class='quote'>Then why do you want another IP address? There's no reason to use multiple addresses...</div>
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 &quot;System&quot; --&gt; &quot;IP Addresses&quot; --&gt; &quot;Add IP Address&quot;. Where can I do this under Virtualmin?

Mon, 11/10/2008 - 23:07 (Reply to #13)
Karl

<b>Joe wrote:</b>
<div class='quote'>Just one reason: You did it the hard way. ;-)</div>
Obviously the &quot;hard way&quot; is the only way to solve this problem (at least for the GPL version -- don't know if the Pro version is different)

Tue, 11/11/2008 - 07:12 (Reply to #14)
ronald
ronald's picture

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)

Wed, 11/12/2008 - 03:50 (Reply to #15)
Karl

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

Wed, 11/12/2008 - 06:02 (Reply to #16)
ronald
ronald's picture

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.

Sun, 06/07/2009 - 07:31 (Reply to #17)
Davvit

Thanks for the input.

Can the IP that is only being used for &quot;ns2&quot; also be used for something else ?

EG for SSL websites ?

Or would I need to ask for a thi&Aring;

Sun, 06/07/2009 - 07:31 (Reply to #18)
Davvit

Thanks for the input.

Can the IP that is only being used for &quot;ns2&quot; also be used for something else ?

EG for SSL websites ?

Or would I need to ask for a thi&Aring;

Sun, 06/07/2009 - 07:31 (Reply to #19)
Davvit

Thanks for the input.

Can the IP that is only being used for &quot;ns2&quot; also be used for something else ?

EG for SSL websites ?

Or would I need to ask for a thi&Aring;

Tue, 01/06/2009 - 19:05 (Reply to #20)
wattaman

The pictures (bug in the software, :) )

<a href='http://www.postimage.org/image.php?v=Pq1_b_Zr' target='_blank'><img src='http://www.postimage.org/Pq1_b_Zr.jpg' style='border:0px'></a>

<a href='http://www.postimage.org/image.php?v=gx2hISWi' target='_blank'><img src='http://www.postimage.org/gx2hISWi.jpg' style='border:0px'></a> [file name=Desktop.zip size=20097]http://www.virtualmin.com/components/com_fireboard/uploaded/files/Deskto...

Tue, 01/06/2009 - 23:09 (Reply to #21)
Karl

Hi wattaman,

for me my way did work just fine.

Now I have a second server (a newer one) with Virtualmin running. There I could add my second IP to &quot;eth1&quot; instead of a virtual interface to &quot;eth0&quot;. Obviously it depends on the server hardware. My new server is a newer and bigger one.

But don't forget to add, after you've set the address to the network, the second IP in Virtualmin --&gt; &quot;Addresses and Networking&quot; --&gt; &quot;Shared IP Addresses&quot;.

Karl

Wed, 01/07/2009 - 07:01 (Reply to #22)
Karl

Does it work now? Because if I look at http://3dex.co.uk/ I see your (not installed) site.

Maybe I did not understand your problem because of my lack of english language.

Wed, 01/07/2009 - 07:18 (Reply to #23)
wattaman

You're right. I've just browsed the address through proxy.org and it shows the right site.
Directly, I still get the other IP.
I think that, in the end, the new DNSs haven't already reached the ISPs from Greece (things works so slow here).

In other word, sorry for the fake alarm. Following your first tutorial works fine. With the second IP set up as virtual of the first one.
Thank you for this!

Wed, 01/07/2009 - 07:20 (Reply to #24)
wattaman

BTW, you might want to remove my link since, when it will be ready, will be an 18+ site - dunno if virtualmin.com wants to link to such content :)
Cheers!

Wed, 01/07/2009 - 07:43 (Reply to #25)
Karl

Fine, that it works now.

Unfortunately I can't edit my post because of an old bug in this forum software: &quot;Oops! You've hit a bug in the forum software. It'll be fixed soon.&quot;

Maybe the moderator will remove the link. I personally don't have any problems with 18+ sites ;)

Cheers from Germany to Greece!

Wed, 01/07/2009 - 09:40 (Reply to #26)
andreychek

<div class='quote'>
Unfortunately I can't edit my post because of an old bug in this forum software: &quot;Oops! You've hit a bug in the forum software. It'll be fixed soon.&quot;
</div>

Well, unfortunately, the forum software goes out of it's way to be &quot;difficult&quot;. Not even the moderators can resolve that without actually deleting the post :-)

But, it's no biggy.

This is a forum for troubleshooting issues with web servers and web sites -- we fully expect some links to them. It can make troubleshooting much easier when actually seeing the problem in real time!

So long as the post doesn't appear to be spam (which this isn't) and somehow relates to Virtualmin (which this does!), you're in the clear! :-)
-Eric

Fri, 05/01/2009 - 10:07 (Reply to #27)
duncanbbd

totally confused by the info here:

could not find out how to add the 2nd IP address in Virtualmin.

did it through Webmin - Networking - network Configuration - Host Addresses.
there I added IP address and domain name
then applied configuration.

then I went in adnd created the virtaula domain choosing this IP address.

is this OK ?

Fri, 05/01/2009 - 10:45 (Reply to #28)
andreychek

First, if it worked, than it's probably okay :-)

However, in the future, if I were going to add a second IP, I would either:

1. Go into Virtualmin -&gt; Addresses and Networking -&gt; Shared IP Addresses, and add it there if it's meant to be shared

2. Or you could go into Edit Virtual Server -&gt; IP address and interfaces, and add it as a Virtual Interface, which is private to that Virtual Server, if it's intended to be just for that one domain.

Fri, 05/01/2009 - 11:34 (Reply to #29)
duncanbbd

ok, will remember that for future.

I'm waiting for the the other IP address to be moved to see if this actually works.
this IP is for SSL and will only be used by this domain

Wed, 11/12/2008 - 00:03
Davvit

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 --&gt; 174.352.34.53
and ns2.mydomain.com --&gt; 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 &quot;ns2&quot; 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.

Wed, 11/12/2008 - 05:42
Davvit

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 --&gt; ns1.greenhoster.com
greenhoster.com --&gt; ns2.greenhoster.com

No&Auml;&plusmn;w, I assume that these last two records are what allows other zones to use the DNS
e.g.
In the &quot;system-guide.com&quot; 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 --&gt; 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 &quot;ns2.greenhoster.com&quot; 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

Wed, 11/12/2008 - 08:59
Joe
Joe's picture

<div class='quote'>Can the IP that is only being used for &quot;ns2&quot; also be used for something else ?

EG for SSL websites ?</div>

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 &quot;issued to&quot; 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.

--

Check out the forum guidelines!

Tue, 01/06/2009 - 19:02
wattaman

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.

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

<u>So, the big picture is this</u>: 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 <u>eth0:1</u> (first pic) and do it your way?

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

Wed, 01/07/2009 - 06:03
wattaman

thanks, m8! I've tried your way... no luck :(
As I've said before, I have 2 IPs. The IP I want to use the separate domain is showing the corect site (should display an error now since is not installed) ... but the domain is pointing to one site from the other IP (which now has 4 domain set up to use it and all working).

So, if the separate IPs are workimg, why the domain that hosts on the second IP points to a domain hosted on the other IP?

I've attached photos to make things more clear:

<a href='http://www.postimage.org/image.php?v=Pq210bDr' target='_blank'><img src='http://www.postimage.org/Pq210bDr.jpg' style='border:0px'></a>

<a href='http://www.postimage.org/image.php?v=aV28e6Hr' target='_blank'><img src='http://www.postimage.org/aV28e6Hr.jpg' style='border:0px'></a>

<a href='http://www.postimage.org/image.php?v=Pq210o69' target='_blank'><img src='http://www.postimage.org/Pq210o69.jpg' style='border:0px'></a>

<a href='http://www.postimage.org/image.php?v=aV28eqEA' target='_blank'><img src='http://www.postimage.org/aV28eqEA.jpg' style='border:0px'></a>

Am I missing something?
Thank you!

Topic locked