You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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.

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.

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.

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

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.

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.