Main Workstation as a router
Hello everybody,
so i am running Fedora in my main workstation, which is always awake and doing most of my work in it. This box has a wireless internet connection with my ADSL router, cause of the long distance from my room. But i need somehow to share this connection to other boxes with the ethernet connection. I ve got a 8port switch and i want to connect to the main box and connect other boxes to this switch so they 've got internet. How should i do this? How should i configure my main box, to share the wireless connection to its ethernet subnetwork? Iptables? Routes? Thank you in advance |
Basically iptables... and set your boxes to use the internal IP of your linux box to use it as default gw.
Then, in the linux box, make sure that there's a rule or policy in FORWARD that will this packets coming from these boxes to go through and add this rule to your linux box: Code:
iptables -t nat -A POSTROUTING -o internet-interface -j MASQUERADE And make sure that /proc/sys/net/ipv4/ip_forward is set to 1: Code:
cat /proc/sys/net/ipv4/ip_forward |
Allright, great thank you a lot eantoranz.
now please a few questions. My main box is acting as a router. First what these means? Quote:
and in the system-config-firewall i had allready enable the MASQUERADE option for my internet interface but i had to pass it to iptables too to work. Why is that?? thanks again in advance |
Code:
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0 It should be Code:
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0 About DNS... well, I guess!... If you have set up a dhcp service, you can tell them to use whatever DNS you like from there so you don't have to go through each box to configure it. If you are using static IPs, then you are busted and will have to do it by hand. And about the firewall configuration: I have nooooo idea. In general I like to set up my netfilter (aka iptables) stuff by hand. |
Could install a small VM that has all the firewall features you want too then run it as if it were a dedicated box. Might look at untangle.com's firewall, already made in a VM at vmware.
|
Quote:
here's ip's output. the whole configuration is working normal. But i haven't restart my pc yet, i should do that too. Thank you again |
I would tell you to remove the last line as it doesn't work... as a matter of fact, it's kind of crazy given that you won't find that router (192.168.1.254) on dev eth0.
|
All times are GMT -5. The time now is 06:52 AM. |