LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   how to setting a static ip address on slackware64 13 (http://www.linuxquestions.org/questions/slackware-14/how-to-setting-a-static-ip-address-on-slackware64-13-a-805130/)

wubai 04-30-2010 05:19 AM

how to setting a static ip address on slackware64 13
 
Hi,all !

I tried to setting a static ip from dhcp, I changed lines in /etc/rc.d/rc.inet1.conf as follow:

# Config information for eth0:

#IPADDR[0]=""
IPADDR[0]="192.168.18.7"
#NETMASK[0]=""
NETMASK[0]="255.255.255.0"
#USE_DHCP[0]="yes"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

and then I run "/etc/rc.d/rc.inet1 restart"

after that, can't access net, and couldn't ping the gateway[192.168.18.1], I have to change it back, anybody can help me ?

stureedy 04-30-2010 05:29 AM

It sounds to me like your default route is not getting set correctly. Did you set the gateway in /etc/rc.d/rc.inet1.conf?

GATEWAY="192.168.18.1"

What error--if any--do you get from ping?

What output to you get from the command route?

Regards,
Stu...

ROXR 04-30-2010 05:38 AM

Yo can use in root mode #netconfig

..or configure with ifconfig

Code:

ifconfig eth0 192.168.X.X netmask 255.255.255.0 up
route add default gw 192.168.X.X eth0  # gateway, router ip


wubai 04-30-2010 06:22 AM

Quote:

Originally Posted by ROXR (Post 3952802)

Code:

ifconfig eth0 192.168.X.X netmask 255.255.255.0 up
route add default gw 192.168.X.X eth0  # gateway, router ip


@ROXR ,I follwed above , and it works !

btw, I checked rc.inet1 nad rc.inet1.conf, nothing changed, then which file does "ifconfig..." write into ?

thanks again , all of you !

:) :) :)

bgeddy 04-30-2010 06:33 AM

Quote:

btw, I checked rc.inet1 nad rc.inet1.conf, nothing changed, then which file does "ifconfig..." write into ?
It doesn't. The fix you have done is temporary and you should do this:
Quote:

Yo can use in root mode #netconfig
to make it permanent. That is run this from your command line :
Code:

su -c "netconfig"
and enter the necessary information. This will update rc.inet1.conf.

wubai 11-12-2012 07:21 PM

Thank you all ! appreciate !


All times are GMT -5. The time now is 12:54 AM.