Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everybody, My PC has internet access through broadband connection. I need to share the internet to many other PCs connected through LAN. To give permissions to other PCs (say ...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    8

    How to share my internet connection to other PCs

    Hi everybody,

    My PC has internet access through broadband connection. I need to share the internet to many other PCs connected through LAN.

    To give permissions to other PCs (say with IPs 192.168.0.205, 192.168.0.217), what are the required changes I need to do to squid.conf file?

    Regards,
    abailore

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by abailore View Post
    Hi everybody,

    My PC has internet access through broadband connection. I need to share the internet to many other PCs connected through LAN.

    To give permissions to other PCs (say with IPs 192.168.0.205, 192.168.0.217), what are the required changes I need to do to squid.conf file?

    Regards,
    abailore
    You need to do NAT using your iptables firewall (and start using iptables in case you are not doing so yet).

    For example, I have this in my iptables script:

    Code:
    #First we flush our current rules
    iptables -t nat -F
    
    #My net interfaces, this is probably the only thing you need to change
    LAN=eth1
    WAN=eth0
    
    #Finally we add the rules for NAT
    iptables -A FORWARD -i ${LAN} -s 192.168.0.0/255.255.0.0 -j ACCEPT
    iptables -A FORWARD -i ${WAN} -d 192.168.0.0/255.255.0.0 -j ACCEPT
    iptables -t nat -A POSTROUTING -o ${WAN} -j MASQUERADE
    This will redirect conveniently all the traffic to or from your local network to or from the internet.

    I don't know if squid will also requite some specific setup. I don't use squid myself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...