Solved

2 static IP's in a Centos server - change main IP

Posted on 2012-04-12
3
493 Views
Last Modified: 2012-04-13
Hi:
I installed Centos 6 on my server by doing a Minimal installation. During the installation, when it’s time to setup the hostname, I clicked the Configure Network button, and then went to Network Manager, setup IP info and tell it to activate on boot by putting a checkmark in “Connect Automatically”. I have 2 Static external IP’s, so I configured my main IP in eth2 and my second IP in eth3. After Centos installation, I updated the server and installed cPanel.

For the internet, the server is using the second IP. The first IP is not working and is the one attached to my cpanel license. I which to have both IP’s in this server, to configure the second IP as my DNS server IP.

I am unable to access my server through ssh by using my first IP, only with the second one.
I used this command to activate the NIC eth2, that for some reason it is not doing it by itself on boot.
ifup eth2
After this I am able to connect to my server using the IP I want, (ssh, cPanel WHM) but if I reboot the server, I have to write the command again in order to be able to connect through the first IP.
I changed the server's IP address in hosts file from the second IP to the first one, but had no luck.  The host file is located at /etc/hosts.

these are my eth2 and eth3 configurations:


DEVICE="eth2"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPADDR=173.xxx.xx.xx
PREFIX=30
GATEWAY=173.xxx.xx.xx
DNS1=207.xx.xxx.2
DNS2=207.xx.xxx.3
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth2"
UUID=3a73717e-65ab-93e8-b518-24f5af32dc0d
HWADDR=00:04:23:CE:A5:62




DEVICE="eth3"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPADDR=173.xxx.xx.xx
PREFIX=30
GATEWAY=173.xxx.xx.xx
DNS1=207.xx.xxx.2
DNS2=207.xx.xxx.3
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth3"
UUID=c5ca8081-6db2-4602-4b46-d771f4330a6d
HWADDR=00:04:23:CE:A5:63
0
Comment
Question by:pcelements
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Sandy earned 500 total points
ID: 37841458
There is no need to reboot the machine just change the main ip under WHM Basic setting and it will work.

If you want to change the IP from backend then you also can modify the config files from backend and then simply restart the network service.

I will come up :-)
0
 

Author Comment

by:pcelements
ID: 37844949
I changed de main ip under WHM Basic and now it is shown correctly in WHM, but how can I do this
If you want to change the IP from backend then you also can modify the config files from backend and then simply restart the network service.
, so that my server gives priority to the IP that I want it to?
0
 

Author Closing Comment

by:pcelements
ID: 37845240
I was able to change the main IP in WHM as explained by Sandeep_Agarwal.
I was able to solve my last issue by going to /etc/sysconfig/network-scripts/ifcfg-eth3 and change the ONBOOT=yes to ONBOOT=no
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Squid Connection Pools 3 67
Redundant SQL Servers Without Clustering 7 105
Problem to get function 52 106
spamming  on Hosted svrs? 6 87
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now