April 29, 2024, 05:50:51 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Dhcp with NAT  (Read 3664 times)

Offline klakshman03

  • Tux Awared
  • **
  • Posts: 35
Dhcp with NAT
« on: October 22, 2006, 09:56:56 AM »
Hi..grp
I want to run DHCP server in my NAT server [redhat 9]..
i have assigened public ip to eth0...and 192.168.1.0 network assigned to eth1....

#my dhcpd.conf file look like this

ddns-update-style ad-hoc;
ddns-update-style interim;

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.201 192.168.1.220;
  default-lease-time 86400;
  max-lease-time 86400;
  option routers 192.168.1.1;
  option ip-forwarding off;
  option broadcast-address 192.168.1.255;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 202.144.10.50;
}

#NAT file is


iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -A INPUT -p tcp -i eth0 --dport 67 -j ACCEPT
/sbin/iptables -A INPUT -p tcp -i eth0 --dport 68 -j ACCEPT
/sbin/iptables -A INPUT -p udp -i eth0 --dport 67 -j ACCEPT
/sbin/iptables -A INPUT -p udp -i eth0 --dport 68 -j ACCEPT

but if iam starting dhcp service it gives error like

[root@localhost rc.d]# service dhcpd start
Starting dhcpd: Internet Software Consortium DHCP Server V3.0pl1
Copyright 1995-2001 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
Wrote 0 leases to leases file.

No subnet declaration for eth0 (public ip).
** Ignoring requests on eth0.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface eth0 is attached. **


Not configured to listen on any interfaces!

If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.

If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.

Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.

exiting.
                                                           [FAILED]

"



pls help.me

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Dhcp with NAT
« Reply #1 on: October 23, 2006, 08:41:44 AM »
Wht is the IP of eth1 and its subnet mask ?

And what is the IP of eth0 and its subnet  mask ?

Offline klakshman03

  • Tux Awared
  • **
  • Posts: 35
Dhcp with NAT
« Reply #2 on: October 23, 2006, 10:56:26 AM »
eth0 : 210.214.x.x/26
eth1 : 192.168.1.1  netmask 255.255.255.0


where i should mention these details in my dcp configuration file.......



tq Ricky

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Dhcp with NAT
« Reply #3 on: October 24, 2006, 07:50:01 AM »
may be you first try to do checklist against this tutorial ---> dhcpd quick how to