dhcp server - client cannot connect to the internet
Hi,
I have seen similar posts, but I was not able to find a solution for my problem. Can you please help me?
I am trying to setup a dhcp server (first time in my life). I have a Fedora 12 machine with two NIC, first one for Internet connection:
DEVICE=eth0
HWADDR=XX:XX:XX:XX:XX:XX
ONBOOT=yes
IPADDR=147.213.192.XX
BOOTPROTO=none
NETMASK=255.255.255.0
DNS2=193.87.10.7
TYPE=Ethernet
GATEWAY=147.213.192.1
DNS1=147.213.192.3
NM_CONTROLLED=no
IPV6INIT=no
USERCTL=no
FORWARD_IPV4=true
second one:
DEVICE=eth1
PEERDNS=yes
HWADDR=XX:XX:XX:XX:XX:XX
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
NM_CONTROLLED=no
IPADDR=192.168.0.1
NETMASK=255.255.0.0
BROADCAST=192.168.0.255
NETWORK=192.168.0.0
FORWARD_IPV4=true
the configuration file for dhcpd, /etc/dhcp/dhcpd.conf:
ddns-update-style ad-hoc;
default-lease-time 600;
max-lease-time 86400;
authoritative;
subnet 192.168.0.0 netmask 255.255.0.0 {
range 192.168.0.10 192.168.0.30;
option routers 192.168.0.1;
option ip-forwarding on;
option domain-name-servers 147.213.192.3, 193.87.10.7;
}
host margerine {
hardware ethernet 00:21:85:33:8F:78;
fixed-address 192.168.0.13;
option host-name "margerine.saske.sk";
}
iptables:
/etc/rc.local:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
in /etc/sysctl.conf:
net.ipv4.ip_forward = 1
I have also added margerine in hosts. And the result?
I am able to ping from client margerine to both the 192.168.0.1 and XX:XX:XX:XX:XX:XX, but I am not able to connect the Internet or even 147.213.192.3.
(Connection to internet from server works fine, and also the connection from server to client.)
As If the forwarding was still denied.
route:
147.213.192.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
192.168.0.0 * 255.255.0.0 U 0 0 0 eth1
default 147.213.192.1 0.0.0.0 UG 0 0 0 eth0
Any idea?