SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Hello!
My ISP provides my internet via DHCP. I have a home wireless router to provide internet access, wired for my desktop machine and wireless for my laptop. My question is: Is it possible to configure the router (the Access Point) to provide internet to the desktop and the laptop via static IP? Currently I have managed to configure the internet to them via DHCP and it works. I am just curious to know whether it is possible to provide the internet for them by static IPs, given that the internet that actually goes into the Access Point (the wireless home router), is DHCP.
I fiddled with this a lot yesterday, but I only managed to get a working configuraton by DHCP for both the desktop and the laptop. If I supply them with static IPs, I can only ping the Access Point, but not beyond it. So does it at all make any sense to try to configure them by static IPs, i.e. is that virtually possible?
You can configure the home wireless router (at least I have done so with routers running Tomato and OpenWrt) to assign a static IP tied to a certain MAC address. That is how I run DHCP on my netbook but always have the same IP address when I on my home LAN (always having the same address is useful for scripting).
I set my router to reserve a block of IP addresses, set my wired desktop (via slackware netconfig) and printer (via print server utility) to use one of those. The wireless laptops get whatever is assigned via DHCP. My Netgear WNDR3700 has the option to reserve an IP for a particular MAC but I am too lazy to look up all those MAC values!
When my home wireless router receives a request for an IP address from my netbook... the router is configured so that it examines the netbook network interface's MAC address and always will assign it the same IP. My router runs OpenWrt and this setting is configured in the /etc/config/dhcp file.
Example: when router receives a DHCP request from network interface with MAC address 49:5b:39:13:91:a1 ... assign it IP address 192.168.1.50
I see, so you still use dhcp. My question was if it is possible to NOT use DHCP (set USE_DHCP="no" in rc.inet1.conf) in the clients of the router, when the router itself gets internet by dhcp.
My router is Wireless-N Home Router WRT120N Linksys Cisco. Actually in its setting I do not see an option for providing IPs without DHCP, there is only a "DHCP server settings" field.
As I said, I played a bit with the settings, but I could only get thing to work using dhcp=yes in the rc.inet1.confs of the clients.
Your router out of the box will be configured as follows: -
DHCP configured to receive a Public IP Address from your ISP (Allows access onto internet)this port is the ADSL or ethernet port. This will also have configured the DNS settings from your ISP which service name lookups i.e. google.co.uk.
On your ethernet port/WI-FI access point DNS settings will automatically sent down to the DHCP server (Configured by default to issue 192.x.x.x). You could just disable the DHCP server all together and statically assign IP address's. I think that config is on the LAN setup from memory.
Now you'll need to know the DNS server address from your ISP or use the following primary 4.2.2.4 secondary 8.8.8.8.
Make sure the Defualt Gateway is the IP address of the router 192.168.1.1 or 192.168.0.1 this will then allow you to browse the internet. As it's a home network I'd just leave the default settings on the linksys unless you want to host something from home then it becomes a different ball game.
You could just disable the DHCP server all together and statically assign IP address's. ...
Now you'll need to know the DNS server address from your ISP or use the following primary 4.2.2.4 secondary 8.8.8.8.
Make sure the Default Gateway is the IP address of the router 192.168.1.1 or 192.168.0.1 this will then allow you to browse the internet.
Al
Thanks for your replies.
I tried disabling DHCP in both the router and the inet1.confs of the clients. In the "Advanced routing table" of the router configuration I set the IPs of the two machines, the netmasks and the gateway. The only place where I found DNS settings is the "DHCP server settings". So I tried both setting them to the values from /etc/rseolv.conf and with 8.8.8.8 and 8.8.4.4. The result was always the same: there is ping to the Access Point and to any external IP. But there is no ping to any site if the address is written in words (sorry, I lack terminilogy as I am not a specialist ). So I guess it is a DNS issue, but I am at a loss. I also suspect that my DNS is dynamic.
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
Rep:
Quote:
I tried disabling DHCP in both the router and the inet1.confs of the clients. In the "Advanced routing table" of the router configuration I set the IPs of the two machines, the netmasks and the gateway.
You shouldn't need the set any "Advanced routing table" options and if you have I would set them back to what they were.
You can leave the DHCP server running in the router and have your client boxes use fixed IP's either by "DHCP Reservation" at the router which will let you permanently assign an IP to a Mac address so evert time a box gets it's IP via DHCP it will be the same.
The other option is to have the clients utilize static IP and not use DHCP. To do this you will need to check the router doesn't hand out IP's via DHCP to future clients that you already use statically. This should be OK as your router default is to start it's DHCP range at 192.168.1.100 so you may assign a static address in the range 192.168.1.2-192.168.1.99 without a problem.
Then you need to check the GATEWAY= setting in rc.inet1.conf. This will most likely be 192.168.1.1 (the router's address) but to make sure just set a client PC to use DHCP and when it's connected and can reach the internet run:
Code:
/sbin/route -n
to see where the Gateway has been assigned for that box. Also run:
Code:
cat /etc/resolv.conf
to see what DNS ip's have been assigned via DHCP. Again this may well be the router's IP 192.168.1.1.
Then it;s just a matter of setting the IP's (GATEWAY= in /etc/rc.d/rc.inet1.conf and nameserver in /etc/resolv.conf) then change /etc/rc.d/rc.inet1.conf to use_dhcp[0]="" from use_dhcp[0]="yes" and assign IPs to IPADDR[0]. The interfaces number may be different than [0] in my example.
This should all just work and you don't need to turn off DHCP at the router and add any routes to it's tables or anything.
I tried disabling DHCP in both the router and the inet1.confs of the clients. In the "Advanced routing table" of the router configuration I set the IPs of the two machines, the netmasks and the gateway. The only place where I found DNS settings is the "DHCP server settings". So I tried both setting them to the values from /etc/rseolv.conf and with 8.8.8.8 and 8.8.4.4. The result was always the same: there is ping to the Access Point and to any external IP. But there is no ping to any site if the address is written in words (sorry, I lack terminilogy as I am not a specialist ). So I guess it is a DNS issue, but I am at a loss. I also suspect that my DNS is dynamic.
Regards,
Martin
What do you assign in '/etc/resolv.conf'? for the static IP assignment for the machine?
I would be sure to include the 'DNS' provided by the ISP. Your 'route' sounds like it's setup. Post the 'route -n'.
You shouldn't need the set any "Advanced routing table" options and if you have I would set them back to what they were.
You can leave the DHCP server running in the router and have your client boxes use fixed IP's either by "DHCP Reservation" at the router which will let you permanently assign an IP to a Mac address so evert time a box gets it's IP via DHCP it will be the same.
The other option is to have the clients utilize static IP and not use DHCP. To do this you will need to check the router doesn't hand out IP's via DHCP to future clients that you already use statically. This should be OK as your router default is to start it's DHCP range at 192.168.1.100 so you may assign a static address in the range 192.168.1.2-192.168.1.99 without a problem.
Then you need to check the GATEWAY= setting in rc.inet1.conf. This will most likely be 192.168.1.1 (the router's address) but to make sure just set a client PC to use DHCP and when it's connected and can reach the internet run:
Code:
/sbin/route -n
to see where the Gateway has been assigned for that box. Also run:
Code:
cat /etc/resolv.conf
to see what DNS ip's have been assigned via DHCP. Again this may well be the router's IP 192.168.1.1.
Then it;s just a matter of setting the IP's (GATEWAY= in /etc/rc.d/rc.inet1.conf and nameserver in /etc/resolv.conf) then change /etc/rc.d/rc.inet1.conf to use_dhcp[0]="" from use_dhcp[0]="yes" and assign IPs to IPADDR[0]. The interfaces number may be different than [0] in my example.
This should all just work and you don't need to turn off DHCP at the router and add any routes to it's tables or anything.
Thank you very much for your replies. Owing to them I finally have a home computer network with statically assigned IPs.
So I disabled DHCP in both the router and the clients. Of course the router gets its internet by DHCP, as this is the way my ISP provides my internet. Then I set the IPs of the two machines to 192.168.1.2 and 192.168.1.3, because the IP of the router is 192.168.1.1. Finally I edited resolv.conf and set the DNS server of my ISP. Now everything works!
Thank you very much again. This was a bit of learning experience for an amateur like me .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.