How to make Fedora core 4 machine work as a router with 2 LAN cards?

Posted on 2006-05-02
Medium Priority
Last Modified: 2012-08-13
I've Fedora core 4 installed on my desktop pc at home with 2 Lan cards. I've 2 windows machine too at home and am using Cable Internet connection.
I want to setup the Linux box to work as a router. Tried connecting one NIC configured with DHCP and connected to Cable modem.
Other NIC is assigned and connected to hub. Windows machines are assigned and 1.3.
And one of the NICs is becomes inactive automatically always.

I did tried setting ip_forward=yes in iptables and later also tried disabling the firewall too but the fedora box did not work as router.

Question by:lagooy

Expert Comment

ID: 16586957
The following commands should do the trick for you, assuming that eth0 is connected to your cable modem.

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

The MASQUERADE target in iptables is prefered if you have a dynamic IP setup, if you had had a static
IP it is prefered to use the SNAT target (read the manual page for iptables for a more through story
of what they both do).

More information in the NAT HOWTO:
LVL 17

Expert Comment

by:Dushan De Silva
ID: 16588208
Following link will gives the answer.


BR Dushan

Accepted Solution

David-VC earned 600 total points
ID: 16710317
You might try downloading and installing Webmin (www.webmin.com). Turn the firewall off and then configure it using webmin (Networking --> Linux Firewall). When you do inital firewall setup with Webmin it will ask you what kind of firewall you want to setup, choose "Do network address translation on external interface: <choose the network card that is connected to the public IP address here>. Once setup it will configure a somewhat secure firewall. Open any additonal ports you may need (including 10000:tcp for Webmin).

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month15 days, 22 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question