• 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?
0
NeilPeel
Asked:
NeilPeel
1 Solution
 
Gabriel OrozcoSolution ArchitectCommented:
very easy:

ifconfig eth0:0 200.200.200.200 netmask 255.255.255.240 up
(200.200.200.200 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 123.123.123.123 and 234.234.234.234, all with netmask 255.255.255.250, then
if your external interfase is eth1, in /etc/rc.d/rc.local
please add at the top:

ifconfig eth1:0 123.123.123.123 netmask 255.255.255.250 up
ifconfig eth1:1 234.234.234.234 netmask 255.255.255.250 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 123.123.123.123 --dport 25 -j DNAT --to-destination 192.168.0.132:25

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


hope this helps :)
0
 
CleanupPingCommented:
NeilPeel:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

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