Multiple IPs
I am running a Red Hat box as a router using iptables and we recently added 2 IP address for a total of 3. Is there anything I need to do for Linux to recognize these IPs other than porting them through iptables? Is there a way to assign more than a single IP to a network adapter. I assume you must.
-pat |
Re: Multiple IPs
Quote:
http://www.google.com/linux?hl=en&lr...=Google+Search [EDIT] this post is bogus, MY BAD... |
Are you sure?
Inetd is for running services like ftp servers that listen on a port. Instead of having the server software loaded all the time using up memeory inetd starts it up only when it is needed. I think you have to set up mulitiple ip in the lower level network stuff before messing with inetd. |
example
ifconfig eth0:0 192.168.100.1 |
The last post is absolutely correct.
ifconfig eth0:0 xxx.xxx.xxx.xxx is the format for a second IP which will resolve to the same NIC. ifconfig eth0:1 etc etc These are not retained through a boot up though. To make them persistant, you need to create a file with the setup. On Red Hat, cd to /etc/sysconfig/network-scripts. There you will see the configuration file for your network card. It is named ifcfg-eth0 You will need to make a new file named ifcfg-eth0:0 for the second "Virtual IP" address. Once you have a ifcfg-eth0:x file for any extra IP Addresses that will be bound to that card, you simply restart the network. This will be good thru boots. |
my bad... sorry guys... i must have been trippin'... please ignore my first post, patpawlowski...
http://www.troubleshooters.com/linux/ipalias.htm i'd like to add that iptables doesn't work with virtual interfaces, so instead of using (for example) "eth0:2", in your iptables script, use the ip you assigned to the virtual interface... |
I have an iptables script that runs at startup. I was considering adding the appropriate commands there. The reason being that I frequently make changes to the script and this would allow me easy access to the IP configuration also. Does anyone see any problem with that?
|
Sounds good to me, I'd consider having your script called from the /etc/rc.d/rc.local file.
|
All times are GMT -5. The time now is 02:00 PM. |