Results 1 to 10 of 10
-
01-28-2014, 04:13 PM #1Web Hosting Master
- Join Date
- May 2009
- Location
- Greece
- Posts
- 1,047
How can i add a second ip on my Centos server?
Hello
I am very confused about second ip routed on a dedicated server a on the last 2-3 datacenters that i got a dedicated server i just ask for a second ip routed on my server and they just add it without accessing my server and i was able to ping it and use it as ns2.
I got one server a few days ago from online.net and i got 1 ip and i ask for a second ip routed on my server and they told me to get one failover ip and add it on my server from the client panel.
I did it but i was not able to ping or use that ip so i contact them and they told me to create a file:
Code:/etc/sysconfig/network-scripts/ifcfg-eth0:0
Then when i try to run ifup eth0:0 or service network restart i got this:
Code:eth0:0 is not present, initialization will be delayed
Any ideas how can i fix this so i can ping that ip?
if i run ifconfig i can see the em1 only interface that is working using main sever ip and lo ...
Thank you
-
01-28-2014, 04:36 PM #2Newbie
- Join Date
- Jan 2014
- Posts
- 13
Try ifcfg-em1:0
Dale
-
01-28-2014, 04:46 PM #3Web Hosting Master
- Join Date
- May 2009
- Location
- Greece
- Posts
- 1,047
ifcfg-em1:0 file does not exist...
On that folder i have :
ifcfg-em1
ifcfg-em2
Maybe to edit the ifcfg-em2 and try to load this or better to create a new ifcfg-em3 file?Last edited by hostyourdream; 01-28-2014 at 04:51 PM.
-
01-28-2014, 04:58 PM #4Newbie
- Join Date
- Jan 2014
- Posts
- 13
you need to create the file (ifcfg-em1:0) and add this:
IPADDR="your new ip here"
NETMASK="your subnet mask here"
NETWORK="your network ip here"
BROADCAST="broadcast ip"
BOOTPROTO="static"
DEVICE="em1:0"
TYPE="Ethernet"
ONBOOT="yes"
ifup em1:0
-
01-28-2014, 05:03 PM #5Web Hosting Master
- Join Date
- May 2009
- Location
- Greece
- Posts
- 1,047
I edit the ifcfg-em2 and now is working
But this was for a private ip that i was not need anyway .....
But i am wondering if it is possible to add a third ip now as the em1 and em2 was there and when i add any new is not working.... ?
-
01-28-2014, 05:13 PM #6Newbie
- Join Date
- Jan 2014
- Posts
- 13
Yep... use a sub interface as i suggested above. You can have multiple ip's on the same nic. As long as em1 or em2 are on the correct network, you should be good.
-
01-28-2014, 06:21 PM #7Web Hosting Master
- Join Date
- Sep 2008
- Location
- Seattle, WA
- Posts
- 1,323
█ Brian Kearney, Stealthy Hosting/Server Stadium Seattle, WA [AS23033] Skype: StealthyHosting
█ Custom Dedicated Servers
█ Low Cost Instant Dedicated Servers
█ Email: Sales@StealthyHosting.com
-
01-29-2014, 02:42 PM #8Web Hosting Master
- Join Date
- May 2009
- Location
- Greece
- Posts
- 1,047
Great info !
Is it better to use range ip's option in one file or to use ifcfg-em1:0 and ifcfg-em1:1 and ifcfg-em1:2 ?
Thanks all of you
-
01-29-2014, 03:00 PM #9Web Hosting Master
- Join Date
- Oct 2002
- Location
- Vancouver, B.C.
- Posts
- 2,699
It's better to use the range file if the IP addresses are contiguous, so you don't have to do as much configuration. You can also have multiple range files if need be.
By the way, if the IP's are routed to you, it doesn't matter what interface the IP's are bound to, they will still work. It's better to stick to em1 which is the interface you receive the packets on though, to keep the configuration clean.
You may also want to use a subnet mask of 255.255.255.255, to ensure that outbound traffic uses your primary IP address. It varies from kernel/distro, but sometimes the most recently configured IP address ends up being used by default on outbound traffic.ASTUTE INTERNET: Advanced, customized, and scalable solutions with AS54527 Premium Performance and Canadian Optimized Network (Level3, Shaw, CogecoPeer1, GTT/Tinet),
AS63213 Cost Effective High Performance Network (Cogent, HE, GTT/Tinet)
Dedicated Hosting, Colo, Bandwidth, and Fiber out of Vancouver, Seattle, LA, Toronto, NYC, and Miami
-
01-29-2014, 03:38 PM #10Web Hosting Master
- Join Date
- May 2009
- Location
- Greece
- Posts
- 1,047
ok which of these are not needed if i want to use the em1:0 as a ns2.mydomain.com ip entry?
DEVICE="em1"
BOOTPROTO="static"
DNS1=127.0.0.1
GATEWAY="servergateway"
HOSTNAME="noname"
HWADDR="D4:WE:5Z0:6C:7Z"
IPADDR="secondserverip"
IPV6INIT="yes"
MTU="1500"
NETMASK="255.255.255.0"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
Thank you
Similar Threads
-
How to add and remove users on CentOS 6.
By rogriverac in forum VPS TutorialsReplies: 4Last Post: 06-09-2013, 02:03 PM -
Howto add IP permanently to your dedicated CentOS server?
By pj1s in forum Hosting Security and TechnologyReplies: 6Last Post: 04-03-2012, 07:08 PM -
Is there any way to add mppe to centos? please help!
By kagetu_toki in forum VPS HostingReplies: 1Last Post: 06-17-2010, 08:36 AM -
add 2 range ip in linux centos
By robocap in forum Hosting Security and TechnologyReplies: 5Last Post: 07-06-2008, 05:31 PM -
How to add an IP adress to CentOS server?
By Rafal_A in forum Hosting Security and TechnologyReplies: 1Last Post: 05-08-2007, 04:10 PM