LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-02-2006, 09:31 AM   #1
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Rep: Reputation: 30
static ip in a private lan


I know this question has been asked,im sorry to be the one to ask it again.Any way here goes i have a linksys router and 3 computers my main desktop computer i call aries i would like to assign an address of 192.168.1.101 then my second computer i call compaq i would like to assign an address of 192.168.1.102 i then have a wireless laptop maybe we should forget that one for now and concetrate on the other 2.any way i know if i wanted how to bring eth0 down on aries and tell it to use ip of 192.168.1.101 but when i reboot the router then assigns it lets say 192.168.1.105 i dont know how to tell my router to keep assigning the address of 192.168.1.101 which is quite annoying is there a file i can alter on aries to make sure it gets the ip i want it to have, or does everything have to be alterd on the router.
Thanks nige
 
Old 01-02-2006, 09:32 AM   #2
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
i think i should of told you i am running debian 3.1
 
Old 01-02-2006, 10:28 AM   #3
ralvez
Member
 
Registered: Oct 2003
Location: Canada
Distribution: ArchLinux && Slackware 10.1
Posts: 298

Rep: Reputation: 30
OK, seem to me that your router is serving DHCP addresses. That is OK, your systems do not have to take addresses from it.
Look for a file called: rc.inet1.conf, in Slack that file is located in:/etc/rc.d/rc.inet1.conf but I'm not familiar with Debian.
When you locate that file edit it, look for:

# Config information for eth0:
IPADDR[0]="192.168.1.101"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

Also make sure to edit the file /etc/hosts and to add the names of the other machines in the system, so instead of having to, for example, type: ping 192.168.1.105 you can use ping compaq.

Hope this helps.

Rick

Last edited by ralvez; 01-02-2006 at 10:29 AM.
 
Old 01-02-2006, 11:12 AM   #4
bdogg
Member
 
Registered: Sep 2004
Location: Salt Lake City, UT
Distribution: Debian Sarge
Posts: 93

Rep: Reputation: 15
It's always best to assign static addresses like these to the upper parts of your subnet, or make sure you reserve a block of addresses in the configuration on your router. If you don't you could end up with ip address conflicts when new computers enter your network because they will request and get ip addresses in the lower range (101, 102, etc) and you will already have those configured statically on your other machines.

Though, if your router is handing out .105 now, it seems like you have already reserved a block at the beginning of your subnet.
 
Old 01-02-2006, 01:47 PM   #5
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
Thanks for you replies it is helpful i have been asking around what the
name of that file would be in debian as the one mentioned is not there.
Thanks again nige
 
Old 01-02-2006, 01:56 PM   #6
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
ok iv got it the file is called "/etc/network/interfaces" it looks like this.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth1
iface eth1 inet dhcp
should i just comment everything out and replace it with.
# Config information for eth0:
IPADDR[0]="192.168.1.101"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
THanks nige
 
Old 01-02-2006, 02:08 PM   #7
firefox2501
LQ Newbie
 
Registered: Aug 2003
Distribution: Gentoo, Suse
Posts: 19

Rep: Reputation: 0
As per:
http://www.aboutdebian.com/network.htm

to set the static address, in the file "/etc/network/interfaces" change the lines that say:
Code:
# The primary network interface
auto eth1
iface eth1 inet dhcp
to say this:
Code:
# The primary network interface
auto eth1
iface eth1 inet static
    address 192.168.1.101
    netmask 255.255.255.0
    gateway 192.168.1.1
remove the lines that say:
Code:
# Config information for eth0:
IPADDR[0]="192.168.1.101"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
as that is specific to another distro.

If you have a static IP address, you may have to update your /etc/resolv.conf to include you DNS servers. You can find this information on the Linksys Router's "Status" page.

The resolv.conf should look like:
Code:
search <YOUR ISP>
nameserver <IP OF PRIMARY DNS>
nameserver <IP OF SECONDARY DNS>
Incidentally, you may want to use a different IP address than .101. Your Linksys router is handing out that IP via DHCP, so there is a potential for an IP address conflict. I would recommend that you use a lower number, like one between .2 and .99 for your static IP addresses as the Linksys router by default is handing out from .101 to .150. Do not use .1 as this is the default IP of the router.

Hope this helps

Last edited by firefox2501; 01-02-2006 at 02:17 PM.
 
Old 01-02-2006, 02:29 PM   #8
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
Thats brilliant thanks very much.
 
Old 01-04-2006, 03:25 PM   #9
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
ok thats all up and running now what i would like to do is set static ip for my wireless laptop
 
Old 01-04-2006, 05:28 PM   #10
assacin
LQ Newbie
 
Registered: Jan 2006
Location: India
Distribution: fedora , debian & red hat , RHEL
Posts: 13

Rep: Reputation: 0
Hello,
It seens that your router is serving as a DHCP also. In this case if u use a redhat distro the issue the command #netconfig as root to configure the eth0 & give a static IP.
I guess this will solve the probs...

Happy Computing :-)
 
Old 01-04-2006, 06:02 PM   #11
firefox2501
LQ Newbie
 
Registered: Aug 2003
Distribution: Gentoo, Suse
Posts: 19

Rep: Reputation: 0
Since one of the beauties of Linux is learning how to do things, I like to give the first answer as a freebie and provide a link to where you can find further information. That said, check the link from my last post, reshown here, for all of the information that you will need to configure any network interface, both wired and wireless, under Debian.

http://www.aboutdebian.com/network.htm

And remember, Google can be your best friend.
 
Old 02-19-2006, 03:39 PM   #12
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
just thought i would mention i got my wireless to accept a static ip,all i did was edit the file /etc/network/interface mine now looks like this
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map wlan0

# The primary network interface
iface wlan0 inet static
address 192.168.1.151
netmask 255.255.255.0
gateway 192.168.1.1
so all i did was add the last 3 lines and change all words that said eth0 to wlan0.
Once again thanks very much
 
Old 02-19-2006, 10:39 PM   #13
ExplodingTurnip
LQ Newbie
 
Registered: May 2005
Location: Los Angeles, CA USA
Distribution: Slackware, Knoppix
Posts: 23

Rep: Reputation: 15
Another option is to have your DHCP server assign static IP's using the NIC's MAC address. I've got my Slackware box setup to assign static IP's to both my desktop box and my laptop (both XP machines) via DHCP using MACs. The upside to this is that I never have to reconfigure the NICs on either computer if I have to re-install the OS.

Doing a manual config of the NIC is perfectly fine too, the MAC method is just another alternative that's available.
 
  


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
cannot reach internet from private LAN toodr Linux - Networking 12 10-23-2005 07:44 PM
Making static symbols private/local in shared libraries skoona Programming 1 02-18-2005 03:14 PM
Private LAN setup with redhat 9 help ezeke1 Linux - Networking 24 11-18-2004 05:27 AM
routing issue :- have a simple private LAN, with.... inode100 Linux - Networking 10 02-22-2004 02:06 PM
Route a private LAN with 1 NIC freelinuxcpp Linux - Networking 4 11-01-2003 05:05 AM


All times are GMT -5. The time now is 02:52 AM.

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