Setting up local network
Hi,
I'm trying to set up a local network between one computer running on Debian Etch and another on Ubuntu Dapper. This should be easy enough to do, but neither computer sees the other. Here is the procedure I followed, did I miss something? In the Debian machine I did system --> networking and changed the properties on eth0 to the following: Configuration: static IP address: 192.168.0.1 Subnet mask: 255.255.255.0 I validated this and then set up the Ubuntu machine as follows: Configuration: static IP address: 192.168.0.2 Subnet mask: 255.255.255.0 Gateway address: 192.168.0.1 When I do a ping on the Debian machine towards the Ubuntu machine, this is what I get: Code:
james@debian:~$ ping -c5 192.168.0.2 Code:
debian:/home/james# ifconfig I don't know if this is of importance, but when the Debian computer boots in verbose mode, I get a message that DHPDISCOVER is looking at eth1 on 255.255.255.255 on various ports, and fails to find anything. Shouldn't it look on 255.255.255.0? Incidentally, I don't know if this is of importance but before I attempted to set up the network, I got the same message, but rather than looking at eth1 it looked at eth0. Perhaps I should add that I had managed to establish this connection when both computers were Windows, and I also managed it between Windows and Linux, but since I got rid of Windows I have never been able to connect these two computers. This problem seems very simple to me, but I haven't found a solution to it by Googling around or by looking at the previous threads on this forum. Thanks in advance for your help James |
might I suggest running iptables -L on both machines to see if a firewall is enabled ?
The following shows output on a system with no firewall rules configured.. Code:
it-etch:/usr/src/linux# iptables -L While there is practically ZERO traffic over eth0 (192.168.0.1) RX bytes: (0.0 b) TX bytes: (11.8 KiB) It's hard for me to guess how you have everything connected.. how are the PC's in the 192.168.0.0 subnet connected together ? Via a switch, crossover cable, other ? |
hey,
Firstly the DHPDISCOVER problem shouldn't matter, as you have no DHCP server and you are using static ip addresses. What happens when you ping the Ubuntu machine towards the Debian machine? Do you have a firewall that is blocking the packets? |
OK, here's what I get when I do iptables -L on the Debian machine:
Code:
Chain INPUT (policy ACCEPT) As for the ping command on the Ubuntu machine, this is what I get: Code:
james@james1:~$ ping -c5 192.168.0.1 The two computers are simply connected via a crossover lead. As for DHCPDISCOVER, if it's not needed, is there a way of stopping Debian from looking for it on boot up? It at least doubles the start up time. |
Just spotted something else that is interesting...
Quote:
do you truly have 3 ethernet cards in that machine ? lspci to verify the number of NIC's cat /var/log/dmesg | grep eth - see what eth device is assigned to what hardware |
I'll tell you the whole story! I had a few problems when I was installing Debian, as it asked me questions I found difficult to answer about the network. I'm not sure I got them all right as I'm very weak in this area. Also, I had a funny business with the Internet connection not coming on automatically on start up. I played around with it for a while until I got it working. Perhaps I made a mess of everything - it wouldn't be the first time!
As for the Ethernet card business, this has always struck me as odd. As far as I know, there are only two Ethernet cards in this machine. Well, there were last time I looked! But where on earth does eth2 come from? And Debian isn't alone in flagging up eth2 - I also had it on Mandriva and, I think the other distros I've tried on this machine. |
So did you run the commands I posted ? the results may contain the answers you seek....
|
My apologies, farslayer, I didn't see your commands at the bottom of your post. Guess that's what comes of my doing too many things at once. Well, here's the Ispci command. I don't know what it all means!
Quote:
Code:
debian:/home/james# cat /var/log/dmesg | grep eth |
Quote:
Looks like mine when I put my Wireless in monitor mode. Could it be firewire, bluetooth, usb? |
Quote:
|
From the LSPCI command these are your two onboar Ethernet controllers..
Quote:
Quote:
I'm not sure why it's listing eth0 next to a Realtec chip AND the firewire entry.. It looks like your REAL Network interfaces are eth1 and eth2 and the Firewire has taken over the eth0 Position. You may want to edit your /etc/network/interfaces file and see how that goes.. maybe something like this.. Code:
it-etch:/usr/src/linux# cat /etc/network/interfaces |
Right, now I've got another problem. I cannot run the text editor:
debian:/home/james# cp /etc/network/interfaces /etc/network/interfaces.backup debian:/home/james# kedit /etc/network/interfaces Xlib: connection to ":0.0" refused by server Xlib: No protocol specified kedit: cannot connect to X server :0.0 debian:/home/james# kate /etc/network/interfaces Xlib: connection to ":0.0" refused by server Xlib: No protocol specified kate: cannot connect to X server :0.0 What's going on here? |
Install package: "sux" and then sux kate blah.txt
Or use "sudo" and then sudo kate blah.txt |
OK, panic over. I downloaded sux and then ran xhost local:root. Now to work...
Before I change anything, I'd like you to see what's in /etc/network/interfaces. Does it look right? Quote:
|
Nein, not good. Eth0 is your firewire!
eth1 and eth2 are your ethernet wire interfaces (you don't need the xhost for sux, otherwise sux becomes useless) |
OK, so does this mean that whereas I have been trying to communicate to the second computer via eth0 I should have configured eth2? It sounds like this, but experience has taught me to check with the experts in cases like these before I do anything!
|
Use the interfaces file I posted earlier... it should work for you.
(Since you already made a backup of your original file.. Way to go !! :) ) Or just edit the eth1 portion of yours and remove the IP info from eth0 |
Quote:
|
OK, this is getting very seriously on my nerves! :mad: I need help here! For some reason, I no longer have an Internet connection. I'm writing this from a Knoppix live cd, so it shouldn't be a hardware issue. I can only imagine that it has something to do with a manipulation that I did yesterday. As I told you everything I did, perhaps someone can see what's gone wrong. Usually when I have this problem, after first installing a Linux distro, I solve it by simply playing around with disabling then re-enabling the various listed Ethernet cards in various orders, then cold re-starting the computer. This usually works, after a while, but this time it doesn't. Here are some things that might be important:
1) The DNS address part in the network configuration tool is empty. When I fill it (I took the pains of noting it yesterday!) it is empty again after re-boot. Before re-boot, I can re-run the network tool and the address is still there, but restarting the computer wipes it clean. 2) DHCPDISCOVER now looks at eth1, whereas it didn't before yesterday. I did notice when I had just installed Debian that when it did this the Internet wouldn't start, but maybe that was just a coincidence. Thanks for your help, once again. James |
That was a very close call! Good job I made that backup! I've just tried changing the interfaces file - I copied what you posted, farslayer, and pasted it into /etc/network/interfaces, replacing the text that was previously there, in the hope that that would sort out the Internet problem I wrote about above. Well, had I not made that backup, I would probably now be sitting in front of the computer screen re-installing Debian!
Here's what happened. After editing the file, I cold started the computer and I got this message: Code:
Configuring network interfaces.../etc/network/interfaces:|: misplaced option ifup: couldn't read interfaces file "/etc/network/interfaces". I really don't know what happened there! Great! It's the evening of the French National holiday, fireworks are whizzing over my roof, and I'm stuck here at my computer! Still, I am English I suppose! |
Something must not have been right when you pasted the info.. Misplaced line feed, or something goofy.
you could try manually typing the settings for the other interface into your configuration. |
Great! I've sorted out the Internet problem, and as a bonus the DHCPDISOVER issue too. I wondered whether enabling hot-plugging could be a solution, so I thought about a distribution that has good hardware detection, Knoppix was an obvious choice. I simply copied the etc/network/interfaces file from the Knoppix live cd and pasted it into etc/network in Debian. This worked a dream, and also disabled the DHCPDISCOVER process on boot up. Perfect! :D
But the local network problem remains. When I try to change eth2 to give it a static IP (192.168.0.1) the Internet comes down. Can you tell me what I need to change in the interfaces files? I say files plural because there are two in Knoppix. Here they are: 1) This one is etc/network/interfaces: Code:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) Quote:
|
Quote:
ifconfig -a route -n If you use these informations for static config, then there's no reason to not work. There's no firewall or no security on the dhcp server? |
OK, if I understand you right, you mean that I should find out the DNS that the DHCP assigns to connect me to the modem, then compare it with the DNS that it should use, and change it if necessary. Is that it?
The DNS of my external modem is 10.0.0.138. Here is the result of the two commands you posted: [QUOTE] Quote:
Quote:
|
OK, last night I sent you the results of ifconfig -a and route -n and it appeared to me that eth2 is being used for the Internet and, indeed, in the networking tool which I use to configure the network eth2 is currently set as being the default gateway device. So this morning I decided to see what would happen if I set the local network on eth1. So I left eth2 as having a dynamic IP and set the static IP on eth1. Result: the same! It's very strange:if I change the settings on either eth1 or eth2, the Internet goes down. Something else that it strange is that after changing these settings eth0 is automatically switched off when I restart the computer, even though I haven't touched this. I really don't understand! :scratch:
More news. I tried editing /etc/network/interfaces again by replacing what is in there by farslayer's suggestion. Sorry, farslayer, the exact same thing happens! :cry: On boot up the computer hangs on initializing system services and I get the blank screen of death. I have to re-boot in single user mode, remove the new interfaces file and copy back the old one in order for me to be able to start the computer again. What is going on here? I thought Linux was the network tool of choice! Perhaps it's my computer? But then, I did get this working in Windows :confused: |
So are you trying to enable BOTH interfaces in the same subnet (10.0.0.0) at the same time ? if so the system is probably getting a bit confused..
You should only have one interface enabled at a time on any particular subnet. If you configure eth1 as a Static IP address, you should shut down eth2 |
OK, I've tried giving éth1 a static address and shutting down eth2; I've tried giving eth2 a static address and shutting down eth1; I've tried giving both eth1 and eth2 a static addresss. But all these actions bring down the Internet. :confused:
|
So when you assign the Static IP address, and shut down the other interface, did you verify the system still had a default route and Entries in the DNS ?
Static IP address alone won't get you internet access, your system still needs a default route defined as well as a DNS server. |
The DNS address is set to10.0.0.138 but it's impossible to specify a default gateway as that field becomes blanked out. I don't know if it'll help you track down the problem (I'm sure it's something really obvious I'm doing - or not doing :rolleyes: ) but here are the parametres that are in the networking settings tool with eth2 switched on and eth1 off:
Connections Location: nothing entered here. Ethernet connection: The interface eth2 is active Ethernet connection: The interface eth1 is not active Ethernet connection: The interface eth0 is active Modem connection: The interface ppp0 is not configured Default gateway device: blanked out: impossible to add anything here. General Host settings Hostname: Debian Domain: nothing entered here DNS DNS servers: 10.0.0.138 Search domain: Ian Hosts IP Address Alisases ff00::O ip6-mcastprefix 127.0.0.1 localhost debian fe00::0 ip6-localnet ff02::2 ip6-allrouters ff02::1 ip6-allnodes ::1 ip6-localhost ip6-loopback 127.0.1.1 debian ff02::3 ip6-allhosts Under the "properties" tag Interface name: eth2 (enabled) Configuration: Static IP address IP address: 192.168.0.1 Subnet mask: 255.255.255.0 Gateway address: nothing entered here Interface name: eth1 (enabled) – yes this box is checked, but unchecking it makes no difference. Configuration: DHCP IP address: blank Subnet mask: blank Gateway address: blank Interface name: eth0 (enabled) Configuration: DHCP IP address: blank Subnet mask: blank Gateway address: blank |
no default gateway = no internet.
so does your /etc/network/interfaces file contain the line defining the default gateway ? Code:
# The Secondary network interface /sbin/route add default gw 192.168.0.138 Verify you now have the proper default route route Code:
it-etch:/etc/udev/rules.d# route |
Ah! Could we be homing in on the problem?
There is no line in the interfaces file dealing with a default gateway. Would that be 10.0.0.138 in my case (the address to my modem?). I've already posted it, but here is my current interfaces file (copied from Knoppix): Quote:
|
Your displayed interfaces file is for DHCP addressing not Static IP addresses...
It's difficult to help you if you are going to switch back and forth between static and dynamic addressing every other post.. Your displayed configuration is for Dynamic addressing on Both Ethernet interfaces. With Dynamic addressing your router or DHCP server would assign the Default gateway and DNS servers. your config should work fine for either interface you are using, and BOTH should not be plugged in at the same time. With Static addressing you need to specify every piece of address info yourself, from the IP address, to the Gateway and DNS Servers, etc.. Exactly HOW do you want this setup and working, Static addressing or DHCP ? Which interface do you plan to use ? There is no need to have an interface you are not using try to come up automatically it just slows down the boot process and doesn't get used anyway. |
Quote:
|
lets jump back to Page 1 of this thread then and look at the sample config i posted for you.. .
Code:
it-etch:/usr/src/linux# cat /etc/network/interfaces According to your earlier post (output of lspci) there are actually 2 physical network interfaces on your motherboard, so there should be 2 physical network jacks on the back of the PC. one of them will be eth1 and the other is eth2. so with this information in your /etc/network/interfaces file and the cable plugged into the appropriate physical network interface jack in the PC, your machine should have a Static IP address of 192.160.0.1 and the Other interfaces should be down (because the auto ethX lines are commented out for those interfaces.) It really shouldn't be any more complicated than that... It is really odd that your router is 192.168.0.138 and your PC is 192.168.0.1 those settings are backwards from the default configuration of most routers. Most routers are either 192.168.0.1 or 192.168.0.254. Most routers start handing out DHCP addresses in the range of 192.168.0.100 - 192.168.0.200 but if the information you provided is correct the configuration in this post should work. Another item that is odd is that every time you have DHCP enabled you are showing IP addresses in the 10.0.0.0 network, not 192.168.0.0 . Are you sure your network is configured for 192 address range ? You mentioned you had another PC on the network and it is working fine.. Just for sanity's sake could you post the IP setting of that workstation ? |
Thanks for all your help with this, farslayer. I'm a teacher, and I know how exasperating it can be when a student fails to understand, despite all your efforts! Actually, I've read through all the posts again and I can see that I've learned a lot since the beginning - so thanks once again. Now I need to go away and find some more information to clear this up:
Quote:
Quote:
Quote:
|
Following what I said in the post above, I've just found the following information on the web page of my Internet provider. I don't know if it helps, but here it is:
Primary DNS: 194.117.200.10 Secondary DNS: 194.117.200.15 SubnetMask: 255.255.255.0 Domain name: club-internet.fr On another page, they explain how they attribute the modem IP addresses. Here is my translation: Quote:
|
Do you have a broadband router hooked up between your Broadband modem and the computers ? if you do have a router it would typically assign addresses in the 192.168.0.0 Range.. from what I can see that functionality may be built into your modem...
I'm asking you a lot of questions so I can try and get a clear picture of what is going on and figure out exactly where our disconnect is so we can get you running.. Yes it can be frustrating and at time I wish I had a white board so I could draw a picture it would make explanations so much easier :) it looks like part of the problem is we have been trying to assign an address in the wrong IP range to get you online.. Code:
it-etch:/usr/src/linux# cat /etc/network/interfaces the second computer can then be 10.0.0.2 and so on.. If that works and the PC's are online... we can look at what it will take to make them talk to each other on you local network. |
Sorry, farlayer, that doesn't work!!!:cry: I've tried editing your file to disable eth2 and enable eth1, and I've also edited it to enable both. But as soon as we assign a static IP, the Internet comes down. I'm going to write to my Internet provider to see if there is anything funny about the modem. It'd surprise me, though, as it's very common - and as I said, the network did work under Windows. :mad:
Quote:
|
Great news, farslayer :p :p I've got the Internet working with a static IP! And I've managed to switch off eth1 and eth0! Simple solution - I knew it would be something dumb! The netmask was wrong! 255.0.0.0 and not 255.255.255.0! Next step, configuring the other computer. :D
|
OK, I've just tried configuring the second computer but the two computers don't see each other. I guess this problem will be much more straightforward than the last, though!
Here are the parametres I put in the second computer: Configuration: static IP address IP address: 10.0.0.2 Subnet mask: 255.0.0.0 Gateway address: 10.0.0.1 Host: james1 DNS servers: 10.0.0.1 Search domain: debian. I'm not at all sure about the last two. For this computer they were: DNS servers: debian; Search domain: Ian. Do I need to change these settings on the second computer to read the same as the first? |
I'm going away for a month, and I won't be able to look into this problem until I get back. I'll post a new thread then, as I still can't get these two computers to see each other.
Once again, thanks a lot for your help - I'd never have got this far without it. Cheers James |
All times are GMT -5. The time now is 05:31 PM. |