Go Back   Linux Forums by TotalPenguin! Get linux Help! > Linux > Linux Networking

Linux Networking This forum is for Linux Networking Only. Routing, servers, etc.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-2007, 06:44 PM
Member
 
Join Date: Dec 2006
Posts: 51
Grub is on a distinguished road
Default Internet Sharing

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.
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-17-2007, 07:33 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 570
Jordan is on a distinguished road
Default

make a file named 'rc.nat' and put the following script in it.

Code:
# 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 save this rc.nat in /etc/rc.d/ and make it executable by

Code:
    
chmod 755 /etc/rc.d/rc.nat
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:
        /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.

Now you should be able to share internet after executing this script.

Source
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What kind of Internet Connection do you have? Lop General/Lounge 27 12-04-2008 03:36 PM


All times are GMT. The time now is 04:41 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.