Click to See Complete Forum and Search --> : Slackware - netconfig - can connect in intranet but not internet


Cerf
09-02-2004, 04:31 PM
Hey,

I just finished reading the networking section of the online slackware book and I ran the netconfig command and it went smoothly much to my satisfaction. I can connect to my hub via http://192.168.1.1 but I cannont connect to the internet with slackware (eg www.justlinux.com)

Does anyone know where I can go to find out how to configure this? Did I make a mistake somewhere? Can I get the configure files from my FC2 partition? And once I'm done, how can I backup the config files?

JohnT
09-02-2004, 04:39 PM
How do you connect? ADSL, Cable....? What does the command "route" show?

Daedrus
09-02-2004, 04:45 PM
Only thing i can think of is that the Default Gateway is not set. run route as JT said and look at the last line, should be default and an address under Gateway. It there isn't one there, you need to set one.

route add default gw 192.168.1.1

Cerf
09-02-2004, 04:57 PM
Originally posted by JohnT
How do you connect? ADSL, Cable....? What does the command "route" show?

O ya, that would be something that you might need to know to be able to help me.

I connect via ethernet to a switch that connects to a hub that connects to a cable modem that connects to some coax and dissappears into my frount lawn.

And the result of rout is

[root@localhost]#rout
Destination Gateway Genmask Flags Metric Ref Use lface
loopback * 255.0.0.0 U 0 0 0 lo

Daedrus
09-02-2004, 05:14 PM
Looks like you are missing your default gateway. See my previous post for the command for adding the gw.

Cerf
09-02-2004, 05:24 PM
I made an attempt


root@localhost~]#route add default gw 192.168.1.1
SIOCADDRT: Network is unreachable


Does this mean that I have to configure my network card??

I would do an ipconfig -a an see if eth0 but it give me an unknown command error and when I do a whereis ipconfig the respsonse is just "ipconfig:"

JohnT
09-02-2004, 05:36 PM
"ifconfig":p (to see your setup)

Cerf
09-02-2004, 06:08 PM
I made a development

#if config eth0 192.168.1.1 netmask 225.225.225.0
#route add default gw 192.168.1.1

and no errors

So what I did after that was go into gnome and startup mozilla. Now it can no longer connect to 192.168.1.1 nor can it connect to the outside world

When I typed om the route command I made a type, I dont know if that affected the outcome but now the results of route is


192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
loopback #......you know this already
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0


I tried to remove the line starting with 192.168.1.0 with the command route del 192.168.1.0 but it didnt work, it just said that its the improperway to use that function and use a different program (which I dont have)

Daedrus
09-03-2004, 12:29 PM
Was your network settings originally static or set via DHCP?

PNash
09-03-2004, 12:52 PM
Ok, if I am reading your last post correctly it looks like your ip address and the default gateway address are the same. That is why you cannot get to http://192.168.1.1 anymore, change your computer ip address to something else (and it cannot be 192.168.1.0, this is a broadcast address), make it like 192.168.1.10 or whatever. If your ip address is set, then you set your default gateway to 192.168.1.1 and have the dns servers configured correctly from your ISP then there is no reason you shouldnt be able to get out to the internet.

Daedrus
09-03-2004, 01:32 PM
Nice catch PNash. I look right past that.

Cerf
09-03-2004, 09:46 PM
The ip address is assigned by the hub so its static (right?)

Dancen
09-03-2004, 10:31 PM
This was one of the things I was able to configure in Slack 10. I'm new so I don't know how appropriate this method is. It's just kind of jury-rigging your internet connection with a static IP, so it's probably not the best solution. Anyway here's how I did it, it may/may not work for you:

I had a WindowsXP partition that could connect fine, so I did Start -> Run and put in "cmd". From there I did "ipconfig /all" and took note of the Host Name, Connection-Specific DNS Suffix, IP address, Subnet Mask, and the first entry in the DNS Servers list.

In Slack, I did "netconfig" and set it up as a static IP, even though I'm thinking it should be DHCP (hence the non-optimal solution). I put in the hostname found, comcast.net for the domain, 192.168.0.1 for the gateway, 192.168.0.3 for my IP, and the first entry in the DNS Servers list (from ipconfig /all in Windows) for the name server. Also, I put in 255.255.255.0 for the subnet mask part (it should actually suggest that in the instructions).

So, depending on your setup you may or may not be able to find out that info. If one of the other computers on the network has Windows you can take all that info from there instead (except the IP of course). You'll probably end up using 192.168.1.1 for the gateway, and 192.168.1.3 or something similar for your IP. I don't know how to do it any other way, so hopefully there's a Windows machine on your network (did I just say that?? :p).

There's probably someone who has a much better way to do this by actually using DHCP, I just couldn't figure it out for the life of me. Unless, of course this method is appropriate and the router itself doesn't dynamically assign IPs (like you were wondering), which is also a possibility. Anyhow, hope this helps :)

Cerf
09-03-2004, 11:20 PM
thanks for the help but unfortunatly it didnt work, does anyone have any other suggestions?

Daedrus
09-04-2004, 10:22 AM
Addresses assigned by the hub (router is a better term) is dynamic, meaning the next time you turn on your system it could receive a different IP address (although unlikely) Once you start creating IP addresses yourself (via ifconfig add) it is not longer dynamic, but static.

Try this: run netconfig again and there should be an option for to obtain ip settings through dhcp. Once you do that, run ifconfig and route and tell us what the results are. You might want to remove all of your route info other than the loopback before setting your self to dhcp.

My results: (I have a router that gives out ip info)

route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

ifconfig:
eth0 Link encap:Ethernet HWaddr 00:03:47:1F:53:7D
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::203:47ff:fe1f:537d/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1571 errors:0 dropped:0 overruns:0 frame:0
TX packets:1544 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1512969 (1.4 Mb) TX bytes:269795 (263.4 Kb)

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:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:100 (100.0 b) TX bytes:100 (100.0 b)

Cerf
09-04-2004, 12:05 PM
So what I did was go into my router and set the host name to cr962097-a and the domain name to localdomain

then to netconfig
hostname gusjhg81uduy
domainname localdomain
use DHCP
DHCP hostname cr962097-a

the output of route
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

theoutput of ifconfig eth0
etg0 linkcap: Ethernet HWaddr 00:E0:18E35:28:BC
inet addr: 192.168.1.101 Bcast 192.168.1.255 Mash 255.255.255.0
RX packets: 856 errors: 0 droped: 0 overruns: 0 frame: 0
collisions: 0 txqueuelen: 1000
RX bytes: 95728 (93.4kb) TX bytes: 52589 (51.3 kb)
Interrupt: 9 base address: 0xd000

and I can successfully connect to http://192.168.1.1 and successfully ping 192.168.1.1, 192.168.1.100, and 192.168.1.101 (me?)

Cerf
09-04-2004, 06:19 PM
Just a thought while I'm trying to get this working (I'm still going no where fast), but I have fedora core 2 on another partition and its internet connection is fine. Is there a configure file that I can just copy over to slack ware?

<edit> When I installed Slackware I used the default kernel, does this kernel actually support the use of gateways and what not. Should I recompile the kernel using this (http://www.ictp.trieste.it/~radionet/1999_school/LABORATORY/NETWORKING/LINUX-INTRO/html/network-config.html) HOWTO??

Daedrus
09-04-2004, 08:24 PM
Okay, at this point your settings look fine at least for IP address. We need to try and find you an IP address outside of your network to ping. If you can ping the address fine, but not the UNC name then it could be your DNS resolution isn't working correctly.

Try pinging 66.215.167.24. That is my current external IP on my router.

BTW what cable/DSL router do you have?

Cerf
09-04-2004, 08:55 PM
Ping 66.215.24 - %100 packet loss

The router I'm useing the BEFSR41 (http://www.linksys.com/products/product.asp?grid=34&scid=29&prid=561)

<edit> I found my IP address 64.143.72.49 and I was able to successfully ping it. So, I'm assuming that the packet was leaving my network going out to the internet and then back to me. I'm going to ping another address and see what I get

<edit> I was successfully able to ping 64.68.82.30, I think that it's one of my ISP's machines

Cerf
09-04-2004, 09:25 PM
I DID IT

I dont know exactly what I did that finally caused it. After pinging 64.68.82.30 I rebooted. Then after searching to see what I had to do to fix the DNS resolution problem I learned of the /etc/resolv.conf file.

Booting into FC2 I wrote down the file. Then rebooting into slackware I proceded to edit that file seeing that it was already populated

nameserver 24.153.23.66
nameserver 24.153.23.195
search localdomain


Then I proceded to change resolv.conf to look exactly the same as FC2's resolv.conf


search localdomain
nameserver 24.153.23.66
nameserver 24.153.23.195


mabie it was the reboot that did it. Mabie editing the file. (if you could explain it too me I would apreaceate it) All I know is that is working now

THANKS FOR ALL YOUR HELP

Daedrus
09-05-2004, 11:41 AM
Congratulations!

I doubt it was the restart, but maybe it just restarted a particular service that needed to be restarted. The since the resolv.conf already had the same information that the FC2 files had, but in a different order, the only thing you did was change the order in which it looks for DNS information.

I looked through the man page for resolv.conf and it looks like the search command would have to be the first line in the file otherwise it wouldn't completely understand what the nameserver lines were. Search basically gives the list of host-lookup servers to try, in order.

Cerf
09-05-2004, 12:20 PM
Thanks for all your help

JohnT
09-05-2004, 01:09 PM
Glad you got it running.
Sorry didn't get back, been out for some time, but here's a link to a DHCPD setup you might be able to use in the future. The client comes with Slack since this article was printed.

http://www.faqs.org/docs/Linux-mini/DHCP.html