Solved

Binding IP addresses to netcard

Posted on 2004-08-02
6
600 Views
Last Modified: 2011-04-14
I have a dedicated server from ev1servers.com, they give you full root access to a server and you pay only $99/month. Great! Now, I got a few Counter Strike servers running on the server, with custom ports, which I hate. I want to use default ports. So I go ahead and get a few more static IP addresses for my server, now I need to binf these IP addresses to the netcard so I would be able to use them.

I am a linux newbie. I have absolutely no experience on dealing with linux.

I want to be certain that when I add these IP addresses, that the server will not mess up and then not work. I have a business running on it (httpd) that needs to be running 24/7. And that is why I put so many points.

Specs:
RedHat Linux 9 (I havent really messed with any files yet)
I want to add these IP addresses without interruping the connections on the httpd server (very important)

Thank you
0
Comment
Question by:e1337coderz
[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
6 Comments
 
LVL 19

Expert Comment

by:Gabriel Orozco
ID: 11691548
as Glen said some time ago:


a bit more "redhat style" :-) make a copy of the file /etc/sysconfig/network-scripts/ifcfg-eth0 to /etc/sysconfig/network-scripts/ifcfg-eth0:1, edit the file (it should be fairly obvious what'd need be set... DEVICE=eth0:1 etc etc:-). Bring the interface down with "ifdown eth0" and up again with "ifup eth0" ... and check with "ifconfig" that the alias(es) were brought up correctly too.


later you can do

apachectl graceful

and when apache is down, you can restart it with

apachectl start

and you'll not disturb any connection because apache will go down only when no connections are live.

you can also do this more handy with:
apachectl graceful ; apachectl start

---------
the more faster way to do the ip aliasing is with

ifconfig eth0:1 NEW.IP.ADDRESS netmask NETMASK up
you can add a new ip just varying the :1 to be :2 and so on until :32767 (I don't believe you have so many ip's)


hope this help
0
 

Author Comment

by:e1337coderz
ID: 11693659
"Bring the interface down with "ifdown eth0" and up again with "ifup eth0""
Umm, I am SSHing to a box, If i use that command (ifdown eth0), won't that disconnect my SSH connection? What do I do after that command has been executed? I won't be able to SSH back to my box to do "ifconfi up".

What I am interested in is the faster way: I really don't care anymore if it disconnects a few people that are downloading.
I just need to be sure that If I use that command, it won't disconnect me off ssh before being able to fix it...
0
 
LVL 3

Expert Comment

by:pYrania
ID: 11693702
yeah vlans are a really good solution for this problem.

e1337coderz: there's no way around disconnecting your ssh session, because the interface will go down anyway.
of course you do not want to use ifconfig eth0 down, because network won't come up again ;)
just restart your network startscript after altering the configuration.
but double check your settings are correct.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:de2Zotjes
ID: 11694363
Why bring down the eth0 ?

Just add the aliases:

ifconfig up eth0:<n> <ipaddress> ...

also edit the redhat-config files as stated above to ensure that after a reboot all your extra addresses remain in place
0
 
LVL 1

Expert Comment

by:fatalsaint
ID: 11696975
once you add the files... in red hat just do

service network restart

that brings everything down then back up again.

SSH will wait before disconnecting to so once the network is back up your ssh session SHOULD just resume.  If you do happen to get disconnected simply re-ssh in.. do

ifconfig -a

and make sure all your aliases are there..
0
 
LVL 19

Accepted Solution

by:
Gabriel Orozco earned 500 total points
ID: 11700819
all said :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
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…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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