SlackwareThis Forum is for the discussion of Slackware Linux.
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.
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.
my network freaked out, and setting a static ip with ifconfig would say that my ip changed to the ip i assigned, but after that it would not access the net. i would specifically like to have the computer keep its static ip after reboots.
i plan on bringing my linux server to a friends to share files, and would like to be able to point directly at the server, without guessing its ip address. thanks!
You can set your IP with netconfig or editing /etc/rc.d/rc.inet1.conf
Just fill in the values for IPADDR / NETMASK for your network card and leave USE_DHCP empty.
You're not explaining your problem very well. Setting a static IP is trivial (once you know what configuration files to edit). However, being able to access the internet depends on a number of things including correct subnet and netmask settings, correct routing information and an available Domain Name Service.
So - you need to tell us more about how you're set up and what you want to do.
You could setup a static IP by doing as root from cli;
Code:
~#ifconfig -a #get recognized devices
~#ifconfig wlan0 192.168.0.10 #set to a available IP
~#route add default gw 192.168.0.1 #set to your gateway
~#route -n #show the route table
~#ifconfig wlan0 up #should be up already
~#ping 192.168.0.1 #ping your gateway
~#ping 208.69.32.130 #google.com IP
~#ping google.com #test DNS, if fail then
#check /etc/resolv.conf
You should have your '/etc/resolv.conf' setup with your 'ISP DNS' nameservers.
Code:
sample '/etc/resolv.conf';
search 192.168.1.1 #this would be your local dns/router
nameserver xxx.xxx.xxx.xxx #ISP DSN 'replace xxx.xxx.xxx.xxx
#with IP from your ISP
nameserver 4.2.2.1 #Verizon third level DNS
nameserver 4.2.2.2
nameserver 4.2.2.3
nameserver 4.2.2.4
If this works for you then setup your '/etc/rc.d/rc.inet1.conf' with the information. I used the wlan0 device but the same would be true for the eth0 device.
Last edited by onebuck; 11-19-2008 at 08:10 AM.
Reason: to show local dns for OP
While you're at it, you could start surfing via OpenDNS, in your /etc/resolv.conf, you just have to add their nameservers and put them at the top, like this:
Just another suggestion re using your machine in different locations:
Quote:
i plan on bringing my linux server to a friends to share files, and would like to be able to point directly at the server, without guessing its ip address. thanks!
I use my laptop at several locations with static IP required at each place. I have several versions of all the relevant files and once the machine has booted I move the appropriate files into place using the following simple script.
Code:
#!/bin/bash
#
#sn: setup network script
#
#usage: sn <location>
#
echo "Setting up network for : "$1
cp /etc/resolv.conf.$1 /etc/resolv.conf
cp /etc/hosts.$1 /etc/hosts
cp /etc/rc.d/rc.inet1.conf.$1 /etc/rc.d/rc.inet1.conf
/etc/rc.d/rc.inet1 restart
export LOCATION=$1
echo "Location is: " $LOCATION
For example to start work at 'uq' I execute 'sn uq' and 'resolv.conf.uq' is moved into resolv.conf etc etc.
I guess there are smarter ways to work this out automatically, but this manual approach is rock solid.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.