LinuxQuestions.org
Visit Jeremy's Blog.
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 02-23-2004, 08:39 AM   #1
sandrain
LQ Newbie
 
Registered: Feb 2004
Distribution: fedora
Posts: 5

Rep: Reputation: 0
Unhappy Sharing Internet with two machines, ping doen't work


Hi,

I'm trying to share internet with following two machines.


Machine1 - "Main"
- AthlonXP 1800+, 1G RAM
- OS: Fedora Core 1 (kernel-2.4.22-1.2174.nptl, installed with rpm)
- eth0: 61.96.30.10
- eth1: 192.168.0.1

Machine2 - "Sub"
- Samsung SQ20(Laptop)
- OS: Fedora Core 1 (kernel-2.4.22-1.2174.nptl, installed with rpm)
- eth0: 192.168.0.2


But when I ping with two NICs, it fails. I don't know what is wrong with my configurations.
Here are results of some network commands:




+++ On the Main Machine +++

# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:40:F4:21:26:22
inet addr:61.96.30.10 Bcast:255.255.255.255 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10170 errors:0 dropped:0 overruns:0 frame:0
TX packets:471 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:623110 (608.5 Kb) TX bytes:33998 (33.2 Kb)
Interrupt:10 Base address:0x1000

eth1 Link encap:Ethernet HWaddr 00:C0:26:2E:66:58
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:493 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:29884 (29.1 Kb)
Interrupt:11 Base address:0x3000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3852 errors:0 dropped:0 overruns:0 frame:0
TX packets:3852 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:188919 (184.4 Kb) TX bytes:188919 (184.4 Kb)


# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
61.96.30.0 0.0.0.0 255.255.255.128 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 61.96.30.1 0.0.0.0 UG 0 0 0 eth0



# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


# ping -c 4 211.218.150.200 # other network
PING 211.218.150.200 (211.218.150.200) 56(84) bytes of data.
64 bytes from 211.218.150.200: icmp_seq=0 ttl=54 time=16.8 ms
64 bytes from 211.218.150.200: icmp_seq=1 ttl=54 time=14.3 ms
64 bytes from 211.218.150.200: icmp_seq=2 ttl=54 time=18.6 ms
64 bytes from 211.218.150.200: icmp_seq=3 ttl=54 time=33.8 ms

--- 211.218.150.200 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3029ms
rtt min/avg/max/mdev = 14.340/20.919/33.859/7.624 ms, pipe 2


# ping -c 4 192.168.0.2
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
From 192.168.0.1 icmp_seq=0 Destination Host Unreachable
From 192.168.0.1 icmp_seq=1 Destination Host Unreachable
From 192.168.0.1 icmp_seq=2 Destination Host Unreachable
From 192.168.0.1 icmp_seq=3 Destination Host Unreachable

--- 192.168.0.2 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3020ms
, pipe 4


# ping -c 4 -I 61.96.30.10 192.168.0.1
PING 192.168.0.1 (192.168.0.1) from 61.96.30.10 : 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=0.077 ms
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.018 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.015 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.017 ms

--- 192.168.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3016ms
rtt min/avg/max/mdev = 0.015/0.031/0.077/0.027 ms, pipe 2



# ping -c 4 -I 192.168.0.1 61.96.30.10
PING 61.96.30.10 (61.96.30.10) from 192.168.0.1 : 56(84) bytes of data.
64 bytes from 61.96.30.10: icmp_seq=0 ttl=64 time=0.095 ms
64 bytes from 61.96.30.10: icmp_seq=1 ttl=64 time=0.015 ms
64 bytes from 61.96.30.10: icmp_seq=2 ttl=64 time=0.013 ms
64 bytes from 61.96.30.10: icmp_seq=3 ttl=64 time=0.015 ms

--- 61.96.30.10 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3010ms
rtt min/avg/max/mdev = 0.013/0.034/0.095/0.035 ms, pipe 2




+++ On the Sub Machine +++

# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:00:F0:70:F2:29
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:15543 errors:0 dropped:0 overruns:0 frame:0
TX packets:1834 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1928859 (1.8 Mb) TX bytes:272228 (265.8 Kb)
Interrupt:11 Base address:0x3000 Memory:e0201000-e0201038

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:288 errors:0 dropped:0 overruns:0 frame:0
TX packets:288 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:31119 (30.3 Kb) TX bytes:31119 (30.3 Kb)



# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0


# ping -c 4 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.2 icmp_seq=0 Destination Host Unreachable
From 192.168.0.2 icmp_seq=1 Destination Host Unreachable
From 192.168.0.2 icmp_seq=2 Destination Host Unreachable
From 192.168.0.2 icmp_seq=3 Destination Host Unreachable

--- 192.168.0.1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3025ms
, pipe 3




thanks.

Last edited by sandrain; 02-23-2004 at 08:40 AM.
 
Old 02-23-2004, 11:28 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
stupid question: are you sure of you network wire??? cause everything seem to be well configured
 
Old 02-23-2004, 08:04 PM   #3
sandrain
LQ Newbie
 
Registered: Feb 2004
Distribution: fedora
Posts: 5

Original Poster
Rep: Reputation: 0
I've tested with three NICs and Three wires. (testing on other machine they're all OK)
But everytime I tried, it fails.
 
Old 02-23-2004, 08:53 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Is the firewall on computer#2 blocking things? Computer #1 is connected to the net and the iptables should be setup on that one, not the second machine.
 
Old 02-24-2004, 09:05 AM   #5
sandrain
LQ Newbie
 
Registered: Feb 2004
Distribution: fedora
Posts: 5

Original Poster
Rep: Reputation: 0
setting of the second one

+++ On The Sub Machine(192.168.0.2) +++

# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


.. I still don't know what's wrong.
 
Old 02-24-2004, 09:40 AM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
If the two computers are connected directly using a cat5 cable from machine #1 to machine #2 , then you will need to use a crossover cable . If you are going through a hub/switch , then you would use a regular cat5 cable.
 
Old 02-24-2004, 11:39 AM   #7
sandrain
LQ Newbie
 
Registered: Feb 2004
Distribution: fedora
Posts: 5

Original Poster
Rep: Reputation: 0
I didn't know that there're two kinds of cable.
Thanks a lot, homey. I've tried that work only with direct cables.

I think I need a crossover cable.

thanks.

Last edited by sandrain; 02-24-2004 at 11:40 AM.
 
Old 02-24-2004, 12:59 PM   #8
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
The rule is simple: crossover wire to link same type of machine (PC-PC or hub-hub) and direct one to link different type (pc-hub)
 
  


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
How come I can ping between machines, but not get internet? ozymandias Linux - Networking 5 09-11-2005 04:20 PM
MDK 10 - Sharing Internet connection - cannot even ping Singing Banzo Linux - Networking 15 03-31-2005 09:01 PM
Internet connection sharing between 2 slackware machines Random`Zero Linux - Networking 6 01-03-2005 11:22 PM
Internet Connection Sharing 2 FC1 machines explorer Fedora 1 05-05-2004 02:09 AM
Internet Sharing on Linux machines varunbihani Linux - Networking 10 07-20-2003 09:34 AM

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

All times are GMT -5. The time now is 08:37 AM.

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