LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-31-2003, 04:37 PM   #1
CatSC
Member
 
Registered: Oct 2003
Location: New Zealand, Wellington
Distribution: Red Hat 9, Gentoo 1.4, Vector 4.0
Posts: 74

Rep: Reputation: 15
eht0 vs eth1 conflict


Hello everyone!
Here is what my home network looks like:


| |eth0-----eth0|Comp1|
Internet------ppp0| Gateway |
| |eth1-----eth0|Comp2|

What I want to do is to make so that all computers can access internet
and also can connect(ping) each other...
Gateway can ping Comp2 while eth1 there's no routes on eth0, but when
I enable eth0 connection with something like
route add -net 10.0.0.0 netmask 255.0.0.0 eth0
I can no longer ping comp on eth1
All comps have different IP's and all user proper netmasks.
Cna you plz help me?
 
Old 12-31-2003, 05:19 PM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
I really don't understand your diagram.

However, if you want to configure IP Forwarding and Masquerading (Internet Connection Sharing) on your Linux computer, take a look at this post.
http://www.linuxquestions.org/questi...274#post424274
 
Old 12-31-2003, 08:27 PM   #3
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
A hub would be good for you situation
ppp
||
|| <ip forwarding would be used here>
eth0
|
hub
/ \
| |
cptr1 cptr2

I'm sure you could get your computers to all talk w/ your set up but this is much more managable and expandable. And a hub isn't that expensive... $25? $30? I forget.

note: That didn't turn out exactly as I'd hoped, but the bottom two lines point to PC1 and PC2. Every thing else looks about right....

Last edited by benjithegreat98; 12-31-2003 at 08:29 PM.
 
Old 12-31-2003, 10:11 PM   #4
CatSC
Member
 
Registered: Oct 2003
Location: New Zealand, Wellington
Distribution: Red Hat 9, Gentoo 1.4, Vector 4.0
Posts: 74

Original Poster
Rep: Reputation: 15
My diagram didn't look how it supposed to be... :/
I have a gateway with two comps connected to it's eth0 and eth1
the problem that I have is that when they both are enabled only eth0
works
 
Old 01-01-2004, 08:42 AM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Are you using static IPs or DHCP ?

Let's start from the beginning.

Computer1 and computer2 should have different static IPs.
The gateway IP for computer1 should be the IP of eth0 and
the gateway IP for computer2 should be the IP of eth1.

You will need to set up IP Forwarding and Masquerading. Take a look at the link in my previous post.
 
Old 01-02-2004, 02:46 AM   #6
CatSC
Member
 
Registered: Oct 2003
Location: New Zealand, Wellington
Distribution: Red Hat 9, Gentoo 1.4, Vector 4.0
Posts: 74

Original Poster
Rep: Reputation: 15
All of them use static IP's and gateways on Comp1 and Comp2 are ok.
Main comp has same IP's of eth1 and eth0, is it ok?
Here is a bit from my console. When only eth1 route is set up I can ping
10.0.0.6, but when I setup the route for eth0 it stops working...

[root@main root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.0.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
[root@main root]# ping 10.0.0.6
PING 10.0.0.6 (10.0.0.6) 56(84) bytes of data.
64 bytes from 10.0.0.6: icmp_seq=1 ttl=64 time=0.694 ms
64 bytes from 10.0.0.6: icmp_seq=2 ttl=64 time=0.361 ms
64 bytes from 10.0.0.6: icmp_seq=3 ttl=64 time=0.357 ms

--- 10.0.0.6 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.357/0.470/0.694/0.159 ms
[root@main root]# route add -net 10.0.0.0 netmask 255.0.0.0 eth0
[root@main root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.0.0.0 U 0 0 0 eth0
10.0.0.0 * 255.0.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
[root@main root]# ping 10.0.0.6
PING 10.0.0.6 (10.0.0.6) 56(84) bytes of data.
From 10.0.0.4 icmp_seq=1 Destination Host Unreachable
From 10.0.0.4 icmp_seq=2 Destination Host Unreachable
From 10.0.0.4 icmp_seq=3 Destination Host Unreachable

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


Thanks
 
Old 01-02-2004, 03:01 AM   #7
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Umm, you can't have two interfaces connected to the same network like that, you're going to have routing conflicts.

Give each NIC on the gateway a different address on a different subnet, and put each of the connected hosts on a unique network.

Something like this:
Code:
[comp1 eth0 10.0.0.2]<-->[eth0 10.0.0.1 gateway eth1 10.0.1.1]<-->[eth0 10.0.1.2 comp2]
                                        [modem ppp]
                                                 (
                                                 )
                                                (
                                          {Internet}

Last edited by chort; 01-02-2004 at 03:02 AM.
 
Old 01-04-2004, 03:11 PM   #8
CatSC
Member
 
Registered: Oct 2003
Location: New Zealand, Wellington
Distribution: Red Hat 9, Gentoo 1.4, Vector 4.0
Posts: 74

Original Poster
Rep: Reputation: 15
Ok I got it working!
Thank everyone!
 
  


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
Redhat 9 eht0 fails on boot Hook99 Linux - Newbie 1 01-18-2005 06:19 AM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
DHCP using eth1 for internet eht0 for router... Zero-0-Effect Linux - Networking 12 01-17-2004 04:06 PM
changing eht0 with eth1 slano Linux - Networking 2 12-11-2003 05:13 PM
lag on eht0 activation CultFigure Linux - Networking 3 01-13-2003 02:04 PM

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

All times are GMT -5. The time now is 10:58 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