Solved

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

Posted on 2012-04-12
3
497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

624 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