I have Linux Install and a Windows XP Machine. I'd like to:
1) I have an internet connection connected to the Linux PC and works fine , I want to share this connection with one of the windows PC's (bridge connection).
2) I want to browse the Windows workgroups and to connect to a shared printer connected to one of the Windows computers also i want others to be able to browse the Linux PC.
make a file named 'rc.nat' and put the following script in it.
Now save this rc.nat in /etc/rc.d/ and make it executable byCode:# Defines the location of iptables executables. iptables=/sbin/iptables #Clears if any old iptable rules/ policies are there. iptables --flush -t nat # Now we will do Masquerading ie. we are doing NAT. iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE iptables --append FORWARD --in-interface eth0 -j ACCEPT # Enabling packet forwarding. echo 1 > /proc/sys/net/ipv4/ip_forward
Now add the following lines in your /etc/rc.d/rc.local so that every time you start your computer it get executed automatically.Code:chmod 755 /etc/rc.d/rc.nat
Now in your clients make sure you have set the gatway as the ip of your computer which is connected directly to internet and also that you have entered right nameserver (DNS) in the dns list of clients.Code:/etc/rc.d/rc.nat
Now you should be able to share internet after executing this script.
Source
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks