-   Linux - Networking (
-   -   dhcp is ok but can't connect to internet (

zeroboys 03-15-2004 07:23 PM

dhcp is ok but can't connect to internet
some problem with my server it wouldn't get going to internet why..??

i have 4 pcs.. one of them is server which has ftp,dhcp,name server,samba
is n't giving local computer getting internet ..

what should i check first plz let me know .. that's really big deal for me..
because whenever i ran into this sort of problem i have no idea what to do
kinda sick and tired .. but i'm still fine with a lot of reserch makes me feel cool.. there are many answers for me unually .. ofcourse.. i do..really do..

but in case i don't know what to do i wouldn't give up never...
unless nobodys tell me the reason.. why it doesn't work..

here are my files that i have been configured so far...

# dhcpd.conf
# Sample configuration file for ISC dhcpd

# option definitions common to all supported networks...
option domain-name "";
option domain-name-servers,;

ddns-update-style ad-hoc;
default-lease-time 3600;
max-lease-time 7200;
option subnet-mask;
option broadcast-address;
option routers;
option domain-name-servers;

subnet netmask {
# subnet netmask {

!!!!!!!!!!!!!!!! rc.local !!!!!!!!!!!!!!!!!!!!

# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

#mount -t smbfs -o username=student,password=password //e-bank1/classes /mnt

#route add -host dev eth1
#route add -host dev eth0

/sbin/iptables -F
echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
/sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

!!!!!! named.conf !!!!!.

## named.conf - configuration for bind
# Generated automatically by redhat-config-bind, alchemist et al.
# Any changes not supported by redhat-config-bind should be put
# in /etc/named.custom
controls {
inet allow { localhost; } keys { rndckey; };

include "/etc/named.custom";

include "/etc/rndc.key";

zone "" {
type master;
file "";

zone "localhost" {
type master;
file "";
zone "" {
type master;
file "";

̰ foward zone _Դϴ.

$TTL 86400
@ IN SOA root.localhost (
3 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl


!!!!!!!!!!! reverse zone !!!!!!!!!!!!!

$TTL 86400
@ IN SOA root.localhost (
3 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttk


Steave 03-15-2004 09:10 PM

to configure routing on the linux box (what you are trying to do) you need to tell your server that he's a router:

echo 1 > /proc/sys/net/ipv4/ip_forward

if you want to do NAT you need to configure iptables to do it for you

iptables -t nat -A POSTROUTING -o $IF_EXT -j MASQUERADE

with $IF_EXT being your external interface.

other than tat, google for the NAT HOWTO or have a look at

Have fun, steave.

zeroboys 03-15-2004 10:30 PM

i have done it exactly what you said..
it still not working..
is there something else i can check from it...

we can ping each other which is from server to client and client to server
after getting the ip from server .. i don't really know what's going on...

it seems fine but .. something else...

i can;t ping a dns from client computer which is also Redhat 9
all client are getting the ip from server through dhcp..

i will give that a shot one more time as he said..
what if it doesn;t work what should i do.. ??/

any suggestion...

thank in advance...

eantoranz 03-15-2004 10:34 PM

man..... you have to go step by step. Are the clients getting their addresses from the dhcp server?

Just saw that the clients are getting the IP addresses.

This is how it goes:

You have to be able to ping the gateway (whatever it be) from the clients. IF you are able to ping the gateway... then you have to be able to ping something outside from the local network.... if you are unable to ping anything outside from the network, it's a forwarding issue. It's that simple (in my experience).

In that case you have to check the iptables forwarding (or masquerading) and the /proc forward settings.... it's like shooting at the floor.... can't miss it.

zeroboys 03-16-2004 12:56 PM

sounds weird ...
After i have done something changing to rc.local file ..
i saw some changing from pinging to gateway which is cool..
but it still can't surf internet .. it is really weird ...
it can ping to dns and gateway but i can't see anything from Mozilla..
can you imagine ...

it keeps telling me this " could not be found. please check the name and try again...." and it didn't show anything .. from what i did...
i've never seen like this .. this is really amazing..
ping each other but don't see anything on mozilla..
give me any suggestion plz...

here is my configuration of rc.loca which has masquerade..

# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

#mount -t smbfs -o username=student,password=password //e-bank1/classes /mnt

#route add -host dev eth1
#route add -host dev eth0

/sbin/iptables -F
echo "1" > /proc/sys/net/ipv4/ip_forward
#iptables -P FORWARD DROP
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

thank in advance...

god bless you...

skel 03-16-2004 02:02 PM

the ip address of is

try pinging that. if you get any replies then you have a problem with your dns (this is what i suspect is happening)

where did you get the addresses for the nameservers that are given out by your dhcp server? ( and in dhcpd.conf)

internet addresses should be resolved via the nameserver prodided by your isp.

so if and are on your local network then requests for internet addresses need to be passed on to your isp's nameserver.

so where did you come up nameserver? is this from your isp?

zeroboys 03-16-2004 03:09 PM

i couldn't ping to
Hi all's been many time to ask many thing that hasn't been far..

All i want to do is to make a group and i want my machine as a Server which has ftp , samba, dhcp...

you were totally right
i couldn't ping to yahoo for some reason that i have no idead
i think something is wrong with dns setting of mine ..
but i can't stand for it anymore .. tired.. i'm getting out .. to outside for tomorrow..

you think that my MASQUERADE is fine .. i want to just make sure whether it seems fine or should i change something for MASQUERADE... i will give it a shot whatever you guys give me any answer .. that would be gladed for me..

in fact the name that i have made up are, ,

what do i have to do for this..


clients 4, server 1
i want clients to get the ip from server and getting internet throught my server..
so i have done everything for it..


so i think i got the name server from my isp

[root@student rc.d]# nslookup
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Address: name =

give me anything.. plz..

zeroboys 03-16-2004 09:29 PM

what should i check ..if clients don't internet
it seems indeed fine .. dhcp is fine,ftp is fine and samba also fine..
everything is fine except getting into internet through server ..
what's matter with my server ..

let me give you status of my clients
1. it receives a ip address from server through dhcp server..
2. it can ping to server , and to dns and gateway ..
3. it can even ping to other client ..
4. it can connect ftp and telnet to server ..

status of my server
1. it can surf a internet
2. pinging to dns and gateway
3. pinging to any clients that have got a ip address

what else i have check...
i wonder why.. my client cann't see anything on Mozilla which tells me "could n't find"

somebody told me that the problem is your name server..
i got it what he was tring to say but don't know how to ..fix..

if anyone needs anything it will be uploaded ..
so plz give me any advice

skel 03-17-2004 10:56 AM

go there and look at the dhcp and dns howto's you should find the info you are looking for

eantoranz 03-17-2004 03:42 PM

Just open up one root console on my desktop and I'll set things up for u. Is that ok? :)

christopherccv 04-27-2004 06:34 AM

actually i also facing the similar problem.

the wired part is i am able to ping to the ip address of the web site like google and yahoo.

i believe is the dns issue.

from the masquerade server everything is fine including resolving the name and also telnet to other router.

just from the client under it could not resolve. i already try static ip with manual configure DNS also not working.

please advice.


philipph 04-27-2004 10:09 AM

Looks like a problem with the dns server.
I solved it this was:
I run a proxying DNS Server --> just start bind
in named.conf i added in the options section

forwarders { ip -addresses of ISPs DNS ; };

and i give the ip address of my server as dns - server to the workstations.

Works fine for me

christopherccv 04-28-2004 10:22 PM


thanks for your reply.

but i after i insert the script to the named.conf. when i start the service named, under /var/log/message it show fatal error on the line as unknown option.

i am using bind 9.2.1-16 which build in under redaht 9


christopherccv 04-28-2004 10:38 PM


sorry i miss out the option section as you told me to insert under it. now i manage to get the named service working.

but the outcome still the same. under the workstation i just able to ping the ip address but not resolving it.

thanks. anyone still have any idea?

philipph 04-29-2004 02:20 AM

hmmm, maybe my named.conf will help you (only parts of it listed, cause i modified only on line

options {
directory "/var/lib/named";
dump-file "/var/log/named_dump.db";
statistics-file "/var/log/named.stats";
forwarders {;; };
forward first;
notify no;

zone "." in {
and so on

i am using bind on SuSE Linux 9.0
the forwarders ip-addresses should be those of your ISPs DNS-Servers.
Don't forget the ;

All times are GMT -5. The time now is 06:07 AM.