-
Windows Through Linux
I have a question about networking a Windows box through a Linux box to allow the Windows pc to access the internet. I myself use Linux but my fiance does a lot of graphics work so she needs her Windows pc, she currently has it offline but I would like to get it online via my Linux box. My pc connects direcly to the internet via a cable modem. Can I get her pc online by installing a second nic card in mine and having mine act as a router?
-
You could, but it would be cheaper (or at least the same cost) to just buy a router. I paid about $49.95 for a D-Link wireless router ( 4 port by the way) and I am sure that a regular wired router would be much cheaper. And you get the extra protection of a hardware firewall that way also.
-
If you don't want to listen to the old Pre-Dirt Cowboys wise words,
if your linux box is allready online all the time, add a nic
and add these lines to a runlevel..
Code:
WAN=ppp0
LAN=eth1
if [ -f /proc/sys/net/ipv4/ip_forward ]; then
echo "Activating IPv4 packet forwarding."
echo 1 > /proc/sys/net/ipv4/ip_forward
fi
echo -n "iptables "
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
echo "flushed"
echo -n "iptables "
iptables --table nat --append POSTROUTING --out-interface $WAN -j MASQUERADE
iptables --append FORWARD --in-interface $LAN -j ACCEPT
echo "NAT"
set the LAN and WAN to your lan and wan devices (ifconfig)
this is a realyy simple setup and won't do much good if your fiance wants to use P2P aplications, if you want a more advanced firewall ask about it, or search for it here on AO !