LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 02-02-2004, 01:20 PM   #1
Maranza
Member
 
Registered: Dec 2003
Distribution: Kubuntu Edgy
Posts: 38

Rep: Reputation: 15
Merging two networks to share internet connection


First, my setup, then my questions.

I've got a DLink ADSL Modem. The modem wants to have the 192.168.0.1 address and lends dynamically an ip to the computer, the external ip (it lends the same ip if it's not connected to the internet). And this is my first network. Then i have to set up another one: the pc with the modem has to share the connection to another computer. I read that i can't have the same ip classes (like 192.168.0.3 and 192.168.0.4) for the other network.
Now let's say that PC1 has two network cards, eth0 connected to the modem and with a dynamic ip, and eth1 connected to PC2 using a static ip. PC2 will have just eth0 connected to PC1 with a static ip. I've already configured the internet connection for PC1, i just need help sharing it with PC2. That would be merging two networks right? How do i do that?
 
Old 02-02-2004, 01:24 PM   #2
nightjar
Member
 
Registered: May 2002
Location: Argentina
Distribution: Mandrake 9.2
Posts: 177

Rep: Reputation: 30
Net <----------> PC1<---------------------------->PC2
192.168.0.1 192.168.0.x

Is this correct?

You can do it !!!
What is ur distro ?
 
Old 02-02-2004, 01:53 PM   #3
depaul
Member
 
Registered: Jul 2003
Posts: 88

Rep: Reputation: 15
Why dont you put a hub facing your private network side on your dlink ... with 4 ports you could attach 3 pc's... direcly to the hub ... no need to leave the pc1 on for pc2 to acces the net ...

Last edited by depaul; 02-02-2004 at 01:57 PM.
 
Old 02-02-2004, 02:17 PM   #4
Maranza
Member
 
Registered: Dec 2003
Distribution: Kubuntu Edgy
Posts: 38

Original Poster
Rep: Reputation: 15
yeah i could buy a hub... why not?
a DSL Router would be better...
I could also hire Torvalds to set up my network

I'm sure there is a way to do this without speding $$...

Code:
Anyway my network is like
Modem -------------- PC1 ----------------- PC2
192.168.0.1             eth0(dynamic ip)
                        eth1(a static ip)             eth0(another static ip)
i think this configuration cannot be merged into one network, anyway i'm not a network guru, help me

Last edited by Maranza; 02-02-2004 at 02:22 PM.
 
Old 02-02-2004, 02:22 PM   #5
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
Yes you could do it.. You would need two ethernet cards in PC1, and a cross-over ethernet cable to connect it to PC2. However getting a hub or switch would be a much better solution.


What OS is on PC1?
 
Old 02-02-2004, 02:34 PM   #6
depaul
Member
 
Registered: Jul 2003
Posts: 88

Rep: Reputation: 15
these days .. a hub is at the price of a nic card ...
 
Old 02-02-2004, 02:36 PM   #7
Maranza
Member
 
Registered: Dec 2003
Distribution: Kubuntu Edgy
Posts: 38

Original Poster
Rep: Reputation: 15
i've already got two eth cards on PC1, you don't need to be a guru to figure out i needed two eth cards... i mean, where would i plug the 2nd cable? (no jokes about this one )
The os is linux of course


I already have all the hardware i need and it's properly configured on each PC. The configuration of PC2 should be simple as
ifconfig eth0 some-ip up
route add default gw PC1-eth1-ip
with some-ip and PC1-eth1-ip being two static ips i have yet to decide (not very difficult, but they must be on a ip class than 192.168.0.x right?)

but the configuration of PC1 requires some skills i do not have.
 
Old 02-02-2004, 02:42 PM   #8
Maranza
Member
 
Registered: Dec 2003
Distribution: Kubuntu Edgy
Posts: 38

Original Poster
Rep: Reputation: 15
an ethernet card costs 5 , the cheapest hub i found online is 30.
And since it CAN be done without a hub i'd like to do that without a hub.
Windows can do that without a hub, so i'd expect linux could do that even without the eth cable

Last edited by Maranza; 02-02-2004 at 02:45 PM.
 
Old 02-02-2004, 02:58 PM   #9
nightjar
Member
 
Registered: May 2002
Location: Argentina
Distribution: Mandrake 9.2
Posts: 177

Rep: Reputation: 30
Are you talking to connect PC2 with Internet or to connect PC1 to PC2 and vice?
In the 2nd case you need to install nfs to see one to another
If the 2 r linux box u need client and server nfs
 
Old 02-02-2004, 02:59 PM   #10
depaul
Member
 
Registered: Jul 2003
Posts: 88

Rep: Reputation: 15
you could do it with the setup you have.

network from dsl
gateway 192.168.0.1 and pc1 192.168.0.2

network between the 2 pc's
pc1 nic card 2 192.168.1.1 and pc2 192.168.1.2
and make 192.168.1.1 as the gateway for pc2
*** dont forget your DNS...

make nic 1 and nic 2 on pc 1 as a proxy ...
 
Old 02-02-2004, 03:03 PM   #11
Maranza
Member
 
Registered: Dec 2003
Distribution: Kubuntu Edgy
Posts: 38

Original Poster
Rep: Reputation: 15
nfs? i tought nfs was used to share files... i plan to share files too, but i'm not going that far yet

anyway, PC1 is connect to a modem and to PC2 with two different eth cards, while PC2 is connected to PC1 and should "leech" the connection from PC1 (i don't need NAT, firewalling or something like that, just be able to browse web pages from PC2)
 
Old 02-02-2004, 03:18 PM   #12
nightjar
Member
 
Registered: May 2002
Location: Argentina
Distribution: Mandrake 9.2
Posts: 177

Rep: Reputation: 30
ok
then do what depaul said

I think that you also need to share files
 
Old 02-02-2004, 04:12 PM   #13
Maranza
Member
 
Registered: Dec 2003
Distribution: Kubuntu Edgy
Posts: 38

Original Poster
Rep: Reputation: 15
ok now the modem-PC1 net is 192.168.0.x and the PC1-PC2 net is 192.168.1.x
they actually see each other and i can ping the modem from the pc2. Still i can't browse web pages (not even providing an ip, so it's not dns fault), what does "make nic 1 and nic 2 on pc 1 as a proxy ..." mean?
 
Old 02-02-2004, 04:38 PM   #14
depaul
Member
 
Registered: Jul 2003
Posts: 88

Rep: Reputation: 15
you have to make a proxy to forward the packets ...
 
Old 02-02-2004, 04:47 PM   #15
Maranza
Member
 
Registered: Dec 2003
Distribution: Kubuntu Edgy
Posts: 38

Original Poster
Rep: Reputation: 15
ok. So this was the "skill i do not have" i was talking about . Would you be so kind to explain me how to do that?
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you bridge networks on linux? Or share a network's internet connection? pugsley1218 Linux - Networking 1 11-14-2005 04:36 AM
share internet between 2 other networks -Srict- Linux - Networking 11 10-06-2005 05:20 PM
How do I share my Internet Connection? sagi7ario Linux - Networking 3 03-16-2004 05:17 PM
how to share internet connection digihall7 Linux - Networking 2 09-23-2003 03:42 PM
How do I share the Internet connection? Valeria Linux - Networking 4 07-19-2003 11:28 AM


All times are GMT -5. The time now is 11:06 AM.

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