Connect 2 linuxboxes

Posted on 1997-08-06
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 or send a mail (ex: 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
Question by:cl071997
  • 3
  • 3

Accepted Solution

sauron earned 100 total points
ID: 1585858
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.

Author Comment

ID: 1585859
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

Expert Comment

ID: 1585860
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...

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.


Author Comment

ID: 1585861
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


Expert Comment

ID: 1585862
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.

Author Comment

ID: 1585863
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

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now