LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Need help with basic networking (https://www.linuxquestions.org/questions/linux-networking-3/need-help-with-basic-networking-17548/)

Korshun 04-02-2002 08:04 AM

Need help with basic networking
 
Hi all,

I'm a Linux newbie trying to get the network running on my Linux box... the way I see it is that right now the network doesn't work at all - it's not a question of whether I can connect to a certain machine or whatever. Feel free to correct me if I'm wrong, though... I can't even access the local network from Konqueror (I'm using the KDE interface by the way...) - I just get an error saying "could not connect to host localhost"

From the technical side of things, I have Red Hat 7.2 and my network card is a Realtek RTL8139. Linux detected it during set up and I *think* it's installed correctly (I don't even know how to check...) Now when I enter network configuration in KDE, I can edit the TCP/IP settings for the network card (set IP, subnet mask, gateway, set the name of the host, doman, etc) but after I do this, my internet connection stops working. This is after changing NETWORK not modem settings, so it really puzzles me... do I really need to edit these TCP/IP settings and why?

As I said before, I'm a Linux newbie (hasn't even been a week yet) so I may have missed the point completely... if that's the case, then are there any walkthroughs written for setting up a network in Linux from the ground up using the KDE interface?

So... ideas, anyone?
Thanks in advance...
Korshun

jimval7 04-02-2002 09:28 AM

ifconfig -a
 
do a "ifconfig -a" and report the output in here. ifconfig will show you your network settings and other information. Post back the info here so we can see if your system even sees your NIC.

Korshun 04-03-2002 12:43 AM

ifconfig results
 
Hi,

This is the output when I run "ifconfig -a":

---

eth0 Link encap:Ethernet HWaddr 00:20:18:8D:8C:8D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:9 Base address:0xd000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:389 errors:0 dropped:0 overruns:0 frame:0
TX packets:389 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:32618 (31.8 Kb) TX bytes:32618 (31.8 Kb)

---

The bit above was run when I was offline... if I connect to my ISP and then run it, the output is:

---

eth0 Link encap:Ethernet HWaddr 00:20:18:8D:8C:8D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:9 Base address:0xd000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:232 errors:0 dropped:0 overruns:0 frame:0
TX packets:232 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15328 (14.9 Kb) TX bytes:15328 (14.9 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:63.12.1.73 P-t-P:63.12.31.225 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1524 Metric:1
RX packets:1124 errors:0 dropped:0 overruns:0 frame:0
TX packets:1350 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:683322 (667.3 Kb) TX bytes:204610 (199.8 Kb)

---

Hope this means something to you people :). The last bit may have been irrelevant but... hey, too much information isn't that bad in this case.

Korshun.

Mik 04-03-2002 05:34 AM

Well the ppp0 is the modem interface which is configured correctly. The lo interface is the local loopback interface which also seems to be configured properly. Strange that you can't even connect to localhost in KDE because that should at least be working. The eth0 interface is your network card which is not configured properly. The fact that it's recognized means you are most likely using the right drivers so you don't have to worry about that. It doesn't have an ip address however so you'll never be able to reach that interface.
You said you found out where to set the network settings so I would set only the IP, Subnet Mask and Gateway. The rest I would leave alone for the moment. Make sure you choose a private ip address something in the 192.168.x.x range for example. After you've got the card up with an ip address then you should be able to ping other machines on that network. Changing just those settings shouldn't affect your internet connection. When you run the route command you should see how all the traffic is going.

You should have a default entry which is pointing to your internet gateway and going through the ppp0 interface. All the traffic going to 192.168.0.x should be going through the eth0 interface. This ofcourse depends on the ip and mask you use.

Korshun 04-03-2002 06:29 AM

What about hosts? And other stuff...
 
Thanks for your reply, Mik...

As you people can probably see now, I'm not that flash with networks, but I have yet another question to ask: I can set the IP settings, but should I enter anything at the hosts window? Currently I have localhost at 127.0.0.1 there (that's to keep the printer working, otherwise it b*tches about not being able to find the localhost IP. Dunno why, just does...)

I tried setting IP values before, explicitly making sure that those values are the only ones I enter... I used:

IP: 193.195.90.55
Subnet Mask: 255.255.255.0
Gateway: 193.195.90.100

I got these values from my Windows set-up... dunno how they got there in the first place, but the network works in Windows. When I entered these values for Linux though, my internet connection got screwed up. I connect, but no data is transferred. I'm running Windows atm so I can't try the values you gave me just now, but I'll boot up Linux later on and check it out.

Now for the actual settings - you told me about the IP values, but are there any specific values for subnet mask and gateway that I should enter? Or are the ones I used before (see above) sufficient?

And I didn't really understand a thing you said in the last paragraph... Went straight over my head :( Sorry... Could you explain it in a bit more detail? I mean the bit about having a default entry pointing to an internet gateway.

I think that is enough questions for now... I'll write back here after I try the settings in Linux.

Korshun

hanzerik 04-03-2002 06:43 AM

In your /etc/hosts make sure you have:
127.0.0.1 localhost.localdomain localhost
193.195.90.55 <full host domain name> <hostname>

mine looks like:
192.168.1.110 hanzerik.dyndns.org hanzerik

You say you are putting the values in manually, are you also putting in the IP's of your DNS name servers?

try to ping your NIC: ping 193.195.90.55 , BTW hit ctrl+c to stop pinging.

And you didnt say whether you were using a router or not, are you?

Korshun 04-03-2002 07:08 AM

Ummm
 
Hanzerik,

I've edited /etc/hosts manually, so I guess I haven't added the IPs of the DNS name servers, but more importantly than that - I don't even know what they are :( I'm guessing that I can do that in the Network Configuration / DNS window in KDE, right?

Also, I have no idea what a router is either ... so any light on this matter shall also be appreciated... I'll try the IP settings you mentioned the next time I boot up Linux...

Thanks again.
Korshun:confused:

Mik 04-03-2002 07:25 AM

193.195.90.55 is a public ip address. I doubt you own it so I don't think it would be wise to be using it in your private network. It will work but since you've got a netmask of 255.255.255.0, every ip address in the range 193.195.90.XXX will not be reachable. Might be blocking out a lot of things which aren't necessary. You should also change this in windows because the same problem counts for both linux and windows.

I suggest you use something in the private ip range. If you want something similar you could use the 192.168.90.0 network. If you use a subnet of 255.255.255.0 then you can give your first computer the ip address 192.168.90.1 and the second 192.168.90.2 etc....

Your printer is only one of the things that will complain if you don't leave the localhost there. So leave the localhost entry and just add another entry for the ip of each machine with it's corresponding name (Like hanzerik suggested).

If you are using an ip of 192.168.90.1 with a subnet of 255.255.255.0 then your gateway address would be 192.168.90.255. Usually an ip and a subnet is enough because the gateway address can be calculated from those two. But linux allows you to enter it manually. The gateway address which you are using here is not the same as the default gateway. I've never really used those gui's to set everything up so if it's asking for the default gateway then don't enter that number there (the default gateway should already have been set up)

If you follow the above example then every ip in the range 192.168.90.XXX will go through eth0 and see if it can find the appropiate machine there. Anything else like an internet ip will have to go towards the internet. When you setup your internet connection it should have configured a default gateway for you. So your computer knows where to send all the other traffic to. Since your internet connection is fine you don't really have to worry about that part. I just mentioned it in case you where changing the default gateway while setting up your eth0 interface. If you do that then you would stop your internet connection from working.

Hope that makes it a little more clear.

Korshun 04-03-2002 08:22 AM

Some progress...
 
OK, I feel like I might be getting somewhere...

I pinged the card (192.168.90.1) and it worked when:

Network TCP/IP configuration screen:

IP address : 192.168.90.1
Subnet mask : 255.255.255.0
Gateway : 192.168.90.255

hosts tab:

127.0.0.1 localhost.localdomain localhost
192.168.90.1 zenit.home zenit

DNS tab:

hostname: zenit
Primary DNS: 210.80.28.42
Secondary DNS: 210.80.58.34

Now I don't know where these DNS numbers are from, but I think they got there after I added
all that stuff to the /etc/sysconfig/network (below)

In /etc/sysconfig/network I also had to add:

NETWORKING=yes
HOSTNAME=zenit

GATEWAY="193.195.90.100"
GATEWAYDEV=eth0

GATEWAY="0.0.0.0"
GATEWAYDEV=ppp0

---

Before I added it just had:

---

NETWORKING=yes
HOSTNAME=

---

Got the bit above from another post at this forum. Without this part, the connection to the
internet would simply be dead - it connects, but data is not transferred :(

Didn't work thru KDE/Network/Local Network though...

Same old error: "Could not connect to host localhost"

Thing I don't get is - why does it try to connect to localhost? And not zenit?

I also thought it might be a good idea to use ifconfig -a again, and put the output here
in case something important pops up.

---

eth0 Link encap:Ethernet HWaddr 00:20:18:8D:8C:8D
inet addr:192.168.90.1 Bcast:192.168.90.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:240 (240.0 b)
Interrupt:9 Base address:0xd000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:206 errors:0 dropped:0 overruns:0 frame:0
TX packets:206 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:13626 (13.3 Kb) TX bytes:13626 (13.3 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:63.34.224.142 P-t-P:63.12.31.206 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1524 Metric:1
RX packets:205 errors:0 dropped:0 overruns:0 frame:0
TX packets:249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:105262 (102.7 Kb) TX bytes:30740 (30.0 Kb)
---

What should I do next?

Korshun.

Mik 04-03-2002 09:03 AM

Well first of all you should remove the lines:
GATEWAY="193.195.90.100"
GATEWAYDEV=eth0

It doesn't really make a difference but they are overwritten with the next two lines which are fine. So it's just confusing leaving them in there.

I don't use KDE so I don't know anything about the KDE network thing you are trying to access. Can you ping other computers on the network. Presuming they are also set to use an IP = 192.168.0.XXX with netmask = 255.255.255.0
If you can then you have your network setup properly. You can then move on to the next step. But maybe someone else will have to help you with that.

Korshun 04-03-2002 05:28 PM

OK, it works.
 
I just pinged one of the computers on the network, it works. Right now I am connected to the net using the other computer as a proxy. Thanks to everyone for their help - I really appreciate it.

The down side to all of this is that Konqueror, KDE's file browser, still refuses to look at the network. It still b*tches about
"not able to connect to host localhost." I don't really care about Konqueror, just as long as the network is working, but what else can I use to browse the network? Say if I want to get some files from another computer or something?

And another thing - the other comp on the network is a Windows box... so I suppose I need to set up Samba or somethingorother... Anyone know if there's anything else I need to do?

Thanks again people.
Korshun

hanzerik 04-03-2002 07:37 PM

LinNeighborhood: http://www.bnro.de/~schmidjo/

That may be what your looking for


All times are GMT -5. The time now is 12:32 PM.