LinuxQuestions.org
Review your favorite Linux distribution.
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-2011, 01:33 PM   #1
hewittrj
Member
 
Registered: Mar 2007
Posts: 83

Rep: Reputation: 15
sharing one internet connection with three different networks


It seems that at this moment IPCop will not work for what I want it to do, so I will ask it here and hope I can get a better answer here.

Here is what I have to deal with. My Church is currently using Road Runner Broadband for internet service with the following setup:

1. The RR modem is connected to a BEFSR41 Router labled WAN
2. Connected to the 1st Ethernet Port is another BFSR41 WAN port labled
Private. This is for the Church offices.
3. Connected the the 2nd ethernet port is another BFSR41 Wan port labled
Public. This is for the Church School.
4. considered connectiong a Wireless Rourter to the 3rd Ethernet port for Wireless Access.

It all works Ok except when we have a power outage I have to go to the Church to reset everything or else everyone would be unable to connect to the internet. that is unti I set the Public and Private Router to Static IP and it stoped being a problem. The new Problem is that I have replaced the Public router due to failing equipment (It Died on Day) Now I was asked to impliment WiFI for Church member to access the internet from their Portable devices, but not let access to any of the other networks (Public, and Private. And just for the record I did not set this up and I don't like it this way at all. What I want to do is to be able to use a relative Cheep Pc like this Compaq PIII 1.2Ghz small for factor to route and provied DHCP for all three Networks (public, Private, and Wifi) without them seeing or being able to access one another. This is the initial proviso for now but the future holds the need to share two netwoked Printers between Public and Private only. On is a FAX/Scanner/printer, and the other is a DesignJet 500PS. bothe have network connections. What is the the best solution for this problem, any Ideas will be welcome. I know this is a tall order to ask but I am stumpted on what to do

Robert
 
Old 08-10-2011, 03:55 PM   #2
janhe
Member
 
Registered: Jul 2007
Location: Belgium
Distribution: slackware64 14.2, slackware 13.1
Posts: 371

Rep: Reputation: 54
Any linux distribution should be able to handle this situation.
But the situation seems specialized enough that it won't be covered by easy point-and-click interfaces.

The details on internet connection differ a bit based on whether the RoadRunner modem also is a router that hands out private IP addresses, or simply a modem (in that case the internet connection would be configured on the first BEFSR41 at the moment). But the way I see it a PC with 4 ethernet cards and 1 wireless AP should be enough.

You simply set up 3 subnets:
Code:
private  : 172.16.10.0/24
public   : 172.16.20.0/24
wireless : 172.16.30.0/24
The first ethernet card on the PC connects to the RoadRunner modem. Details on how this one should be configured depend, like I said above, on what the modem does exactly.
The second ethernet card connects to the church offices (through a switch)
The third ethernet card connects to the church school (also through a switch)
The fourth ethernet card connects to the wireless AP.
IP address configuration:
Code:
eth1 gets static IP 172.16.10.1
eth2 gets static IP 172.16.20.1
eth3 gets static IP 172.16.30.1
A DHCP server is configured on the PC, handing out addresses for the 172.16.10.0 172.16.20.0 and 172.16.30.0 networks. It hands out IP addresses ending in numbers 34-254, so numbers 2-33 can be used for printers and maybe other thing that are going to need static IP addresses.
Code:
The printer in the church offices gets static IP 172.16.10.5
The printer in the church school  gets static IP 172.16.20.5
At the moment simple routing between the networks is possible (it will be set up with the internet connection).
A firewall (with iptables) will prevent unwanted accesses:
Code:
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT # allow packets for existing connections
iptables -A FORWARD -o eth0 -j ACCEPT # allow opening new connections to the internet
iptables -A FORWARD -i eth2 -d 172.16.10.5 -j ACCEPT # allow opening new connections to office printer from school
iptables -A FORWARD -i eth1 -d 172.16.20.5 -j ACCEPT # allow opening new connections to school printer from office
iptables -P FORWARD DROP # prohibit all the rest
I can work out the internet access when I know if the PC must set up the connection or if it must be left to the RR modem.

ASCII art network diagram:
Code:
               Internet
                  |
                  |
           RoadRunner modem
                  |
                  |
                  PC
                 /|\
                / | \
               /  |  \
              /   |   \
             /    |    \
        Church  School  Wireless
        switch  switch  AP    ^
        | |  |  | |  |        |
       PC PC PC PC PC PC    Laptop
All this can get expensive based on whether you have to buy switches or not.

If you happen to have (or get a donation) a managed switch, you can make do with one or 2 network cards on the PC and VLANs, but I'm probably getting far ahead of myself here.

Last edited by janhe; 08-10-2011 at 04:05 PM. Reason: Clarified firewall commands
 
Old 08-10-2011, 07:12 PM   #3
hewittrj
Member
 
Registered: Mar 2007
Posts: 83

Original Poster
Rep: Reputation: 15
Smile

COst is not as hard as it sounds just the knowledge and what is the best distro to use. As for a Managed switch I have a brand new Cisco Catlyst 2950C switch on my desk right now, ufortunatly I still need help in programing it too. can you point to the best solution with what I do Have. The RR Modem is a modem only Ro Router I get a DHCP address from it to the WAN router as DHCP address

1. Compaq deskpro weith a Intel Celeron 1.3Ghz Processor and 512Meg Of Memory and 3 PCI NIC's and 1 onboard ethernet connection HD size up to 40GB if necessary

2. 8 port unmanagerd switch
3. 24 port Cisco Catalyst 2950C Switch (donated to us but bad under waranty and replaced by Cisco)
4. and a closet Shelf to place it all on till I can get a Better location built for it.
5. Linksys wireless Access Point

Wht Distro would you recomend to try, and any other reading material to help me on this Quest I have embarked on.

RObert

Last edited by hewittrj; 08-10-2011 at 07:15 PM.
 
Old 08-11-2011, 04:18 AM   #4
janhe
Member
 
Registered: Jul 2007
Location: Belgium
Distribution: slackware64 14.2, slackware 13.1
Posts: 371

Rep: Reputation: 54
Quote:
Originally Posted by hewittrj View Post
COst is not as hard as it sounds just the knowledge and what is the best distro to use. As for a Managed switch I have a brand new Cisco Catlyst 2950C switch on my desk right now, ufortunatly I still need help in programing it too. can you point to the best solution with what I do Have. The RR Modem is a modem only Ro Router I get a DHCP address from it to the WAN router as DHCP address

1. Compaq deskpro weith a Intel Celeron 1.3Ghz Processor and 512Meg Of Memory and 3 PCI NIC's and 1 onboard ethernet connection HD size up to 40GB if necessary

2. 8 port unmanagerd switch
3. 24 port Cisco Catalyst 2950C Switch (donated to us but bad under waranty and replaced by Cisco)
4. and a closet Shelf to place it all on till I can get a Better location built for it.
5. Linksys wireless Access Point
In that case the setup in the previous post seems to be the best one. You can do a lot with the Cisco switch, like splitting it up in 2 VLANs so you don't have to use (and power) the unmanaged switch. But for simplicity I would recommend leaving it without configuration, and just use it like an unmanaged switch.

If RoadRunner gives you a public IP address by simple DHCP, then you will have to do IP masquerading on the PC with 4 network card. The eth0 network card then gets its IP, DNS and standard gateway by DHCP. You also have to run a simple DNS server on the PC.

Oh, and if the Linksys wireless AP is also a router, remember to plug the routing PC into its LAN port, not the WAN port.
Quote:
Originally Posted by hewittrj View Post
Wht Distro would you recomend to try, and any other reading material to help me on this Quest I have embarked on.
I'm a Slackware user, so I would use it for anything where a linux distro is needed.

But as I said: any distro could do this, and probably no distro has point-and-click interfaces for configuring this.
That means the standard advice: choose something familiar. If you're not familiar with any linux distro, choose something that somebody you know is familiar with. That way he/she can help you out.

Lastly, I would not recommend using Ubuntu or another distro with a short release/abandonment cycle. You are building an router that is directly connected to the public internet. You will want security updates.
For that I can recommend Slackware. Slackware has a reputation as "not newbie friendly", and I can see why that is, but for a "one time setup & never look back" situation it is very good.

Available documentation depends on the distribution. A lot of the info for other distributions is applicable to Slackware. A general HOWTO for internet sharing is: http://tldp.org/HOWTO/pdf/IP-Masquerade-HOWTO.pdf (The Linux Documentation Project has a lot of good documents) If you choose slackware, Slackware Linux Essentials is also a good read: http://slackbook.org/ (but as I said, any linux should do)

Last edited by janhe; 08-11-2011 at 04:20 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
[SOLVED] Sharing internet connection(wireless server internet, wired network client) vladimir1986 Linux - Networking 4 07-25-2011 10:34 AM
How do you bridge networks on linux? Or share a network's internet connection? pugsley1218 Linux - Networking 1 11-14-2005 04:36 AM
Internet Connection Sharing mimithebrain Linux - Networking 7 08-15-2005 07:55 PM
Merging two networks to share internet connection Maranza Linux - Networking 17 02-02-2004 08:32 PM
help about internet connection sharing softouch Linux - Networking 2 03-21-2003 08:40 AM

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

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