Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-04-2006, 05:49 PM   #1
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Rep: Reputation: 30
connect 2 PCs via ethernet

i'd just like to connect 2 PCs via an ethernet cable (patch) and ping each other. I have 2 PCs running Sarge. I have edited the /etc/network/interfaces in both of them and added entries for the connected NICs. The IPs for the interfaces are of the same network ( and from I have just added in the /etc/network/interfaces the IP and the netmask. Then i do /etc/init.d/networking restart, but when i try to ping i get "destination host unreachable". What do i miss?
Old 05-04-2006, 06:13 PM   #2
Registered: Apr 2006
Location: Washington
Distribution: Suse, CentOS, Ubuntu
Posts: 124

Rep: Reputation: 15
tell me you are using a crossover cable.
Old 05-05-2006, 04:56 AM   #3
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Original Poster
Rep: Reputation: 30
Thanks hockeyman_102,
i am trying with other UTPs too. However, it must be a routing problem/conflict. In one of the PCs, i have an NIC, which is connected on my ADSL router and has an address from the same IP range. I am not experienced with networking, but i suspect this is the main problem.
Old 05-05-2006, 08:10 AM   #4
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
So, basically, you have one Linux box with 2 NICs (one for your internet connection and one between your 2 boxes) and the other box is just connected to the first.

To be able to connect to internet from the 2nd box, you'll need to configure your first box to act as a kind of gateway. It must allow packets between the internet and the 2nd box to pass.
There's a specific iptables rule for this, that I've seen on the LQ forums a few times already. Search and you'll find...

"ping" should work, unless your boxes are blocking the ICMP protocol (unlikely).
Did you "ping" based on IP address or to a hostname? In the latter case, the problem may be name resolution (/etc/resolv.conf or /etc/hosts settings).

Also, do you have set your internet-connected box as default gateway on your 2nd box?

If you still can't get it to work, maybe posting some stuff like the output of ifconfig (on all network interfaces)
for starters.


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 a single ethernet port to multiple PCs? beejayzed Linux - Networking 14 09-08-2005 05:14 PM
Cannot Connect 2 Suse Pcs To Each Other omashhour Linux - Networking 3 01-21-2005 11:36 AM
squid problem pcs unable to connect to net woods Linux - Networking 1 11-18-2004 03:21 PM
can ping to/from pcs on home network but not connect to internet stumblefingers Linux - Networking 13 04-12-2004 10:34 AM
connecting two PCs for file transfer via Ethernet cables jax Linux - General 4 02-22-2002 02:39 AM > Forums > Linux Forums > Linux - Networking

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

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