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 08-03-2006, 07:53 PM   #1
anibis
Member
 
Registered: Apr 2005
Distribution: FC5 & Slack 10.2
Posts: 50

Rep: Reputation: 15
Setting up FC5 to be a router


I'm just curious if anyone knew of any guides to set FC5 up to be a router, I have a linksys wireless router currently but I would like to use Fedora as a router just to learn more about linux. What are the pros/cons in doing this? I do have a laptop that uses wireless so I would have to keep the wifi working on the router. Thanks in advance.
 
Old 08-03-2006, 10:28 PM   #2
friskydrifter
Member
 
Registered: Jan 2003
Location: AU
Distribution: Whatever - mainly Red Hat
Posts: 32

Rep: Reputation: 15
You would have to enable routing and setup some Masquerading in iptables.

In FC5 to enable routing you can edit /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 1 (0 is disabled, 1 is enabled)

This changes the value in /proc/sys/net/ipv4/ip_forward, so another way you could do this is echo "1" > /proc/sys/net/ipv4/ip_forward.
But this will reset to 0 if the pc is rebooted and /etc/sysctl.conf has 0 as the setting.



Also, say you had eth0 connected to internet and eth1 connected to LAN and you wanted to route packets from the internal lan out to the internet then your basic iptables command would be

iptables -t nat -A POSTROUTING -s eth1 -o eth0 -j MASQUERADE


To try and explain this:
iptables -t nat = Work with NAT
-A POSTROUTING = Add a rule to the POSTROUTING table
-s eth1 = the source is comming from eth1
-o eth0 = the output is eth0
-j MASQUERADE = jump to (use) masquerading.


Theres more you can do to 'tune' iptables to accept this and that from here and there (lol good description hey) but the above command will get you working.

Dont know of any good sites, google should give you plenty. Or the netfilter (people who make iptables) site should help

Last edited by friskydrifter; 08-03-2006 at 10:43 PM.
 
Old 08-04-2006, 08:48 AM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Have a look at the BIG iptables tutorial for complete help.
 
  


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
Best complete PATH setting for FC5? donv2 Fedora 5 06-01-2006 04:48 PM
Setting up my ATI graphics card on FC5 64bit 144419855310001 Fedora 15 05-12-2006 05:22 AM
Problem since upgrade to FC5 and use of my new router rconan Linux - Networking 7 03-28-2006 09:46 AM
Setting up a router ... SaintsOfTheDiamond Linux - Networking 19 01-29-2006 02:19 AM
Setting up a router. iammike General 1 10-09-2004 03:09 PM

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

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