LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-06-2010, 11:00 PM   #1
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Rep: Reputation: 55
static IPs from a dhcp router?


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?

Regards,

Martin
 
Old 07-07-2010, 12:28 AM   #2
dwabot
LQ Newbie
 
Registered: Jun 2009
Location: Toronto, Canada
Distribution: Slackware
Posts: 22

Rep: Reputation: 16
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).
 
Old 07-07-2010, 12:41 AM   #3
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,262
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
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!
 
Old 07-07-2010, 02:12 AM   #4
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by dwabot View Post
You can configure the home wireless router ... to assign a static IP tied to a certain MAC address. That is how I run DHCP on my netbook
But do you still use DHCP in the rc.inet1.conf of your netbook or no?
 
Old 07-07-2010, 02:46 AM   #5
dwabot
LQ Newbie
 
Registered: Jun 2009
Location: Toronto, Canada
Distribution: Slackware
Posts: 22

Rep: Reputation: 16
Yes. My netbook continues to use DHCP.

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
 
Old 07-07-2010, 03:24 AM   #6
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
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.

Regards,

Martin
 
Old 07-07-2010, 03:57 AM   #7
al_bye
LQ Newbie
 
Registered: Mar 2010
Distribution: Ubuntu 9.10, Ubuntu Netbook-Remix
Posts: 26

Rep: Reputation: 17
Default Linksys Configuration

Hi,

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.

Hope this helps

Al
 
Old 07-07-2010, 10:20 AM   #8
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by al_bye View Post
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.

Regards,

Martin
 
Old 07-07-2010, 12:57 PM   #9
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
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.
 
Old 07-07-2010, 07:33 PM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,922
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,

Quote:
Originally Posted by tramni1980 View Post
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.

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

'bgeddy' setup should work for you!

Sample '/etc/resolv.conf';
Code:
cat /etc/resolv.conf
#
#removed local DNS
#
nameserver 4.2.2.1                #Verizon L-3
nameserver 4.2.2.2
nameserver 4.2.2.3
nameserver 4.2.2.4
nameserver 208.67.222.222   # OpenDNS
I don't use Google's DNS for personal reasons.

Verizon & OpenDNS work fine along with my ISP DNS. I will have 2 ISP DNS & one fall back L-3. Works for me.
 
Old 07-08-2010, 01:32 AM   #11
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Thumbs up

Quote:
Originally Posted by bgeddy View Post
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 .

Regards,

Martin
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Debian as home router; dhcp doesnt give out ips Tangshan Linux - Networking 2 07-31-2006 11:52 PM
router/firewall for static ips and mult machines racerx7 Linux - Networking 3 07-08-2006 01:38 AM
internet router for multiple static ips shizzilla Linux - Networking 3 11-23-2005 11:20 PM
Using static ips with a router jclu Linux - Hardware 2 07-31-2005 05:35 PM
DSL via router: DHCP or static IP? Sinope Linux - Newbie 5 08-08-2004 04:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:33 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