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

How to bind multiple IPs to my network card?

I have a firewall system with a public IP.  I have a bunch of ip address which I want to point to the MAC address on my firewall ethernet card so I can determine which ip was requested and forward the request to the appropraite resource in my private network.

Any ideas?
1 Solution
Gabriel OrozcoSolution ArchitectCommented:
very easy:

ifconfig eth0:0 netmask up
( should be changed with the real ip, put the correct netmask please, and add from eth0:0 up to eth0:256 or more ;)

so, if you ip addresses are and, all with netmask, then
if your external interfase is eth1, in /etc/rc.d/rc.local
please add at the top:

ifconfig eth1:0 netmask up
ifconfig eth1:1 netmask up

so you will have your normal ip address in eth1, plus another two ip addresses bounded to the same interfase.

after that, you need to setup iptables to redirect:
a) port by port (more secure, more work)
iptables -I PREROUTING -t nat -i eth1 -p tcp -d --dport 25 -j DNAT --to-destination

b) all the ports:
iptables -I PREROUTING -t nat -i eth1 -p tcp -d -j DNAT --to

hope this helps :)
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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