LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2004, 07:23 PM   #1
zeroboys
LQ Newbie
 
Registered: Feb 2004
Distribution: redhat9
Posts: 11

Rep: Reputation: 0
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 "student.zeroboys.com";
option domain-name-servers ns1.zeroboys.com, ns2.zeroboys.com;

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

subnet 192.168.4.0 netmask 255.255.255.0 {
range 192.168.4.3 192.168.4.10;
}
# subnet 61.40.233.0 netmask 255.255.255.0 {
#}



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

#/bin/sh
#
# 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 255.255.255.255 dev eth1
#route add -host 255.255.255.255 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 127.0.0.1 allow { localhost; } keys { rndckey; };
};

include "/etc/named.custom";

include "/etc/rndc.key";



zone "4.168.192.in-addr.arpa" {
type master;
file "4.168.192.in-addr.arpa.zone";
};


zone "localhost" {
type master;
file "localhost.zone";
};
zone "forward.student.com" {
type master;
file "forward.student.com.zone";
};




ÀÌ°Ç foward zone È_ÀÏÀÔ´Ï´Ù.

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


IN NS 192.168.3.1.



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

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


@ IN NS 192.168.3.1.
 
Old 03-15-2004, 09:10 PM   #2
Steave
Member
 
Registered: Jul 2001
Location: Braunschweig, Germany
Distribution: Suse 7.2
Posts: 184

Rep: Reputation: 30
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 www.netfilter.org.

Have fun, steave.
 
Old 03-15-2004, 10:30 PM   #3
zeroboys
LQ Newbie
 
Registered: Feb 2004
Distribution: redhat9
Posts: 11

Original Poster
Rep: Reputation: 0
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...
 
Old 03-15-2004, 10:34 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

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

PS
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.

Last edited by eantoranz; 03-15-2004 at 11:01 PM.
 
Old 03-16-2004, 12:56 PM   #5
zeroboys
LQ Newbie
 
Registered: Feb 2004
Distribution: redhat9
Posts: 11

Original Poster
Rep: Reputation: 0
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 " www.yahoo.com 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..



#/bin/sh
#
# 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 255.255.255.255 dev eth1
#route add -host 255.255.255.255 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...
 
Old 03-16-2004, 02:02 PM   #6
skel
Member
 
Registered: Jan 2004
Distribution: Slackware 10 ; Gentoo ; OpenBSD 3.6
Posts: 101

Rep: Reputation: 15
the ip address of www.yahoo.com is 216.109.118.73.

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? (ns1.zeroboys.com and ns2.zeroboys.com in dhcpd.conf)

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

so if ns1.zeroboys.com and ns2.zeroboys.com 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 ns.student.com nameserver? is this from your isp?
 
Old 03-16-2004, 03:09 PM   #7
zeroboys
LQ Newbie
 
Registered: Feb 2004
Distribution: redhat9
Posts: 11

Original Poster
Rep: Reputation: 0
i couldn't ping to www.yahoo.com

Hi all again..it's been many time to ask many thing that hasn't been solved..so 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 ns.zeroboys.com, ns1.zeroboys.com ,ns.student.com

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..

#############################3


so i think i got the name server from my isp

[root@student rc.d]# nslookup 207.181.101.5
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.
Server: 207.181.101.5
Address: 207.181.101.5#53

5.101.181.207.in-addr.arpa name = tor-ns2.allstream.com.


give me anything.. plz..

Last edited by zeroboys; 03-16-2004 at 09:21 PM.
 
Old 03-16-2004, 09:29 PM   #8
zeroboys
LQ Newbie
 
Registered: Feb 2004
Distribution: redhat9
Posts: 11

Original Poster
Rep: Reputation: 0
what should i check ..if clients don't connect..to 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

Last edited by zeroboys; 03-16-2004 at 10:08 PM.
 
Old 03-17-2004, 10:56 AM   #9
skel
Member
 
Registered: Jan 2004
Distribution: Slackware 10 ; Gentoo ; OpenBSD 3.6
Posts: 101

Rep: Reputation: 15
http://www.tldp.org/HOWTO/HOWTO-INDEX/networking.html

go there and look at the dhcp and dns howto's you should find the info you are looking for
 
Old 03-17-2004, 03:42 PM   #10
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Just open up one root console on my desktop and I'll set things up for u. Is that ok?
 
Old 04-27-2004, 06:34 AM   #11
christopherccv
Member
 
Registered: Jul 2003
Location: malaysia
Distribution: redhat
Posts: 31

Rep: Reputation: 15
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.

thanks
 
Old 04-27-2004, 10:09 AM   #12
philipph
LQ Newbie
 
Registered: Feb 2004
Location: Graz
Distribution: SuSE 9.0
Posts: 10

Rep: Reputation: 0
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
Philipp
 
Old 04-28-2004, 10:22 PM   #13
christopherccv
Member
 
Registered: Jul 2003
Location: malaysia
Distribution: redhat
Posts: 31

Rep: Reputation: 15
philipph,

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

thanks
 
Old 04-28-2004, 10:38 PM   #14
christopherccv
Member
 
Registered: Jul 2003
Location: malaysia
Distribution: redhat
Posts: 31

Rep: Reputation: 15
philipph,

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?
 
Old 04-29-2004, 02:20 AM   #15
philipph
LQ Newbie
 
Registered: Feb 2004
Location: Graz
Distribution: SuSE 9.0
Posts: 10

Rep: Reputation: 0
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 { 195.58.160.2; 195.58.161.3; };
forward first;
notify no;
};

zone "." in {
.....
and so on
_________________________

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux can't connect to internet with DHCP through Linksys wired router ruslan40321 Linux - Networking 9 03-30-2008 02:08 PM
connect to internet w/ dhcp but don't know route info towsonu2003 Linux - Wireless Networking 5 10-13-2005 07:51 PM
connect to internet without dhcp client snip128 Linux - Networking 2 07-06-2005 04:29 AM
DHCP and client cant connect to internet RahJiggah Linux - Networking 17 12-28-2004 12:13 AM
Can't connect to the Internet with DHCP 1kyle Linux - Networking 3 11-17-2004 03:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration