LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 10-07-2005, 05:54 AM   #1
garyozzy
Member
 
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181

Rep: Reputation: 30
static ip


how do i set up a static ip?

netconfig won't work. i set it to static, but i get an ip through DHCP

thanks
 
Old 10-07-2005, 05:59 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You can set it in /etc/rc.d/rc.inet1.conf
 
Old 10-07-2005, 06:02 AM   #3
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
You can setup your dhcp server to always give the same IP to your machine, this can be done because the mac address of a nic is unique.

Otherwise you can disable the dhcp client on your workstation and edit /etc/rc.d/rc.inet1.conf and set the static IP and subnet there for your nic

edit: somone beat me to it
 
Old 10-07-2005, 06:20 AM   #4
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Type pkgtool in console. Select setup anf choose Slackware installation scripts to run again. Then check netconfig, press ok, in SETUP IP ADRESS select STATIC IP.
 
Old 10-07-2005, 12:05 PM   #5
garyozzy
Member
 
Registered: Jun 2005
Distribution: RHEL, CentOS, Debian, Ubuntu, Arch
Posts: 181

Original Poster
Rep: Reputation: 30
i have DHCP set up on my router. Will that override a static IP set up in slackware?
 
Old 10-07-2005, 02:34 PM   #6
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally posted by garyozzy
i have DHCP set up on my router. Will that override a static IP set up in slackware?
Actually yes. I just disabled the DHCP server part of my rounter (LinkSys BEFSR41) and set all my PC's to static IP's and everything works fine. Just be sure that you set your default gateway and DNS server to the same thing.

HTH,
MMYoung
 
Old 10-07-2005, 03:22 PM   #7
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Quote:
Originally posted by garyozzy
i have DHCP set up on my router. Will that override a static IP set up in slackware?
No. The Slackware box will never make a DHCP request if set with a static IP address. The router will be irrelevant.
 
Old 10-07-2005, 04:06 PM   #8
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally posted by shilo
No. The Slackware box will never make a DHCP request if set with a static IP address. The router will be irrelevant.
There won't be a DHCP request, true enough, but I had trouble with my PC set to a static IP address and my router set to be a DHCP server. After I "disabled" the DHCP server setting in the router config everything works as "smooth as silk".

Later,
MMYoung
 
Old 10-07-2005, 04:24 PM   #9
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
MMYoung:

I would guess that the issue might have been this (I've had it happen before):

You set up a router to be a DHCP server.

You set up a Slackware box with a static IP address (For example, as 192.168.0.2)

You have other devices (Computers, printer servers, whatever) on your LAN set to use the DHCP server

You fire up the Slackware computer

The problem can arise that the Slackware computer now thinks that it has the IP address 192.168.0.2, but the router has already leased that IP address to another device on the LAN.

There are several solutions to this, and it would depend on the capability of your router and the general LAN layout which would be best.

1) Disable DHCP server function in router

The possible issue with this is that other devices will also need to be set with static IP addresses. This can get to be a pretty big hassle, depending on the size of the LAN.

2) Configure the DHCP server to not pass out the IP address you have set Slackware for

This can be done several ways:

A) See what the range of IP addresses your router passes out. Choose something outside that range for your IP address.

B) Configure your router to always pass the desired IP adress to your Slackware computer. Even if you set Slackware up for a static IP address, this works because the router reserves that IP address, not passing it out to other devices on your LAN

C) Change the range of IP addresses your router passes out to not include the IP address of the Slackware box. This is basically another way of doing the same thing as A).

I prefer 2)B) myself. Disabling the DHCP server can be a pain. You will have to set IP addresses statically on every device that you connect to the LAN. I prefer being able to just hook up more exotic print servers and things and have them use DHCP. Saves the trouble of reading through the manuals to learn how to set static IP addresses.
 
Old 10-09-2005, 02:51 PM   #10
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally posted by shilo
I would guess that the issue might have been this (I've had it happen before):

You set up a router to be a DHCP server.

You set up a Slackware box with a static IP address (For example, as 192.168.0.2)

You have other devices (Computers, printer servers, whatever) on your LAN set to use the DHCP server

You fire up the Slackware computer

The problem can arise that the Slackware computer now thinks that it has the IP address 192.168.0.2, but the router has already leased that IP address to another device on the LAN.

There are several solutions to this, and it would depend on the capability of your router and the general LAN layout which would be best.

1) Disable DHCP server function in router
This is what I have chosen for my little home network (two PC's only). As far as the other stuff you hit the nail on the head. By disabling the DHCP server function I have eleminated the problem and with only two PC's it ain't much of a headache. This way I can also add their respective names to /etc/hosts and then just connect to the name rather than having to specify IP addresses everytime.
Quote:
Originally posted by shilo
2) Configure the DHCP server to not pass out the IP address you have set Slackware for

This can be done several ways:

A) See what the range of IP addresses your router passes out. Choose something outside that range for your IP address.

B) Configure your router to always pass the desired IP adress to your Slackware computer. Even if you set Slackware up for a static IP address, this works because the router reserves that IP address, not passing it out to other devices on your LAN

C) Change the range of IP addresses your router passes out to not include the IP address of the Slackware box. This is basically another way of doing the same thing as A).

I prefer 2)B) myself. Disabling the DHCP server can be a pain. You will have to set IP addresses statically on every device that you connect to the LAN. I prefer being able to just hook up more exotic print servers and things and have them use DHCP. Saves the trouble of reading through the manuals to learn how to set static IP addresses.
If I had a larger network to "fiddle with" then I would use the DHCP server on the router PLUS I would add one PC as just my DHCP server this way I could reserve IP addresses against MAC addresses and/or computer names. At least I know you can do this in Windows so I figure it can be done with Linux although I've never tried it.

Later,
MMYoung
 
  


Reply



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
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
Is there any static ARP for static IP network? linux_lover2005 Linux - Networking 2 05-18-2005 12:01 PM
no static ip need help kwickcut Mandriva 1 12-07-2004 06:59 PM
Can't use static IP linuxistan Linux - Networking 5 10-17-2004 09:26 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:05 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration