Solved

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

Posted on 2012-04-12
3
491 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

10 Experts available now in Live!

Get 1:1 Help Now