LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-04-2013, 12:03 AM   #1
ashl3y_
LQ Newbie
 
Registered: May 2013
Posts: 5

Rep: Reputation: Disabled
How to configure the additional IPs on a dedicated server?


I'm running debian and am looking for help on how to do this. (I don't have any cpanel installed or anything like that..)

http://www.nish.com/2007/12/how-to-s...ips-on-debian/

I found this article but I still haven't much of an idea on what to do..
Quote:
auto lo
iface lo inet loopback


auto eth0
iface eth0 inet static
address 6*.*.*.27
netmask 255.255.255.0
gateway 6*.*.*.1
Would I just add
Quote:
address 6*.*.*.25
to the bottom of that?

Last edited by ashl3y_; 05-04-2013 at 12:06 AM.
 
Old 05-04-2013, 02:25 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You need to create an entry for every individual network interface. It doesn't matter if it is real or virtual:
Code:
# The loopback network interface
auto lo
  iface lo inet loopback

# The primary network interface (eth0)
auto eth0
  iface eth0 inet static
  address 6*.*.*.27
  netmask 255.255.255.0
  gateway 6*.*.*.1

# The secondary network interface (eth0:1)
auto eth0:1
  iface eth0:1 inet static
  address 6*.*.*.25
  netmask 255.255.255.0
Don't forget to (re)start networking after making changes.
 
1 members found this post helpful.
Old 05-04-2013, 03:22 AM   #3
ashl3y_
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
You need to create an entry for every individual network interface. It doesn't matter if it is real or virtual:
Code:
# The loopback network interface
auto lo
  iface lo inet loopback

# The primary network interface (eth0)
auto eth0
  iface eth0 inet static
  address 6*.*.*.27
  netmask 255.255.255.0
  gateway 6*.*.*.1

# The secondary network interface (eth0:1)
auto eth0:1
  iface eth0:1 inet static
  address 6*.*.*.25
  netmask 255.255.255.0
Don't forget to (re)start networking after making changes.
Sorry if I may sound foolish, but, what I'm doing is defining the network devices correct? So if I setup apache to listen to lets say the IP address 1.1.1.1 and I added
Quote:
auto eth0:1
iface eth0:1 inet static
address 1.1.1.1
netmask 255.255.255.0
It would start accepting connections? I don't have to add a gateway do I even if some IP addresses are completely different?
Thanks for the help!

Edit: seems like Apache is not configured correctly.. I can ssh into that IP address now! (Which is progress)
Here is what it is telling me.. Any ideas??
Quote:
Restarting web server: apache2(98)Address already in use: make_sock: could not bind to address 1.1.1.1
no listening sockets available, shutting down

Last edited by ashl3y_; 05-04-2013 at 04:01 AM.
 
Old 05-04-2013, 04:01 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by ashl3y_ View Post
but, what I'm doing is defining the network devices correct?
Correct.

Quote:
So if I setup apache to listen to lets say the IP address 1.1.1.1 and I added
Code:
auto eth0:1
 iface eth0:1 inet static
 address 1.1.1.1
 netmask 255.255.255.0
It would start accepting connections?
That is basically correct. You first set up the network devices/interfaces and then you point your service to it if needed (which is apache in your case, but can be any service).

Out of the box apache will listen on port 80 on all available interfaces. This is true for many services (but the port that the service listens on is different).

As root user try the following command:
Code:
netstat -planA inet
The above command shows ip's, ports and service (local and remote) used by your box.

Quote:
I don't have to add a gateway do I even if some IP addresses are completely different?
That depends on who needs to contact this IP and from where. If this is local testing using a private network range then you probably do not need one.

This might explain it better: Default gateway

Quote:
Edit: seems like Apache is not configured correctly.. I can ssh into that IP address now! (Which is progress)
If you can ssh using the newly created IP address then the network part seems to be ok.

Quote:
Restarting web server: apache2(98)Address already in use: make_sock: could not bind to address 1.1.1.1
1.1.1.1 isn't a private IP range.

I do wonder why you are trying to set it up this way.
 
1 members found this post helpful.
Old 05-04-2013, 05:52 AM   #5
ashl3y_
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Correct.

That is basically correct. You first set up the network devices/interfaces and then you point your service to it if needed (which is apache in your case, but can be any service).

Out of the box apache will listen on port 80 on all available interfaces. This is true for many services (but the port that the service listens on is different).

As root user try the following command:
Code:
netstat -planA inet
The above command shows ip's, ports and service (local and remote) used by your box.

That depends on who needs to contact this IP and from where. If this is local testing using a private network range then you probably do not need one.

This might explain it better: Default gateway

If you can ssh using the newly created IP address then the network part seems to be ok.

1.1.1.1 isn't a private IP range.

I do wonder why you are trying to set it up this way.
I just substituted 1.1.1.1 with an actual IP address. It's really along the lines of 87.*.*.238, but I'd rather not post that here. Thank you for your help also.

Still having issues with Apache. Any clue why this is happening?

Edit: Nevermind, the issue was that I had the "Listening" on that IP address twice in my ports.conf.

Thank you so much for your help!

Last edited by ashl3y_; 05-04-2013 at 05:55 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is it possible to send mail via different dedicated IPs from same box? sitewiz Linux - Networking 6 06-10-2010 03:22 AM
cURL: Server has many IPs, how would I make a cURL script use those IPs to send data? guest Programming 0 04-11-2009 11:42 AM
Assign different folders/users to different IPs on the same dedicated server yuye811 Linux - Server 2 12-17-2007 12:13 PM
Gentoo after adding additional IPS SSH broke! renegadeavenger Linux - Distributions 5 02-05-2007 05:37 PM
Newbie ?: Can't configure additional ethernet cards Leftlane Red Hat 2 02-03-2005 06:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration