Solved

Binding IP addresses to netcard

Posted on 2004-08-02
6
595 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
6 Comments
 
LVL 19

Expert Comment

by:Redimido
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
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.

 
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:
Redimido earned 500 total points
ID: 11700819
all said :-)
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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