i am configuring a DHCP server using ubuntu 11.10 with 2 lan cards.eth0 is connected to wan on ip address:192.168.2.2/24 and eth1 connected to lan is configured with ip:192.168.10.1/24 gateway:192.168.10.1.
i have configured my /etc/dhcp/dhcp.conf as
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option routers 192.168.10.254;
option domain-name-servers 192.168.10.1, 192.168.10.2;
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.10 192.168.10.100;
}
/etc/default/isc-dhcp-server
INTERFACES="eth1"
/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 192.168.10.1
netmask 255.255.255.0
gateway 192.168.10.1
broadcast 192.168.10.255
/etc/sysctl.conf
net.ipv4.ip_forward=1
after these things i did as
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m conntrack --ctstate NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
iptables-save | sudo tee /etc/iptables.sav
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
/etc/resolv.conf is getting name server by default all the time.
i am able to use browse internet on this server but not from client side.my dhcp server is running properly from client machine i am able to ping eth1 as well as eth0 but not able to connect to internet is there any thing i am missing here. Please someone help me...
dhcp
is/etc/default/dhcp-server
. Second, network configuration file is/etc/network/interfaces
. Third, gateway specification keyword isgateway
. – mbaitoff Mar 14 '12 at 12:25sudo watch -n 1 -d iptables -nvL
then try to reach the internet from your client machine while watching the counters. Do they showFORWARD
rule increasing? – mbaitoff Mar 14 '12 at 12:46option routers 192.168.10.254;
should probably beoption routers 192.168.10.1;
– Wilhelm Erasmus May 10 '15 at 19:21