Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am new to this forum and I would appreciate some help with setting up my home network.
I am using Centos 5 x86_64 on one computer and Centos 4.4 on another one; both are connected to a DSL modem via a hub. This is the output from route:
root@new-screamer ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0 * 255.255.255.0 U 0 0 0 eth0
default 172.16.0.1 0.0.0.0 UG 0 0 0 eth0
The DSL modem is at IP 172.16.0.1, the computer I am working from is at 172.16.0.3 and the one I am trying to connect to is at 172.16.0.2. When I try to ssh I get:
[root@new-screamer ~]# ssh root@172.16.0.2
ssh: connect to host 172.16.0.2 port 22: No route to host
[root@new-screamer ~]#
Alright then I add a route to the host as:
[root@new-screamer ~]# route add -host 172.16.0.2 dev eth0
[root@new-screamer ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.2 * 255.255.255.255 UH 0 0 0 eth0
172.16.0.0 * 255.255.255.0 U 0 0 0 eth0
default 172.16.0.1 0.0.0.0 UG 0 0 0 eth0
although I am thinking that since the nework 172.16.0.0 is visible that might not be necessary. In the route output above I see that the host 172.16.0.2 has a different netmask than 255.255.255.0.
I pinged it:
[root@new-screamer ~]# ping 172.16.0.2
PING 172.16.0.2 (172.16.0.2) 56(84) bytes of data.
64 bytes from 172.16.0.2: icmp_seq=1 ttl=64 time=1.90 ms
64 bytes from 172.16.0.2: icmp_seq=2 ttl=64 time=0.300 ms
64 bytes from 172.16.0.2: icmp_seq=3 ttl=64 time=0.310 ms
64 bytes from 172.16.0.2: icmp_seq=4 ttl=64 time=0.198 ms
64 bytes from 172.16.0.2: icmp_seq=5 ttl=64 time=0.207 ms
--- 172.16.0.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.198/0.584/1.907/0.663 ms
so the network is up.
I tried again:
[root@new-screamer ~]# ssh root@172.16.0.2
ssh: connect to host 172.16.0.2 port 22: No route to host
At least you know that the cabling is OK between the hosts.
Remove the host route and try pinging it without the host route.
If pinging works, see if port 22 is open. Ex: telnet 172.16.0.2 22
My guess is that the packets were dropped by the firewall.
Also, please enclose the output of commands like /sbin/route in CODE blocks so that the original spacing is preserved. It is easier reading a table if the columns line up.
One thing to try is to use ssh as a regular user. Ssh should not be configured to allow ssh root logins.
Other things to check:
/etc/hosts.deny, /etc/hosts.allow, /etc/ssh/sshd_config, /etc/ssh/ssh_config, the firewall settings.
Oh, I almost forgot, I noticed that you don't have the lo device in the route. That might be the problem. Sometimes ssh will create a proxy and use the lo device. For example, if you were to use "ssh -X user@host", the ssh client will create a proxy X server at one end and a proxy client at the other. I wouldn't be surprised if a local socket is used somehow in the key exchange process. I'm guessing at this, but it is something that doesn't look right, and probably should be looked at in any case. If you use /sbin/ifconfig, does the lo device show up?
It was the firewall that was giving me the problems. The firewall on the remote machine was not allowing any services, like ssh, telnet, ftp e.a. I enabled SSH on the remote machine, using the GUI not the command line, and it worked.
Now, since I am new to this, how do you generate the code blocks?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.