LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2016, 10:15 PM   #1
XYNaPSE
Member
 
Registered: Jul 2003
Posts: 40

Rep: Reputation: 15
IP addresses alias issue


Hello,

I have 6 IP addresses.

Main node 1.2.3.4
Free 1.2.3.5
New VPS 1.2.3.6
Free 1.2.3.7
Free 1.2.3.8
Free 1.2.3.9
I have created a test vps after adding the new IP's to the server. This new test vps uses IP 1.2.3.6

I try to SSH into the new test vps using that IP but for some reason I can't because the test vps login credentials do not work but the main node root login credentials work.

I found out the issue was that I using aliases for the new IP's so all IP's will just point to the main node IP.

When I added the 5 IP addresses for the server I basically just created the ifcfg-eth0-range file and restarted the network. All the IP addresses are pingable but that issue happened where they just route to the main node IP.

ONce I found out that I needed to remove the aliases i just added them to eth0

Quote:
DEVICE="eth0"
BOOTPROTO="static"
DNS1="127.0.0.1"
GATEWAY="1.2.3.3"
HWADDR="00:31:34B:C24:641:123"
IPADDR="1.2.3.4"
IPADDR0="1.2.3.5"
IPADDR1="1.2.3.6"
IPADDR2="1.2.3.7"
IPADDR3="1.2.3.8"
IPADDR4="1.2.3.9"
IPV6INIT="yes"
NETMASK="255.255.255.255"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="eecd4sdc9-3edc3-4swq8-ace0-3fa509accwecbff"
The issue still persists so I am assuming I created more IP aliases. How do I get around this issue? I'm not that familiar with aliases and from what I have searched I can only see adding and removing aliases. If I remove the aliases then there are no additional IP addresses. SO there must be a different way to add these additional IP's.

I am using CentOS 6. Thank you in advance for any responses.

Last edited by XYNaPSE; 10-29-2016 at 10:18 PM.
 
Old 10-30-2016, 02:47 AM   #2
pingu_penguin
Member
 
Registered: Aug 2004
Location: pune
Distribution: Slackware
Posts: 345

Rep: Reputation: 60
CentOS 6 IP aliasing can be configured for persistence in this way too :

for each eth0:x you create a file in /etc/sysconfig/network-scripts/ifcfg-eth0:x

DEVICE=eth0:0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=1.2.3.x
NETMASK=255.255.255.255
GATEWAY=1.2.3.3

the above example shows for eth0:0 , similarly you can create for eth0:1 eth0:2 etc

You said your credentials dont work on the test vps, if you are getting the login prompt for ssh for different ip's , it means aliasing is working .
Perhaps you could check the username password in that case.

Hope this helps.
 
Old 10-31-2016, 01:43 AM   #3
XYNaPSE
Member
 
Registered: Jul 2003
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pingu_penguin View Post
CentOS 6 IP aliasing can be configured for persistence in this way too :

for each eth0:x you create a file in /etc/sysconfig/network-scripts/ifcfg-eth0:x

DEVICE=eth0:0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=1.2.3.x
NETMASK=255.255.255.255
GATEWAY=1.2.3.3

the above example shows for eth0:0 , similarly you can create for eth0:1 eth0:2 etc

You said your credentials dont work on the test vps, if you are getting the login prompt for ssh for different ip's , it means aliasing is working .
Perhaps you could check the username password in that case.

Hope this helps.
Thank you. I found out what the issue was. I am using Virtualizor for a control panel to create the VM's. I asked the datacenter for additional IP's when I ordered the server.

I added them in CentOS 6 and they were pingable. I logged into Virtualizor and added the IP's there also and created a test VPS. The IP address the test VPS used just routed to the main node IP which was completely different. No matter what I did I would SSH into the main node instead of the VPS.

After reading your post I had thought about just redoing everything and trying again so I removed the IP's. Your suggestion I think would have done the same thing as it would have most likely been the same as the range file ifcfg-eth0-range that I created to add them before I tried what I did in my first post. So I just removed the IP's in CentOS, restarted the network then I added the IP's in the Virtualizor control panel. Created a test vps again and was able to SSH in it using the correct login credentials.

So basically if I'm using Virtualizor I don't have to add additional IP's in CentOS. I can just add the new IP's in Virtualizor.
 
Old 10-31-2016, 03:49 AM   #4
pingu_penguin
Member
 
Registered: Aug 2004
Location: pune
Distribution: Slackware
Posts: 345

Rep: Reputation: 60
Cool , glad you found the solution
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Ubuntu (server) can't handle multiple (alias) IP addresses (well) Skaperen Ubuntu 3 02-01-2010 08:32 AM
alias issue DoME69 Programming 8 01-22-2009 01:01 PM
Apache Alias issue Atif_Khan Linux - Server 1 02-01-2007 01:31 PM
bashrc alias issue noir911 Linux - General 1 08-22-2006 06:24 AM
IP Alias issue Droo Linux - Networking 2 05-25-2006 06:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:14 PM.

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