dhcp server with two subnets
Hi, I'm trying to build a linux(fedora 12) dhcpd server(and gateway), that have 3 network cards(eth0 have with public ip, eth1 192.168.2.1 class and eth3 with 192.168.3.1 class).
Because I have just a switch, I want to put both cables(from eth1, eth2) in the switch. Every client has 2 network card(eth0, eth1). My question is, is there any way to conf eth0 to take from server ip from 192.168.2.1 class, and eth1 from 192.168.3.1? The internet will work only on eth0. my dhcpd.conf for now looks like this: subnet 192.168.2.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option routers 192.168.2.1; range 192.168.2.101 192.168.2.254; } subnet 192.168.3.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option routers 192.168.3.1; range 192.168.3.101 192.168.3.254; } thx |
Ok if I am understanding your setup then your asking a lot more than simple DHCP.
The DHCP options you have look good however if you want each client to have an IP on one of each of your internal networks (192.168.2.0 and 192.168.3.0) I believe you would either need separate switches or you will need to setup vLANs on the local switch so that you split the local LANs. As far as your machines on the internal network talking to the internet you will need a few more things enabled before they can talk to the internet. On the gateway machine you will need to enable IP routing, this can be done by the following command Quote:
Quote:
Quote:
I am assuming your eth0 has a single IP from your ISP that allows it to talk to the Internet. To allow other machines on the local network to talk through to the net you will need to enable Network Address Translation (NAT) on the gateway machine so it masquerades the IP addresses of the machines on your local network. A script similar to this will turn on the masquerade options in linux to allow the machines to talk through the gateway to the Internet. I should point out however that this script does not implement any firewall security for the local host and that if your planning on building a gateway you may first want to investigate some of the linux distributions that have the features you need but with firewall and other security measures included. Quote:
|
All times are GMT -5. The time now is 06:37 AM. |