static ip machine attached to dhcp router? will this work?
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.
static ip machine attached to dhcp router? will this work?
I have a linksys wireless router attached to my office's internet connection. The router runs a dhcp server so that wireless laptops can use it to connect to the internet. But, I have a linux workstation that I want to give a static ip (eg 192.168.1.100) so that the router can forward a few ports to this machine (e.g. 22/tcp so that I can ssh to the workstation when not in my office).
Right now I configured the workstation so that it is 1.100 as above. But when I came into my office this morning ifconfig said that the machine was 1.103. In fact, the machine had lost its internet connection. So, I re-started networking and all was fine. Now, ifconfig says that the machine is 1.100 again.
But, I am wondering if this is going to be a problem everyday. Why was my workstation adaptor confused about its true identity? Can I tell the adaptor to ignore dynamic IPs if the router tries to give it one?
Obviously your linux workstation is setup with dhcp. With dhcp enabled it will grab any IP address (e.g. 192.168.1.100) signed by the router i.e. the dhcp server. When this signed IP address leased time expires it will ask again a different IP address and in that case the router give 192.168.1.103. If you connect your notebook, and because your notebook setup is also using dhcp it will ask any IP from the router, can be 192.168.1.100 ... 192.168.1.254 but not 192.168.1.103 as it grabbed by the workstation.
Don't use dhcp if you want to have a static address on the workstation. Will it work? I don't know. I mean it depends. And sombody may help you to make it works ;-)
My workstation does not use dhcp to get an IP address. I configured it to have the static IP 192.168.1.100. The router assigns addresses to wireless users starting at 192.168.1.200.
Right now, the workstation is doing fine. But, sometimes it seems to get confused and eth0 thinks it has an IP address of 1.200 or 1.201 etc. My question is, how can I prevent this? ie, how can I use a workstation with a static IP on a router that runs a dhcp server?
I'm haveig the same problem. I want my linux box to keep a static IP so I can forward a couple of ports to it. I read on theese forums about how to manually give a static IP, which I don't know if it is the right way to do it, the rest of my network can not acess my router. Can you have 1 static IP and multiple DHCP assigned IP's on the same network segment?
I am not familiar with home routers, but have set up dchp a couple of time. Is there a way to configure your router, like though your web browser? I think I remeber reading that Linksys routers can be configured by using a web browser. If so and you can configure dhcp, then there are a couple of options.
1. Is to turn off dhcp. I don't recomend using it un less there are 10 to 15 or more node and the lan.
2. You could set up a reservation so that your MAC of the nic on the laptop always get assigned the same ip address or setup it up to exclude the 5 or 10 numbers so that you could use statice ips for server (if you have any).
If you can config the router, you might want to think about setting up some custom rules. I never trust a factroy setting.
Let me to clarify the terms:
1. static ip is ip set at computer box
2. dynamic ip is the ip send to the box on its request and can be:
a. constant (same each time for box)
b. non-constant
Case 1 - can be applied at computer at any time
Case 2a. - require proper dhcp server (in your case the router) configuration on MAC addres base
Normally SOHO routers have an option to reserve certain IP addresses. For instance, my router (NetGear) allows me to assign IP addresses to certain MAC addresses). You should have no problem using a static IP address with your router as long as you fill in the correct settings, and the IP address isn't in use already. I run this setup great, as I too use port forwarding.
<security rant>
I would highly recommend you modify your wireless settings so the user doesn't automatically receive an IP address. Basically home routers have 4 ways to prevent unauthorized use: WEP key, SSID, MAC address filtering, and turning off DHCP. WEP keys can be broken in time, and we all know that SSID's (even "non-broadcast" SSIDs) can be discovered. You should filter the MAC addresses so it makes it that much harder for someone to use your network (they can be stolen from packet headers). Disabling DHCP makes it harder for the casual passerby to access your network.
</rant>
i believe in the linksys you can give an IP to a certain computer based on its MAC address. Check that out though in advance setup options of the router. If the router lets you do that then that solves all of your problems..... like tangle said a couple posts ago.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.