We help IT Professionals succeed at work.

Connect 2 linuxboxes

cl071997 asked
Medium Priority
Last Modified: 2010-03-17
Hi !
I´m trying to connect two Linux boxes but there are some problem. I´m using ethernet. I can ping to the others IP number or host name and that works fine, but when I´m trying to connect with rlogin (example: rlogin carry.home.se) or send a mail (ex: cl@carry.home.se) then I get the message network unreachable. I have in the file "hosts.allow" written ALL:ALL and in "hosts.deny" is everything marked with a '#'. I have not any router address specified and I have read the f...... manual adn . Im using the command 'netconfig' when I configure, I tried with ifconfig and all that but I guess thats the same as netconfig. Im using the IP addresses and 1 and not trying to get outside my litle network at home.
Very greatful for some help here.

Best regards
Claes Lindvall
Watch Question

Ok, try the following:-

Enter both of your hosts names and IP addresses into your /etc/hosts file. Copy the same hosts file to both machines. Ensure your /etc/resolv.conf file is not specifying any nameservers. If this is the case when rlogin attempts authentication, it will check the identity of the client in the DNS. If you have nameserver entries in resolv.conf, they may be on a network that is unreachable.

Check your /etc/host.conf file. It should contain:-
order hosts,bind
multi on
The order line is important

Then try a few tests...

1/ Ping machine 2 from machine 1, using the numerical IP address.
2/ Ping machine 2 from machine 1, using the hostname.
3/ Telnet to machine 2 from machine 1, with IP.
4/ Telnet to machine 2 from machine 1, with hostname.

These should all work for you. If any don't, let me know which ones fail, and also post the output of an ifconfig and route -n command.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Hi again!
Thanks for your answer. It didn´t help :-).
If you want I can send you the output of ifconfig and route -n, but I think the problem is here. You se I can ping to the machines, both with IP number and hostname but I cant telnet. Machine number 1 is trying... and machine number 2 is saying that the network is unreachable.
Now, when I´m trying to write (on machine number 1) 'route add -net' (which is machine number 2´s address) I get the error message : SIOCADDRT: invalid argument.
I have reinstalled the kernel and configured it by the book. The network card is 3Com 3c509. I have on the network card used the default settings and at boot-time I see that it is accepted.
I´m using kernel 2.0.29. Thank you again.
Claes Lindvall

When you boot the machine, the network scripts that get run are
in /etc/sysconfig/network-scripts. Check these to see that they appear ok.

run /etc/rc.d/init.d network stop, then network start. Any error messages??

Try to telnet to localhost - does this work?

What are your subnet addresses?

Post route -n output anyway please...


Hi again!

Sorry for the delay, I´ve been pretty busy for some days..
Well, where were we...

I can ping from both machines to each other and that works fine and from machine nr 1 (IP hostname: stat) when I try to telnet I get the message Trying...and no more.

From machine nr 2 (IP: hostname: carry) I get the message: Network unreachable...

I get an errormessage when I try to stop and start rc.inet2 (I couldn´t find any inet.d) and that was something about the printerspooler... When I tried the same thing on rc.inet1 there were no errormessages.

Here is the output from machine nr 1, stat, when I pressed route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface UH    0      0        1 eth0   U     0      0        0 eth0       U     0      0        3 lo

Here is the output from machine nr 2, carry, when I pressed route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface UH    0      0        0 eth0   U     0      0        2 eth0       U     0      0        2 lo

There is no problem to telnet to localhost

Claes Lindvall

I think your routing tables are slightly screwed. You appear to have a host route to your own IP address, which I don't have anywhere.

Oh and you've made a really bad mistake in one place ;-)

You've used as an IP address. You can't do this. the .0 address is the network address, and trying to use this as a host address will screw things up majorly. Use .1 and .2

The reason you couldn't run /etc/rc.d/init.d/network start and stop seems to be that you are using the older initialisation method - are you running Slackware?

Check your IP address and subnet mask etc at the beginning of /etc/rc.d/rc.inet1.

You should have

IP address (or.2)
Network address
Broadcast address
subnet mask

If you have no internet connection, comment out the line in rc.inet1 that looks like :-

/sbin/route add default gw ${GATEWAY} metric 1

Then reboot the machines. When you do route -n now, you should get:-

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface U 0 0 2 eth0 U 0 0 2 lo

If you do get all this, telnet should work for you. Try numeric IP's and hostnames. Of course, the hosts table will still have to be right.


Oh, what a great guy/girl you are.

The problem were my IP address as you said. When I changed the address from to 1 and 2 instead...oh, what a difference. Now I can telnet and rlogin just like that.

Thank you very much.

A happy
Claes Lindvall
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.