LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-28-2005, 03:25 PM   #1
mikz
Member
 
Registered: Sep 2004
Distribution: Slackware current
Posts: 109

Rep: Reputation: 15
Static IP address


I have a slackware 10 which acts a webserver. The webserver is on my LAN and recieves its IP (192.168.0.4) via the DHCP from my router which has an IP-pool of 192.168.0.1 - 99.
How do I go about giving my webserver a 'static' ip which would still be visible to the rest of the LAN.?

Is it enough to change the appropiate files in /etc/rc.d/?
 
Old 11-28-2005, 03:35 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114Reputation: 8114
This would do (put it in /etc/rc.d/rc.inet1.conf):
Code:
# Config information for eth0:
IPADDR[0]="192.168.0.100"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

....

# Default gateway IP address:
GATEWAY="192.168.0.XXX"
Where the XXX is the IP of your router/gateway.
If your server uses eth1 instead, change the [0] into [1]. Don't forget to remove the existing DHCP related lines for your network interface (the USE_DHCP[0]="yes" specifically)

Eric
 
Old 11-28-2005, 03:43 PM   #3
mikz
Member
 
Registered: Sep 2004
Distribution: Slackware current
Posts: 109

Original Poster
Rep: Reputation: 15
Would I also need to edit /etc/resolv.conf?
 
Old 11-28-2005, 04:17 PM   #4
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
Quote:
Originally posted by mikz
Would I also need to edit /etc/resolv.conf?
don't think so, that one is for your DNS servers
 
Old 11-28-2005, 04:30 PM   #5
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
It is also possible you assign a static IP address by DHCP adding some lines to your /etc/dhcp/dhcp.conf like


host myhost {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 192.168.0.100;
}

replace xx's with your actual HW address
edit your /etc/hosts file adding something like
192.168.0.100 myhost.mynet.org myhost
Ciao
 
  


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
Setting up a static I.P. address partyk1d24 Linux - Networking 13 12-29-2005 06:23 AM
How to set a static IP address? dx0r515t Slackware 12 04-17-2005 01:33 PM
setup the static ip address hansi umayangan SUSE / openSUSE 1 04-04-2005 02:54 AM
Getting static IP address etc. chapzilla Linux - Newbie 2 06-16-2003 11:40 AM
Static IP Address bytebrowser Linux - Networking 14 06-16-2003 06:36 AM

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

All times are GMT -5. The time now is 08:45 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