LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-11-2003, 01:22 PM   #1
wendallsan
Member
 
Registered: Jun 2003
Posts: 36

Rep: Reputation: 15
unable to get out of my subnet w/o dhcp


hi all,

I'm trying to give my linux box a static IP addy on my subnetwork so I can use it as a web server. I'm running my subnet through a little Linksys router and have IP forwarding turned on for ports 80, 53, and 21 (http, dns, and ftp). I'd like to be able to set my router up to have a static IP for my linux box and have DHCP running for everyone else. I have my linux box statically assigned to 192.168.1.2. On my linksys router admin page, I have turned DHCP on and set it to start assigning DHCP ip numbers starting at .10, so I presume it won't assign addresses to ip numbers .2-.9. Maybe I'm wrong with this assumption and DHCP doesn't work that way.

The other weird thing is if I completely turn off DHCP on my router and manually assign an IP address to my linux system, I still can't get out to the Internet at large, I'm stuck in my own subnetwork. DHCP seems to be the only way to get out on my box right now.

Any advice, what am I doing horribly wrong?

thanks,

wendallsan
 
Old 10-11-2003, 01:40 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It sounds like you haven't specified your default route to be the address of the router. Try setting a default route.
 
Old 10-11-2003, 03:07 PM   #3
wendallsan
Member
 
Registered: Jun 2003
Posts: 36

Original Poster
Rep: Reputation: 15
alright, how do I do that? I have my gateway set in my rc.inet1 config file, but I don't think that's what you're referring to. How do I set this, is it within linux somewhere or on the router itself?

thanks again,

wendallsan
 
Old 10-11-2003, 03:14 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
That is what I mean. If you look at:
route -n

You should have an entry beginning "0.0.0.0" this is your default route. It sounds like - either you don't have one or it is not pointing at your router.

If you have a default route then remove it:
route del default

Then add a new one:
route add default gw IP.OF.ROUTER.HERE

Obviously change IP.OF.ROUTER.HERE for hte IP of your router.
 
Old 10-11-2003, 07:11 PM   #5
wendallsan
Member
 
Registered: Jun 2003
Posts: 36

Original Poster
Rep: Reputation: 15
alright, thanks for the help . . .

running route -n results in the following entries matching 0.0.0.0:

0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 1 0 0 eth0

I tried removing both and then adding the new default like you instructed, but I ended up still not being able to get out of my local network to the Internet. Do I need to turn off DHCP on my router to be able to use static IP addresses with it, or should I be able to do both at the same time? Any other ideas would be great.
 
Old 10-12-2003, 01:31 AM   #6
sidmark-2850
Member
 
Registered: Aug 2003
Posts: 133

Rep: Reputation: 15
Like david_ross said, you will need to set the default gateway to the IP of your router. What distro are you running. There should be a configuration tool for your network. Different distros have different tools. If you say which one, someone might be able to help you with it.
 
Old 10-12-2003, 02:00 AM   #7
kwiksand
Member
 
Registered: Jun 2003
Location: Perth, AUS
Distribution: Gentoo
Posts: 35

Rep: Reputation: 15
Is the static IP for the machine set at client level or server?

This is probably ignorance on my behalf, but I didn't realise that (At least with my router, Dlink 804V) If I wanted my web server to have a static IP, I couldn't just tell the client machine to use a static IP and expect it to connect to the network...

Instead, at router level, I gave the machine a static IP by always assignmnet 192.168.0.3 to its MAC address, in which the client still asks for a lease of an IP, but will always get the same one...

If of course this is so blindingly obvious, and represents a big hole in my understanding of DHCP servers then disregard it.. But it might help you out, depending on how you've tried to set things up..
 
Old 10-12-2003, 04:07 AM   #8
Rab22
Member
 
Registered: Dec 2002
Location: Currently: Normal, IL @ ISU -- Typically: South of Chicago
Distribution: Currently: RH 9 && Slackware 9.1 =)
Posts: 50

Rep: Reputation: 15
First, have you made sure that you set the DNS's to the client computers? If you don't it'll seem like you don't have internet because you won't have be able to resolve domain names to IPs. The reason you get internet w/DHCP ( I'm assuming) is because DHCP sends the DNSs along with other information. When you put static IPs in you have to add entires to /etc/resolv.conf to get internet =)

P.S. You'll also have to make sure that the routes on all your client computers are set to the GW of your router.
 
Old 10-13-2003, 02:52 PM   #9
wendallsan
Member
 
Registered: Jun 2003
Posts: 36

Original Poster
Rep: Reputation: 15
wow, so many answers, so many new questions from all those answers . . .

I think I'll try responding to sidmark-2850 1st:

if I want to set the default gateway to the IP of my router, which IP do I want to use, the IP of the subnet (192.168.1.1), or my WAN IP? I'm running Slackware 9.0 for my distro.

for kwicksand:

man I feel dumb trying to figure out where to start with your post! I have sooo much to learn about networking still. You want to know whether my static IP is set at the client or server level . . . I have been trying to set up my static IP in my /ect/rc.d/rc.inet1 file, that's the only way I know how, and I'm not sure whether that does things at a client or server level. As far as tweaking the router goes, I'll have to try that out as soon as I get home and see what happens, maybe I can do a fancy MAC addy to IP addy assignment w/ my linksys router, too, and that sounds like it would solve the problem.

Rab22:

thanks for the DNS info, I just presumed my computer would automatically use my ISP's DNS, even with a static IP configuration. I'll try adding some DNS entries to that /etc/resolv.conf file you talked about and see what happens.

thanks all of you for your help. I'll keep you all posted as to how far I get with this.

wendallsan
 
  


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
DHCP: Bad subnet number/mask combination OliXNet Linux - Networking 4 01-07-2010 10:17 AM
ADSL DHCP A-OK, but Mandrake 10.1 to be DHCP for other subnet is a problem turnbui Linux - Networking 2 08-20-2005 09:34 AM
DHCP Subnet Problems Hunza Linux - Networking 14 06-14-2004 03:38 AM
Help Me ! Subnet Selection On Sun 8 Dhcp Server !!!! honganhptit Solaris / OpenSolaris 2 05-25-2004 11:04 PM
dhcp subnet is 255.255.252.0 why does dhclient not find it???? baked Linux - Wireless Networking 0 01-06-2004 08:25 AM

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

All times are GMT -5. The time now is 12:16 PM.

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