Click to See Complete Forum and Search --> : Networking problem, possible solution?


MLS
02-29-2004, 06:25 PM
Ok, heres what I want done:

I have 4 computers in my house, I have 5 IPs available from my ISP, I do NOT want to NAT a single IP for all 4 computers. I have cablemodem>Linux>Switch>3 other computers. I want my external interface on Linux, lets call it eth0, to grab 4 IPs via DHCP, eth0 grabs one IP, that one will only go to Linux itself, eth0:0 grabs another and 1:1 NATs to computer 1, ie 192.168.0.2, then eth0:1 grabs another and 1:1 NATs to computer 2, etc. This way I have 4 unique IPs, so I can connect to outside the lan game servers with no NAT issues (because the comps are actually different WAN ips). I should also be able to have a server running on comp 1 and comp 2 on the same port with no issues. This is my theoretical setup. Is this possible and will it work? and if so... Does anyone know how to set this up via iptables?

I assume I will have to set eth0:0, 0:1, etc to unique MAC addresses for one.. I attempted this by setting eth0:0 mac address:

ifconfig eth0:0 hw ether xx:xx:xx:xx:xx:xx (eth0's mac address with a few things changed in the last 3 hex values )

then doing:

dhcpcd eth0:0

But it wouldn't work.. Does this mean its not possible? :( I can grab two IPs if I use seperate NICs, I suppose I could plug 5 NIC's in there but I was hoping to do it with only two.

/MLS

jumpedintothefire
03-01-2004, 01:10 AM
from man dhcpcd:
-I <ClientID>
Specifies the client identifier string. dhcpcd
uses the default client identifier (MAC address of
the network interface) if it is not specified.

Instead of changing the mac address prior to using dhcpcd, feed dhcpcd the -I option with the fake mac address
ie:
dhcpcd -I 00:00:00:00:00:AB eth0:0

Might have to feed it a different hostname also with the -h option..
Not sure if this will work either... But what the heck...
dhcrelay might work but your on your own with that....
This would be a snap with 5 static ips, just use proxyarp..
I'd like to know how you make out...

MLS
03-01-2004, 02:50 AM
Hmm, I tried using dhcpcd -I (fake mac address here) eth0:0, and afterwards `ps aux` shows dhcpcd running on that interface, however ifconfig does not show that interface as up or having an IP. Tried with and without -h. :(

/MLS

jumpedintothefire
03-01-2004, 10:12 AM
I didn't say that this would work, but you got futher than I thought was possible (dhcpcd is using the alias)... Your in uncharted waters for me.
Setup syslog as per man dhcpcd and add -d to the command line. capture and post the log file, might shead some light.