LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 08-10-2007, 06:36 PM   #1
gpfromnc
Member
 
Registered: Mar 2006
Posts: 38

Rep: Reputation: 15
Help Connecting 2 Linux Boxes


Hi All,
I'm attempting, without success so far, to network 2 linux boxes and share an internet connection. I have no networking experience and so have been reading and experimenting to try to get the two computers networked. They are connected with a crossover cable and the lights on the NICs are on, but there is little or no connectivity. I say little, because when I connect or dissconnect one of the devices via the GUI controls, the GUI monitoring application on either box does show a "blip." I suspect that I've set something up wrong but can figure out what.

Box 1 OS is Mandriva 2007 with 2 network adapters:
The MCC device tab for the internet connected NIC is
eth0: Intel Corp.|Etherexpress PRO/100
IP configuration is DHCP
DNS Servers: 192.168.2.1
Search Domain: dhcppc0
My ADSL modem is connected to this and the connection is good.
The MCC device tab for the second NIC shows
Device: eth1:ADMtek Inc.|ADM983 Linksys EtherFast 10/100
IP configuration: Protocol static
IP address: 192.168.1.1
Netmask: 255.255.255.0
Gateway: 192.168.2.1
DNS servers: 192.168.2.1
Search Domain: dhcppc0
/sbin/ifconfig returns
/sbin/ifconfig returns:

eth0 Link encap:Ethernet HWaddr 00:02:A5:7A:7D:98
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::202:a5ff:fe7a:7d98/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11104 errors:0 dropped:0 overruns:0 frame:0
TX packets:11938 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5682615 (5.4 MiB) TX bytes:1589195 (1.5 MiB)
Interrupt:18

eth1 Link encap:Ethernet HWaddr 00:E0:E5:00:59:98
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:e5ff:fe00:5998/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:88 errors:0 dropped:0 overruns:0 frame:0
TX packets:551 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11738 (11.4 KiB) TX bytes:61605 (60.1 KiB)
Interrupt:19 Base address:0x1000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:30 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1740 (1.6 KiB) TX bytes:1740 (1.6 KiB)

The second computer's OS is Fedora Core 6
It has 1 NIC and the Network Configuration GUI for Ethernet Device shows:
Nickname: eth0
Activate device when computer starts
Statically set IP addresses: I've set these as follows
Address: 192.168.1.2
Subnet mask: 255.255.255.1
Default gateway address: 192.168.2.1
Hardware Device tab lists the NIC as:
eth0(ADMtek NC100 Network Everywhere Fast Ethernet 10/100)
It's status is shown as Active in the Devices Tab of the Network Configuration GUI.
/sbin/ifconfig returns:

eth0 Link encap:Ethernet HWaddr 00:E0:E4:00:05:18
inet addr:192.168.1.2 Bcast:192.168.1.2 Mask:255.255.255.255
inet6 addr: fe80::2e0:e4ff:fe00:518/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:509 errors:0 dropped:0 overruns:0 frame:0
TX packets:162 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:56617 (55.2 KiB) TX bytes:22841 (22.3 KiB)
Interrupt:11 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4502 errors:0 dropped:0 overruns:0 frame:0
TX packets:4502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6697340 (6.3MiB) TX bytes:6697340 (6.3MiB)

eth1 (box 1) and eth0 (box 2) are connected with a crossover cable and the lights on both NICs are lit.

If I ping box 2's NIC using ping 192.168.1.2 I get
--- 192.168.1.2 ping statistics ---
211 packets transmitted, 0 received, 100% packet loss, time 210090ms

If I ping box 1's NIC using ping 192.168.1.1 I get
connect: Network is unreachable

Thanks for any suggestions.
 
Old 08-10-2007, 07:04 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Please forget about the crossover cable. Buy yourself a nice router. $35(US) Networking will be much simpler.
 
Old 08-10-2007, 10:26 PM   #3
gpfromnc
Member
 
Registered: Mar 2006
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks. Is the crossover cable method unreliable?
 
Old 08-11-2007, 02:46 AM   #4
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Rep: Reputation: 38
Some of the settings on the 2nd machine are wrong, which could explain why it can't ping the 1st.

You have: inet addr:192.168.1.2 Bcast:192.168.1.2 Mask:255.255.255.255

It should be: inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0

Also, what does "route" show on both.

Cheers.
 
Old 08-12-2007, 02:05 PM   #5
gpfromnc
Member
 
Registered: Mar 2006
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks fro the reply.

Route for box 1 gives the following:
[root@dhcppc0 Desktop]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 10 0 0 eth0
192.168.1.0 * 255.255.255.0 U 10 0 0 eth1
169.254.0.0 * 255.255.0.0 U 10 0 0 eth0
169.254.0.0 * 255.255.0.0 U 10 0 0 eth1
default 192.168.2.1 0.0.0.0 UG 10 0 0 eth0

For Box 2
route: command not found
I tried route -A and route -Av with the same results, both as root and user.
My FC6 install is a new one and I'm still early in the learning curve on it's use, but I'd think the commands would work in the same way. Is this not true?
 
Old 08-12-2007, 02:06 PM   #6
gpfromnc
Member
 
Registered: Mar 2006
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks fro the reply.

Route for box 1 gives the following:
[root@dhcppc0 Desktop]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 10 0 0 eth0
192.168.1.0 * 255.255.255.0 U 10 0 0 eth1
169.254.0.0 * 255.255.0.0 U 10 0 0 eth0
169.254.0.0 * 255.255.0.0 U 10 0 0 eth1
default 192.168.2.1 0.0.0.0 UG 10 0 0 eth0

For Box 2
route: command not found
I tried route -A and route -Av with the same results, both as root and user.
My FC6 install is a new one and I'm still early in the learning curve on it's use, but I'd think the commands would work in the same way. Is this not true?
 
Old 08-14-2007, 12:13 AM   #7
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076

Rep: Reputation: 205Reputation: 205Reputation: 205
as simple as it gets
box a barnie's ipaddress 10.0.0.1 using eth1 as the interface
box b fread's ipaddress 10.0.0.2 " eth0 " " "
run netconfig on each machine the only part that matters is the names and addresses give both a domaine of org and accept the defaults for the rest
then on fread ifconfig eth0 10.0.0.2
then on barnie ifconfig eth1 10.0.0.1
the netmask for both is 255.255.255.0
this assumes that barnie is the one with the internet connection
at this point you should be able to ping from one to the other with the ipaddresses
I just now worked this out for my self
at this point this is all the help I can give you

Last edited by rob.rice; 08-14-2007 at 12:39 AM.
 
Old 08-17-2007, 10:28 PM   #8
gpfromnc
Member
 
Registered: Mar 2006
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks much for the help! I set it up as you described and ping was successful from each box. So now I know that the two cards can pass data, but my browser (Firefox) on box 2 returns a "Server not found" dialog. Any thoughts?
Thanks again.
 
Old 08-18-2007, 10:10 AM   #9
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076

Rep: Reputation: 205Reputation: 205Reputation: 205
Quote:
Originally Posted by gpfromnc View Post
Thanks much for the help! I set it up as you described and ping was successful from each box. So now I know that the two cards can pass data, but my browser (Firefox) on box 2 returns a "Server not found" dialog. Any thoughts?
Thanks again.
now that the 2 boxes are talking it's time to look into ipchains
I haven't gotten this working myself yet but will disceibe my sucuss if I have any
setting up a proxiy server on the internet connected machine is another way to share internet connections
both of these smell complex so
I'm also looking into ssh to share the internet connection between the 2 machines
remember computers are like any thing else you work on one problem at a time

I ran into a problem with this approach on slack-11 netconfig over wrote my /etc/HOSTNAME
/etc/hosts files so that there no longer was a local host this so badly confused the rest of my networking
setup that even using a web browser to look at files almost diden't work
so I had to put back the local host name in /etc/HOSTNAME
(this is for slackware mind you )and put back the line in /etc/hosts that read
"127.0.0.1 localhost darkstar.example.net darkstar"
then I added these lines to /etc/hosts
"10.0.0.1 barnie"
"10.0.0.2 fread"
to get the connection to come up at boot time I edited
/etc/rc.d/rc.inet.conf the internet connected machine's file looks like this


# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]="10.0.0.1"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

so for slack this should give you the idea of how to configure your network

now I can ping and ssh from one machine to the other by name

Last edited by rob.rice; 08-18-2007 at 10:52 AM.
 
  


Reply



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 two linux boxes together jeffbk Linux - Networking 2 05-08-2007 12:12 PM
Networking question - Connecting 2 Linux boxes. uncle-c Linux - Newbie 8 03-03-2007 12:14 PM
Connecting Windows boxes via Linux server Sastian Linux - Networking 4 12-19-2004 05:03 AM
Connecting two linux boxes via cross cable ElPuello Linux - Networking 4 11-10-2004 10:55 AM
Connecting 2 linux boxes with out a hub. sarin Linux - Networking 2 07-16-2002 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration