So I must put USE_DHCP[0]="no"? But then I cannot have internet. Or can I?
|
You can still have internet, a public facing dhcp address is assigned to your broadband modem / router , your network behind that router (using the router as a gateway) can use static local range addresses (assuming this is a standard home network NAT setup, the router will translate your local addresses appropriately when connecting to machines on the internet )
|
So I choose the local addresses in /etc/hosts. And how do I make those addresses static?
|
Member Response
Hi,
You can setup static IP address in '/etc/rc.d/rc.inet1.conf' for device[#] Quote:
As to the range of IP that is up to you. Do not forget the 'dhcp' assignment ranges. |
Member Response
Hi,
One other thing, I set my local '/etc/hosts' to reflect the IP to hostnames on my LAN Quote:
|
I put, in /etc/rc.d/rc.inet1.conf, in one of the machines
Code:
IPADDR[0]="192.168.0.102" eth0 inet 192.168.0.101 which was the old ip. So the system doesn't read rc.inet1.conf? |
You have set up DHCP and a static IP, this won't work, use one or the other, not both.
|
But I want static IPs for the local hosts and DHCP for the internet.
|
Your local Lan has absolutely nothing to do with the settings that the router has for connecting to the Internet. The settings for the router have to be done on the router itself, not on the local machines. All your local machines need is an address for the gateway to access the Internet, the gateway is your router.
|
Member Response
Hi,
Quote:
You are making things complicated. For your static IP for each machine which are assigned by you. You can then setup '/etc/hosts' to reflect name and IP assignments to allow you to use the name. That is why 'man hosts' states; Quote:
Quote:
Hope this helps! |
My ISP is Fibertel. When I subscribed their service they sent a technician home who installed a cable modem. That's all the equipment I had besides the computer connected to it, until recently when I bought a router and connected two computers and the cable modem to the router.
The router is a TP-LINK TL-WR740N. The box says it incorporates NAT and DHCP server. The modem is a Motorola Surboard 5051. Now, what I know is that the IP provided by the ISP is not static. It can change at any moment. All I need to know is 1) What entries do I need in /etc/rc.d/rc.inet1.conf: IPADDR[0]= ? NETMASK[0]= ? USE_DHCP[0]= ? DHCP_HOSTNAME= ? GATEWAY= ? 2) What entries do I need in /etc/hosts. As I see it, /etc/hosts is not important. It only gives a name to the IPs, but I could use the IPs directly for that case. So the crucial point is what do I put in inet1.conf and perhaps something else. Up to now I have been doing fine with USE_DHCP[0]="yes" and all other variables shown above empty (="") and /etc/hosts like this: Machine 1: 127.0.0.1 localhost 127.0.0.1 MACH1.DN1 MACH1 192.168.0.101 MACH2.DN2 MACH2 Machine 2: 127.0.0.1 localhost 127.0.0.1 MACH2.DN2 MACH2 192.168.0.100 MACH1.DN1 MACH1 But these two IPs I did not choose them. I copied what I saw in ifconfig's output. And the main drawback is that these IPs change. They already explained to me it is because they are not static. But how to have them static and have Internet at the same time is a mystery to me. |
Quote:
See Section 4.7 DHCP and within that 4.7.3 Address Reservation On your Slackware box, you want to set your Slackware box to get it's IP address by DHCP. This will be supplied by the DHCP server in the router. |
Thank you for your post and link. I have the CD that came with the router, but the setup programs in it are for windows. The case of a Linux user has not been anticipated.
|
Quote:
So simply set up static IPs for your PC and disable DHCP on them, this will not prevent your modem from getting an dynamic ISP from your ISP. |
Quote:
|
All times are GMT -5. The time now is 09:23 PM. |