LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Static ip prob in slackware 12.2 (http://www.linuxquestions.org/questions/slackware-14/static-ip-prob-in-slackware-12-2-a-703857/)

netpumber 02-11-2009 07:22 AM

Static ip prob in slackware 12.2
 
Hi!! When im gonna change the /etc/rc.d/inet1.conf file in to this
Code:

# Config information for eth0:
IPADDR[0]="192.168.1.101"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"
DHCP_HOSTNAME[0]=""
GATEWAY="192.168.1.1"

It can't connect into the net... And when i turn it in dhcp all are ok..:s Any help or idea?

GazL 02-11-2009 07:31 AM

You probably need to add a nameserver to /etc/resolv.conf. dhcpd normally does this for you. If you're using static addresses you'll have to put your own in.

SkinnerC 02-11-2009 07:52 AM

Quote:

Originally Posted by GazL (Post 3439601)
You probably need to add a nameserver to /etc/resolv.conf. dhcpd normally does this for you. If you're using static addresses you'll have to put your own in.

You can add the gateway as your nameserver. I assume you have a Linksys router that is connected to a modem. The router will act as your nameserver and forward requests to the ISP nameserver.

netpumber 02-11-2009 09:46 AM

SkinnerC can you be more specific ? I have put and in the resolve file the name servers but nothing happens...Thanx..

arubin 02-11-2009 10:20 AM

An easy way to do this is to run netconfig as root.

You may then have to restart networking to get it working.

GazL 02-11-2009 10:35 AM

Can you show us the output of:

cat /etc/resolv.conf

/sbin/ifconfig

/sbin/route -n

Please wrap the output in "code tags" to make it more readable when you post it on LQ.

netpumber 02-11-2009 11:07 AM

Code:

# Generated by dhcpcd for interface eth0
nameserver 194.219.227.1
nameserver 193.92.150.3

Code:

eth0      Link encap:Ethernet  HWaddr 00:13:d4:c6:4f:04
          inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::213:d4ff:fec6:4f04/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22968 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18954 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29066405 (27.7 MiB)  TX bytes:2203437 (2.1 MiB)
          Interrupt:23 Base address:0xa400

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)

Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.1.0    0.0.0.0        255.255.255.0  U    0      0        0 eth0
127.0.0.0      0.0.0.0        255.0.0.0      U    0      0        0 lo
0.0.0.0        192.168.1.1    0.0.0.0        UG    0      0        0 eth0


Quote:

An easy way to do this is to run netconfig as root.

You may then have to restart networking to get it working.
I had tried it but nothing happened..:s

SkinnerC 02-11-2009 11:13 AM

Where did the nameserver info come from? Is that the ISP nameservers? If so then try to replace them with your router address and see if that clears it.

The router is connecting as DHCP to the ISP but has to have the DHCP server for your internal network turned off.

netpumber 02-11-2009 11:21 AM

Yes these nameservers are from my isp...i ll change it in a while cuz now i have lesson :p ;) Thanx a lot :)

GazL 02-11-2009 11:24 AM

You've given the host .101 in your inet1.conf file above, but the interface has an address of .104.
Have you left the old dhcpcd daemon running? If so you might want to kill it and then try running /etc/rc.d/rc.inet1 restart.

I'd be inclined to reboot myself just to make sure everything has been cleared out. Not strictly necessary, but at least you know its all good from that point on. Next step would be to check you can ping your gateway and nameservers

ping -c1 192.168.1.1
ping -c1 194.219.227.1
ping -c1 193.92.150.3

and if they work ok, check dns resolution is working with something like

host -r www.google.com

... but before you do those, It'd be an idea to get that inconsisten IP address on eth0 sorted first.

netpumber 02-13-2009 09:25 AM

So...in /etc/resolv.conf i add my router's ip
Quote:

# Generated by dhcpcd for interface eth0
nameserver 192.168.1.1
nameserver 192.168.1.1
and this in rc.inet1.conf


Quote:

# Config information for eth0:
IPADDR[0]="192.168.1.101"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"
DHCP_HOSTNAME[0]=""
GATEWAY="192.168.1.1"
Quote:

ping www.google.com
connect: Network is unreachable
OMG .. something is not going right :s

urka58 02-14-2009 12:54 PM

This is an excerpt from /etc/rc.d/rc.inet1.conf
Code:

# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").

Have you tried that?

slaggy 02-15-2009 08:44 AM

what about:
Code:

# ifconfig -a
do you have more than one ethernet card?


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