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 05-01-2003, 07:33 AM   #1
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Rep: Reputation: 30
Setting up a Linux box as a router


I have a RH 7.2 computer, with iptables set up for IP masquerading and ip_dynaddr and ip_forward both turned on. (ip_forward is turned on in /etc/sysctl.conf and ip_dynaddr is turned on by doing a echo 1 > /proc/path/to/ip_dynaddr automatically everytime the computer starts.)
I have two NICs, eth0 is currently plugged into my network, and eth1 currently doesn't have anything plugged into it.

I also have a 802.11b Linksys Router/WAP, and I need to be able to access my connection wirelessly.

I plug my cable modem into eth0 (haven't tried it yet), and then would I plug eth1 into the WAN port on my router, or the Uplink port on my router?

Also, I have this line in iptables to forward the ports:

iptables -t nat -A PREROUTING -p tcp -o eth0 -dport 21 -j DNAT --to-destination 192.168.1.101

192.168.1.102 is my Linux box to use as a router, and 192.168.1.1 is my Linksys router/WAP.
Am I going to forward the ports directly from my Linux router to the computer I want them to go to, or will I need to forward them from my Linux router to my WAP and have that forward them to the computer they should reach?

If there's anything i've forgotten to do please let me know, and thanks for your help!

Last edited by pilot1; 05-01-2003 at 07:34 AM.
 
Old 05-10-2003, 10:08 PM   #2
Sutekh
Member
 
Registered: Apr 2002
Location: Melbourne, Australia
Distribution: Gentoo
Posts: 273

Rep: Reputation: 30
Re: Setting up a Linux box as a router

Quote:
Originally posted by pilot1
I plug my cable modem into eth0 (haven't tried it yet), and then would I plug eth1 into the WAN port on my router, or the Uplink port on my router?
normal port, uplink is used from hub to hub

[quote]
Also, I have this line in iptables to forward the ports:

iptables -t nat -A PREROUTING -p tcp -o eth0 -dport 21 -j DNAT --to-destination 192.168.1.101
[quote]
ok so this is going to grab any outgoing ftp commands and route then back to the 192.168.1.101 box. Is that what you want?

Quote:
192.168.1.102 is my Linux box to use as a router, and 192.168.1.1 is my Linksys router/WAP.
Am I going to forward the ports directly from my Linux router to the computer I want them to go to, or will I need to forward them from my Linux router to my WAP and have that forward them to the computer they should reach?
if you have a masqeraded connection already all you really need to do is setup the gateway settings on your wireless machines to point towards the linux gateway. The routers typically have at least two network interfaces a wired WAN port, maybe wired lan ports and of course the wireless ports. So it may be easier just to set up the wan port to point to the linux box, and setup the wired land and wireless addresses to be in a different address range (maybe 192.168.2.0 or whatever) and let the router translate the adresses as it goes.
 
  


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
linux box as a router cambie Linux - Networking 4 11-21-2004 10:01 AM
linux box as router cambie Linux - Networking 10 11-16-2004 12:20 AM
Using Linux Box as a Router wasabi Linux - Networking 5 09-04-2003 05:08 PM
Linux box as router AkumaLoka Linux - Networking 3 10-14-2002 04:57 PM
Linux box as router Kapone Linux - Networking 5 07-04-2001 06:50 AM

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

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