Click to See Complete Forum and Search --> : two identical machines not talking..


andycrofts
11-22-2003, 03:57 AM
HI.

(Sorry if the title's not too descriptive)

I have a networking question/problem I'll try to describe as best I can.

Currently I have a gateway/firewall/dhcp server between the Internet and the other machines on my home network. (Home network is via a cheap $30 hub).
Eth0 is set by pppoe to point to my ISP, and eth1 is given a fixed IP address (192.168.0.1/255.255.255.0/B'cast 192.168.0.255)
So far, all works. Connect any machine to the home network and they get an IP - even my Windows office laptop can connec to corporate HQ via VPN.
Now, the above gateway/firewall/dhcp/webserver is rather underpowered for the task. It's been working beautifully for about a year.
Now, I'm swapping it for a more 'meaty' machine.

I'm trying to set the second machine up as identically as I can to the first. Thus, all my previously-written notes will be current.

This second machine also has two ethernet cards. one set by dhcp, and the other has a fixed IP of 192.168.0.2/255.255.255.0/B'cast 192.168.0.255.
Installed the minimum I need from RH9 - identical to the first machine, according to my notes.
Note, no GUI. Unfortunately I need the space. It's the hard way - CLI + Webmin.

Now, while setting the second machine up, connected to the home network via dhcp interface, (works fine) all appears well. I can ping www.yahoo.com, downloaded webmin via lynx , etc.
However, I haven't the space to have two computers/monitors. This second machine is to be eventually controlled by another machine via ssh.

However, it doesn't work...
From the second (new) machine, I can ping the outside world, yet I can't ping the server on 192.168.0.1
unless after much experimentation I found that if I turn off the (unconnected) fixed-ip interface...(192.168.0.2, remember?) using "ifdown eth1" it (the dhcp interface) works even though it's not connected to anything

Same from the server. I can't ping/connect to the second on either of the second computers interfaces.

Why??
If I change the new machine's net and subnet to 10.0.0.1 from 192..., all is well again. Except I can't ping - "No route to host"

Once I swap machines, I'm sure this won't be a problem. But I need to get the 'new' machine as close as possible to the first, for a fast changeover. She-who-must-be-obeyed wants the kitchen table back (alright, the kitchen. Small apartment here. Like, about as big as an American garage :D).
What have I misunderstood? I'm sure it's not HW/SW, more a "PEBKAC" problem (i.e., me!)

Running RH9 - second machine identical except "apt-get upgrade"d to Fedora

-Obliged for any help. This is about the last thing stopping me getting my php/mysql-driven dynamic super www.oululife.com money-spinner (ha, ha) working.

-Andy

*PEBCAK - Problem Exists Between Chair And Keyboard.

cowanrl
11-22-2003, 08:34 AM
If I have this correct, your new machine has one ethernet card getting an IP address via dhcp from your home network. Is that correct? If so, then it is receiving an IP address on the 192.168.0.0/24 subnet.
The other ethernet card in the new machine is assigned a static IP address of 192.168.0.2 which is also on the 192.168.0.0/24 subnet.

If that is correct then there's your problem, you have 2 etherned cards on the same IP network. That's why changing the static IP address on the new server to the 10 network makes it work OK.

If you wan't to test the new machine out, you will have to have the ethernet cards on different IP subnets. I would suggest you set the the IP address on the ethernet card that connects to the home network to a static address on the 192.168.0.0/24 subnet. Set the default gateway on it to the address of the old router, 192.168.0.1.
You could set the second ethernet card on the new server to 192.168.1.1 and configure your DHCP server to give out IP addresses on it. You could then connect test computers to that subnet and test out the configuration of the new server.

Once all is working as expected, you can then swap the old server with the new server. Change the one ethernet card to PPPoE and change the other one to 192.168.0.1 if you wanted.

No matter what you do, each interface on the new server will have to be on different IP subnets while you are testing.

andycrofts
11-22-2003, 09:24 AM
Thaks for that.. I think I get the idea.
Yep, your assessment of the situation is absolutely correct.

I've changed the static IP to
192.168.1.2 and the network to 192.168.1.0, broadcast to 192.168.1.255 and it works! - Thanks, I can live with that no problem.

Now, if I connect the cable to my 'new machine's static port on 192.168.1.2, either removing the netmask or putting it to 255.255.255.0, and try to ping the old machine at 192.168.0.1 (or indeed, anywhere), I get "Network Unreachable". However, I'll work/google around for this.
:confused:

If you've a quick explanation, I'd be grateful, however suffice it to say I'm gonna be burning some midnight oil on networks, filling the holes in my knowledge (of which, it seems there are far more than I thought!).

At least my wife'll be grateful. She can have her kitchen back!

Thanks!

-Andy
(And to think I replaced two perfectly good network cards because of this....)

cowanrl
11-22-2003, 10:42 AM
When you say:

"Now, if I connect the cable to my 'new machine's static port on 192.168.1.2"

I'm not sure what cable you are connecting. Is this the cable from a test network or test computer you are going to use to test the configuration of your new server?

Before you will be able to pass traffic through your new server, you will need to configure it as a router. That can be done with a command as simple as:

echo 1 > /proc/sys/net/ipv4/ip_forward

That will configure the machine to pass traffic between the 192.168.0.0/24 network and the 192.168.1.0/24 network.

However, for a machine on the 192.168.1.0 network to be able to ping your old server at 192.168.0.1, you would need to enter a static route on the old server for the 192.168.1.0/24 network that uses the IP address of the ethernet card on your new server that connects to the home network as the gateway. If that ethernet card get's it's IP address via dhcp, that could create a problem. If the IP address changed, the route table on the old server would no longer be valid.

Of course, if your new server is going to act as your gateway to the Internet, you will probably be running iptables and IP masquerading on it. If you get that set up properly on the new server, that would eliminate the need for the static route on the old server.

I guess configuring your new server to test it out will be quite complicated. However, you should be able to have it all set up and have all your workstations behind it accessing the Internet.
When you are ready, remove the old server, change the ethernet card in the new server that was connected to the old server to use PPPoE and then connect it to the Internet.

Simple huh?

andycrofts
11-22-2003, 12:58 PM
Oddly, when I set the original up a year ago, it seemed so logical.
I remember it took about a day to get everything working, ip forwarding, firewall (iptables), dhcp, pppoe, virtual hosts, ssh, the whole shebang.
As I'm just duplicating, I expected a breeze (expecting about a couple of hours tops)
It seems that I have missed somewhere the bit about routing, and networks in general. Probably I folowed some parrot-fashion concept that I thought I understood (basics) but once the 'road turned' I am lost.

So, onto finding a good bit about networks. Rusty Russell's gonna be my first shot, and try to find something by Daniel Robbins, who IMHO has one of the clearest descriptive manners in the industry.

The cable I was referring to: I used the dhcp cable to access the house network (server, etc.) so I changed to the 'fixed' network, restarted networking (just in case), checked it was as expected with ifconfig eth1, and (it now being on 192.168.1.2) expected to 'ping' as before. Not to be. Neither internal nor external (using ip addresses, not fqdn's)

Subnets, I guess...I remember somewhere seeing a guru use a cmd starting 'routing add...' - and (windows) could access another network as by magic.

So, onward! I'll get there...I have to!

If you know of any good info. sources rather than obfuscated man pages, please let me know! It's one of the more 'black arts' of Linux.
-Many thanks!

-Andy

cowanrl
11-22-2003, 03:39 PM
If all you wanted to do was replace the old server with the new server, it should be no more complicated than your original experience.

I got the idea that you wanted to get the new server configured and running on the network so you could test it out before you replaced the old one with it. Maybe I misunderstood you and have complicated things too much for you.

Here's what I thought you wanted to do:



Internet
|
|
PPPoE
Old Server
runs DHCP
192.168.0.1
|
|
House Network
| |
| |
Existing PCs 192.168.0.x
using DHCP New Server
run DHCP
192.168.1.x
|
|
Test PC and
eventually all PCs
after configuration completed



In this case, you would assign the new server a 192.168.0.x IP address on the existing house network that would be out of the range of the addresses offered by the DHCP server.

If what you did is this:



Internet
|
|
PPPoE
Old Server
runs DHCP
192.168.0.1
|
|
House Network
| |
| |
Existing PCs 192.168.1.x
using DHCP New Server
run DHCP
192.168.1.x
|
|
Test PC and
eventually all PCs
after configuration completed



Then that won't work. The IP address on the ethernet card on the new server that connects to the house network must be on the same IP subnet as the house network.

I don't really know of any good books on networking. Most of my network knowledge was gained from Novell, Cisco and Microsoft training I've taken in the past. I also received intensive TCP/IP training at my former emplorer.

I agree with you that man pages are not learning tools. They only provide you with information to implement technology you already know.