Having internet with USE_DHCP="" in rc.inet1.conf possible?
Hi: If I want to have static local IP address but my ISP only provides me DHCP, is that possible? To make the local hosts IPs static, I have to have
IPADDR[0]="192.168.0.2" #Example NETMASK[0]="255.255.255.0" in /etc/rc.d/rc.inet1.conf But then I must have USE_DHCP[0]="" and then I am left without internet. Is this dilemma solvable? |
If I am correct, this is possible *only* if your ISP provides you a fixed IP address (IOW when you request an IP address, the DHCP server of your ISP always gives you the same one).
Then you can just use the "static IP" option of 'netconfig' to set up your wired network connection. I assume the NetworkManager option is usable as well for that, but didn't actually check. |
Thanks. My ISP only gives dynamic IPs. But there must be a way I can choose an IP for the machines in my LAN. For the moment, what I do is to run ifconfig and use the IP appearing to the right of inet. Example:
# ifconfig eth0 inet 192.168.0.100 and I use 192.168.0.100 for that machine. But then, may be tomorrow, I run ifconfig and the inet number has change, which is very upsetting. Is there a solution? |
If you try putting the following in a file under /lib/dhcpcd/dhcpcd-hooks/
Code:
ip addr add 192.168.0.100/24 eth0 There are examples for other distros but they have totally different network configuration systems so I don't know how to convert them over. |
Does one of your boxes act as a NAT router, or are they all directly connected to the Internet ?
|
The two computers in my LAN are connected to a NAT router and this to the cable modem.
|
Hmm.
Did you set a default route (Shown as "GATEWAY" in rc.inet1.conf) when you tired the static only settings? |
Yes, I put
GATEWAY="192.168.0.1" which was in the output of the route command. |
Following from my suggestion in your thread, the answer is YES.
You do not need to use any Windows setup software. You can access your router and do configuration using a web browser on your Slackware box. Again, from the manual Quote:
When this is completed, your Slackware box will always be assigned the same IP address. The behaviour will be exactly like assigning a static IP address to your Slackware box. I do this with my setup, so that my desktop, laptop wired interface and laptop wireless interface are always assigned the same IP address. This is necessary for me to be able to use NFS without addressing issues. I think you need to understand the steps involved in establishing your connection to the internet. When you turn your router on, it sends out a DHCP request to your ISP's DHCP server and the ISP's server responds and assigns your router a WAN IP address. As you have seen, this is likely to be different from one connection to the next. This is the IP address that would be reported if you were to do a query to whatsmyip or similar. Your router also contains a DHCP server (enabled by default with your hardware). If you have your Slackware box set to use DHCP, it will send a DHCP request that will go to your router's DHCP server. The router's DHCP server will respond and assign your SLackware box a LAN IP address. By using address reservation, this will always be the same IP address. |
You are the first person who explains this with clarity. It's now a week long since I began reading the Linux Network Administrator's Guide, only to find, just now, that is does not mention DHCP anywhere. I've lost my time. Now I am reading http://www.tldp.org/HOWTO/Cable-Modem/index.html but I'm afraid the part covering DHCP is inaccessible.
What I can't understand is that my problem has to be a very common one for people having two computers connected to the same ISP account. Why pay for two accounts? |
You don't pay for two accounts. Your problem is a problem in understanding, it is neither a physical nor a hardware problem, so for most people it is not a common problem. From reading your threads I get the feeling that you tend to over-complicate simple things, preventing yourself from seeing the simple solutions. I will explain it once more here, as I have done in your other thread regarding the same topic (in the future please ask follow up questions in the already existing thread).
Your router and the PCs in your local net are totally independent from your modem and the Internet. While your modem gets an IP from your ISP (via DHCP) this has absolutely nothing to do with DHCP in your local network. Again, those networks are independent, your local machines don't care at all (and don't need to know) how the modem gets its IP. Just give them a static IP, set the router as gateway and all is fine. |
Quote:
|
OK. But I repeat once more. If I put USE_DHCP="" I am left without internet. Are the settings in inet1.conf LAN settings or WAN settings?
|
To use DHCP you want USE_DHCP="yes"
The settings in rc.inet1.conf are LAN settings in your setup. |
Quote:
Code:
nameserver 192.168.0.1 |
All times are GMT -5. The time now is 03:46 AM. |