LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-10-2004, 10:18 PM   #1
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Rep: Reputation: 46
Connecting to another Linux box through router?


First off, I know almost nothing about networking. Ive got 2 linux boxes hooked up to a router and I am wondering how hard it is to connect one of them to the other through the router? I only need to go from one to the other not back and forth. Thanks for any response.
 
Old 07-10-2004, 11:58 PM   #2
p-static
Member
 
Registered: Jul 2004
Distribution: Gentoo
Posts: 101

Rep: Reputation: 15
Very easy. You need to know the IP addresses of both(run "/sbin/ifconfig eth0" on each, and there'll be a bit that says inet addr:something), and then you can connect to the IP address. The IP addresses will probably be either 192.168.something.something, or 10.etc.etc.etc..
 
Old 07-11-2004, 02:06 AM   #3
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 47
Is that a hardware router -LinkSys/Dlink/NetGear types or a linux box?

if you can avoid connecting to the router, you can use a crossover cable to connect your two systems.

They should be on the same subnet, say 192.168.0.1 is the IP of one system and 192.168.0.2 the address of the other system.

Unless of course your systems not as close to each other and requires connection over a telephone line or cablemodem ....
 
Old 07-11-2004, 02:50 AM   #4
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
You have 1300 posts, so I'm guessing that my comments are obvious. I make them in case they aren't.

You've already been told how to physically connect (the cross-over cable is always nice, don't
need a router at all!). Also nice is a simple network hub. Hubs are just dumb connections
they don't actually route. A router can redirect one IP address to another, whereas a hub
just connects computers and leaves their IP addresses alone.

Anyway, if you know the ip addresses of the machines through ifconfig, and one was
192.60.74.11 and the other 192.60.74.12, then from the 11 machine, try

ping 192.60.74.12. If that works, then the machine's are already physically connected. Your
cables and your hub and router are good. The rest is all software.

If even that doesn't work, try ping 192.60.74.11. Why ping yourself? Maybe even your own
network stack isn't set up right. If you can't ping yourself you have more fundamental problems.
If you can ping yourself but not the other machine, then your cable or switch are wrong, or the
other machine hasn't started inetd.

Once you ping, move on to ssh. sshd should be running by default on both machines in most
distributions, so shouldn't need to install. If your logon on the other machine is ralph, type

ssh ralph@192.60.74.12 (If you have DNS, you could refer to the other machine by name, but
when you're just trying to get started, go with the #'s. )

If ssh works, then scp will work and you can move files back and forth.

Oh ... that's another thing. Fixed IP addresses are much better for the simple debugging you
are trying to do. Your machines may be setup with DHCP. Write back a bit more if you're still
stuck and I can tailor this more when know exactly what your problem is.

Last edited by pcardout; 07-11-2004 at 02:52 AM.
 
Old 07-11-2004, 03:01 AM   #5
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Original Poster
Rep: Reputation: 46
Got the Ip addresses, I can ping myself but not the other machine so I started inetd on the other machine and still could not ping other machine. What should I take a look at next?
 
Old 07-11-2004, 03:48 AM   #6
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
A crossover cable is a failsafe connection (if you have a professionally made one). Then you
KNOW the hardware is connected. If I think of additional software tricks I'll get back to you.

Also ... do you have a router or a hub? Also, if you do mean you have a hub, then that
pesky "uplink" switch on the end position of the hub can cause no end of trouble. Put both cables in
positions not controlled by the switch. (In the "Normal" position, the end port is like a normal
cable, but in uplink, the end port is switched to crossover. If you have two normal cables and
the switch is in uplink, then you aren't connected).

Oh ... also, can the other machine ping ITSELF? If so then I do think hardware is your problem.
Also /sbin/ifconfig should run on both machines and indicate that eth0 is live?

Last edited by pcardout; 07-11-2004 at 03:50 AM.
 
Old 07-11-2004, 03:51 AM   #7
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
My X-over cable suggestion was to use it for a direct connection between machines. No intervening hardware. Not sure if that was clear. I'm going to bed now. Good luck and I'll
check back tomorrow. (Also, I edited the last post since posting ... I clarified it).
 
Old 07-11-2004, 01:10 PM   #8
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Original Poster
Rep: Reputation: 46
I cant use a crossover cuz both machines are connected to a router and need internet access. I do not have a hub at all and the other machine cannot ping itslelf.
 
Old 07-11-2004, 10:00 PM   #9
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 47
Quote:
I cant use a crossover cuz both machines are connected to a router and need internet access.
What make is this router. From what you are saying, it appears this is a kind of router-switch with 1 WAN Port and 4 LAN Ports.

Pardon me if my presumption is wrong.
 
Old 07-11-2004, 11:33 PM   #10
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Original Poster
Rep: Reputation: 46
Its a smc. Its just a plain old 4 port router with a wan jack in the back and 4 lan ports on front. It also has what looks like a serial port on back that says com.
 
Old 07-12-2004, 01:09 AM   #11
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
One final time on why you got so many suggestions to try a X-over cable. It is the suggestion to check whether your hardware is configured wrong or the network stacks on your two machines aren't working correctly. If the X-over cable worked, then it is only a misconfigured router. That would give you confidence!

Anyway, if you have two non X-over cables into the LAN side of your SMC box, that's the same thing as a X-over. Does the LAN side have any switches ... no uplink switch right?

Also ... we neglected to ask you just what ARE the ip addresses of your two machines. They need to be on same subnet (meaning the first 3 #'s in IP address are the same and only the fourth is different). We also didn't ask if they are fixed IP or if you are using DHCP.
 
Old 07-12-2004, 05:11 AM   #12
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 47
Quote:
Its just a plain old 4 port router with a wan jack in the back and 4 lan ports on front.
In this case, you only require 2 straight cables (regular patch cords). The rest of the stuff is straightforward. Just hook up the systems to ports on the front and you have a network.

If your SMC box has a dhcp server, you can use that facility to automatically allocate IPs to your systems. You need to configure your linux systems to get DHCP addresses.

Look for the settings in /etc/rc.d/rc.inet1.conf.

Last edited by ppuru; 07-12-2004 at 05:12 AM.
 
Old 07-12-2004, 11:43 PM   #13
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Original Poster
Rep: Reputation: 46
Yea, Ive already got the network I just dont know the software part, How to tell one computer to allow the other to talk to it.
 
Old 07-13-2004, 02:01 AM   #14
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
You want to get ssh and scp running on both machines. They are part of most Linux Disd's
so you really don't need to do anything but, say

ssh bahanick@192.6.134.6

This will work the minute you can ping one machine from the other.
 
Old 07-13-2004, 01:13 PM   #15
BajaNick
Senior Member
 
Registered: Jul 2003
Location: So. Cal.
Distribution: Slack 11
Posts: 1,737

Original Poster
Rep: Reputation: 46
I just found out what ssh is and if you check out my other thread I am trying to disallow it now. I will have to work on this after I figure out what ssh version I have, how to secure it and whatever else. Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to Linux box from Windows with Samba Tylerious Linux - Software 7 10-04-2005 08:28 AM
Connecting Linux box to Internet through Windowx XP box over LAN pcd007 Linux - Networking 1 03-14-2004 09:02 AM
Directly connecting RH9 box to ISP (cable), then off to a router to rest of lan? shirtboy Linux - Networking 7 11-18-2003 10:27 PM
Connecting a Trust cam. to linux box bwyatt Linux - Hardware 3 07-02-2003 08:50 AM
Connecting to my Linux box using XDMCP Rand Linux - Networking 2 04-08-2003 02:28 PM


All times are GMT -5. The time now is 05:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration