Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is a very basic question so feel free to tell me to RTFM- point me at a tutorial or something.
I have three PC's connected to a linksys router. Everything works fine, but based on which one is turned on first, they get different ip addresses on the lan. How do I make them stick to thier ip address? I want:
windows box: 192.168.1.100
linux 1: 192.168.1.101
linux 2: 192.168.1.102
You need to change their configuration from a dynamic IP assigned by DHCP ("get IP address automatically" in windows) to the appropriate static IP. Also double-check your router configuration to make sure it will allow static IPs (most will have some blank where you can say that you have 100-102 assigned statically, so it won't try to give those IPs out to any other computers)
Originally posted by Qzukk You need to change their configuration from a dynamic IP assigned by DHCP ("get IP address automatically" in windows) to the appropriate static IP.
Thanks but where do I change that configuration- what file?
You definitely need my last 5 lines (IPADDR through BROADCAST) in your file, and you want to set your BOOTPROTO line to none instead of dhcp. I'm not sure what USERCTL and PEERDNS do.
The 192.168.1.0 address space is reserved for local networks like yours (and mine), so you don't need to worry about using the same address as me. The IPs you listed earlier are fine.
Make the changes to the file, reboot, and then try:
/sbin/ifconfig -a
to see the status of your interfaces. If you see the word "up," that's good. (Try visiting a webpage too.)
Also try:
ping 192.168.1.1
If nothing works, check that you have the right driver loaded:
/sbin/lsmod
(Your driver could also be compiled into your kernel if lsmod doesn't find it.)
Ok, I made the changes as follows and rebooted, but nothing changed- the ip is still the same and I'm still on the network ok (can ping or get web pages). (I am on fedora, btw):
to see if it worked. This won't fix your problem permanently, but it's a start. You might also try:
locate ifcfg-eth0
There are several different versions of the ifcfg-eth0 file; I'm not sure which take precedence of over the others. I have three versions in various subdirectories of /etc/sysconfig.
well, /sbin/ifconfig eth0 192.168.1.108 worked (it was funny because I was sshed into the machine when I did it hehe), but as for locate ifcfg-eth0 all I got was the one:
pingswept thanks for your persistence and patience. I figured it out. It was me. (of course).
What happend was, when I edited ifcfg-eth0, I made a copy if it first, in the same dir. What I didn't know is that everything in that directory gets run. I was thinking it was like other conf files like fstabs or httpd.conf, where you should make a ".old" copy before you make changes, in case you screw something up. The name of the copy I made was aphabetically greater than "ifcfg-eth0", so it was running after ifcfg-eth0 ran, and therefore overriding it.
Curiously, the way I found out about this was I tried to do the same thing on my Mandrake box, and during reboot it listed the copy file and said "sorry, eth0 is already setup, not running this config". Redhat doesn't do that check, it just runs whatever. Interesting, right? Chalk one up for Mandrake.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.