LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up FC5 to be a router (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-fc5-to-be-a-router-470572/)

anibis 08-03-2006 07:53 PM

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.

friskydrifter 08-03-2006 10:28 PM

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

peter_robb 08-04-2006 08:48 AM

Have a look at the BIG iptables tutorial for complete help.


All times are GMT -5. The time now is 07:43 AM.