Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-02-2006, 10:31 AM
|
#1
|
Member
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/Win7/8/10
Posts: 680
Rep:
|
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
|
|
|
01-02-2006, 10:32 AM
|
#2
|
Member
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/Win7/8/10
Posts: 680
Original Poster
Rep:
|
i think i should of told you i am running debian 3.1
|
|
|
01-02-2006, 11:28 AM
|
#3
|
Member
Registered: Oct 2003
Location: Canada
Distribution: ArchLinux && Slackware 10.1
Posts: 298
Rep:
|
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 11:29 AM.
|
|
|
01-02-2006, 12:12 PM
|
#4
|
Member
Registered: Sep 2004
Location: Salt Lake City, UT
Distribution: Debian Sarge
Posts: 93
Rep:
|
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.
|
|
|
01-02-2006, 02:47 PM
|
#5
|
Member
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/Win7/8/10
Posts: 680
Original Poster
Rep:
|
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
|
|
|
01-02-2006, 02:56 PM
|
#6
|
Member
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/Win7/8/10
Posts: 680
Original Poster
Rep:
|
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
|
|
|
01-02-2006, 03:08 PM
|
#7
|
LQ Newbie
Registered: Aug 2003
Distribution: Gentoo, Suse
Posts: 19
Rep:
|
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 03:17 PM.
|
|
|
01-02-2006, 03:29 PM
|
#8
|
Member
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/Win7/8/10
Posts: 680
Original Poster
Rep:
|
Thats brilliant thanks very much.
|
|
|
01-04-2006, 04:25 PM
|
#9
|
Member
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/Win7/8/10
Posts: 680
Original Poster
Rep:
|
ok thats all up and running now what i would like to do is set static ip for my wireless laptop
|
|
|
01-04-2006, 06:28 PM
|
#10
|
LQ Newbie
Registered: Jan 2006
Location: India
Distribution: fedora , debian & red hat , RHEL
Posts: 13
Rep:
|
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 :-)
|
|
|
01-04-2006, 07:02 PM
|
#11
|
LQ Newbie
Registered: Aug 2003
Distribution: Gentoo, Suse
Posts: 19
Rep:
|
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.
|
|
|
02-19-2006, 04:39 PM
|
#12
|
Member
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/Win7/8/10
Posts: 680
Original Poster
Rep:
|
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
|
|
|
02-19-2006, 11:39 PM
|
#13
|
LQ Newbie
Registered: May 2005
Location: Los Angeles, CA USA
Distribution: Slackware, Knoppix
Posts: 23
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 10:13 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|