• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

Binding IP addresses to netcard

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.

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
1 Solution
Gabriel OrozcoSolution ArchitectCommented:
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
e1337coderzAuthor Commented:
"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...
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.
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

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
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..
Gabriel OrozcoSolution ArchitectCommented:
all said :-)

Featured Post

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now