LinuxQuestions.org
Register a domain and help support LQ
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 02-18-2013, 09:24 AM   #16
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,224

Original Poster
Rep: Reputation: 49

So I must put USE_DHCP[0]="no"? But then I cannot have internet. Or can I?
 
Old 02-18-2013, 10:36 AM   #17
NeoMetal
Member
 
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 106

Rep: Reputation: 19
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 )

Last edited by NeoMetal; 02-18-2013 at 10:37 AM.
 
Old 02-18-2013, 11:40 AM   #18
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,224

Original Poster
Rep: Reputation: 49
So I choose the local addresses in /etc/hosts. And how do I make those addresses static?
 
Old 02-18-2013, 01:48 PM   #19
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,330
Blog Entries: 3

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
Member Response

Hi,

You can setup static IP address in '/etc/rc.d/rc.inet1.conf' for device[#]
Quote:
# Config information for eth0:
IPADDR[0]="192.168.1.14"
NETMASK[0]="255.255.255.0"
When rc.inet1 runs then the '/etc/rc.d/rc.inet.conf' is used.

As to the range of IP that is up to you. Do not forget the 'dhcp' assignment ranges.
 
Old 02-18-2013, 01:57 PM   #20
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,330
Blog Entries: 3

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
Member Response

Hi,

One other thing, I set my local '/etc/hosts' to reflect the IP to hostnames on my LAN

Quote:
AME
hosts - static table lookup for hostnames

SYNOPSIS
/etc/hosts

DESCRIPTION
This manual page describes the format of the /etc/hosts file. This file is a simple text file that associates IP addresses with hostnames, one line
per IP address. For each host a single line should be present with the following information:

IP_address canonical_hostname [aliases...]

Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a comment, and
is ignored. Host names may contain only alphanumeric characters, minus signs ("-"), and periods ("."). They must begin with an alphabetic character
and end with an alphanumeric character. Optional aliases provide for name changes, alternate spellings, shorter hostnames, or generic hostnames (for
example, localhost).

The Berkeley Internet Name Domain (BIND) Server implements the Internet name server for UNIX systems. It augments or replaces the /etc/hosts file or
hostname lookup, and frees a host from relying on /etc/hosts being up to date and complete.
For a SOHO this can be an advantage when working between IP assigned machines on the LAN. Easier to remember a host name than a assigned IP if you have multiple machines on the LAN.
 
Old 02-18-2013, 03:51 PM   #21
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,224

Original Poster
Rep: Reputation: 49
I put, in /etc/rc.d/rc.inet1.conf, in one of the machines
Code:
IPADDR[0]="192.168.0.102"
NETMASK[0]="255.255.255.0" 
USE_DHCP[0]="yes"
DHCP_HOSTNAME=""
I booted and then did ifconfig. But it displayed

eth0 inet 192.168.0.101

which was the old ip. So the system doesn't read rc.inet1.conf?
 
Old 02-18-2013, 04:05 PM   #22
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,601
Blog Entries: 2

Rep: Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060
You have set up DHCP and a static IP, this won't work, use one or the other, not both.
 
Old 02-18-2013, 04:07 PM   #23
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,224

Original Poster
Rep: Reputation: 49
But I want static IPs for the local hosts and DHCP for the internet.
 
Old 02-18-2013, 04:36 PM   #24
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,601
Blog Entries: 2

Rep: Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060
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.
 
Old 02-18-2013, 08:45 PM   #25
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,330
Blog Entries: 3

Rep: Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466Reputation: 1466
Member Response

Hi,

Quote:
Originally Posted by stf92 View Post
I put, in /etc/rc.d/rc.inet1.conf, in one of the machines
Code:
IPADDR[0]="192.168.0.102"
NETMASK[0]="255.255.255.0" 
USE_DHCP[0]="yes"
DHCP_HOSTNAME=""
I booted and then did ifconfig. But it displayed

eth0 inet 192.168.0.101

which was the old ip. So the system doesn't read rc.inet1.conf?
What is your dhcp server? Router or modem? You must be aware of the pool range for dhcp assignments. Most newer modems/routers have the means to use web admin to setup as desired.

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:
hosts - static table lookup for hostnames
From information in '/etc/hosts';
Quote:
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine. It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#
# For loopbacking.

127.0.0.1 localhost

#07-27-06 22:30 gws
#new hosts section
##
#
192.168.1.1 somemodem.workgroup modem #dsl modem
192.168.1.2 machinea.workgroup amachine #A
192.168.1.3 machineb.workgroup bmachine #B
192.168.1.4
...
...
#192.168.1.100 #dhcp pool can be assigned at the router/modem which is DHCP server
...
#192.168.1.130 #end pool
192.168.1.131 #another range
...
192.168.1.255 #end
Please notice the definition for the use of '/etc/hosts' above.

Hope this helps!
 
Old 02-18-2013, 11:18 PM   #26
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,224

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

Last edited by stf92; 02-18-2013 at 11:40 PM.
 
Old 02-19-2013, 12:39 AM   #27
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 3,465

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
Quote:
But how to have them static and have Internet at the same time is a mystery to me.
What you want to do is set up address reservation in your router. I just downloaded a manual for your device from here http://www.tp-link.com.au/Resources/...User_Guide.pdf
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.
 
Old 02-19-2013, 01:02 AM   #28
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,224

Original Poster
Rep: Reputation: 49
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.
 
Old 02-19-2013, 05:13 AM   #29
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,601
Blog Entries: 2

Rep: Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060Reputation: 4060
Quote:
Originally Posted by stf92 View Post
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.
You seem to have serious problems to understand that your local net (your PCs and the part of the router that faces towards that net) and the Internet provided by your ISP are totally independent. While your modem gets an IP from your ISP this has absolutely nothing to do with your local network. You can give your PCs static IPs (and in simple Linux networks this is normally desired), while your modem gets a dynamic IP via DHCP from your ISP.

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.
 
Old 02-19-2013, 06:13 AM   #30
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,432

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
Quote:
Originally Posted by allend View Post
What you want to do is set up address reservation in your router. I just downloaded a manual for your device from here http://www.tp-link.com.au/Resources/...User_Guide.pdf
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.
This is likely your easiest option. See section 3.2 on the bottom of page 9 of the linked PDF for instructions how to configure the router using your web browser.
 
  


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
LXer: Microsoft, Motorola Patent Battle: A Lose-Lose-Lose Proposition LXer Syndicated Linux News 1 10-05-2010 09:51 PM
Lose Wireless Connection when Wired connection is disconnected phillywill Linux - Wireless Networking 65 01-21-2010 08:40 PM
lan connection between linux machine and windows machine arunsan842004 Linux - Laptop and Netbook 1 11-25-2008 05:44 AM
Configure Internet connection through LAN - windows machine Micik Mandriva 17 07-23-2007 06:33 AM
KDE 3.4 upgrade in Mandrake 10.1 caused kmenu and kcontrol to lose all entries cioannou Linux - Newbie 2 04-29-2005 08:06 PM


All times are GMT -5. The time now is 01:51 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration