LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2011, 06:20 PM   #1
operat0r
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Rep: Reputation: 0
Question Setting up squid proxy to virtual linux soho router


Hello, First of all i'll give you the topology of what i need to implement.

http://img805.imageshack.us/i/topology.png/

Ok... so to start i must make this work with the use of virtual pc's. I have vm player and installed fedora ( the latest version ) and one xp . So i have 2 virtual pc's. I'm making it simple for start so i can add more pc's when i see that it is working.
I have setup a dhcp server at the fedora virtual pc. The fedora virtual pc is like a soho router. The xp pc is getting ip from dhcp while the fedora one has a static one.
My pc is behind an adsl router.
Both virtual pc's can see each other which means i have no connectivity issues.
My question is the following.
Im trying to setup a squid proxy ( transparent one ) so for example the xp pc can access porn sites and such. I used all required configuration for the squid to work and started the service. Ive also inserted with iptables the commands to forward all incoming port 80 packets to port 3128 ( the squid ). It doesnt seems to be working and i thik i know why but i dont know how to fix it.
Because the xp has a gateway at 192.168.1.1 ( the adsl router ) packets go directly to it and not to the soho router ( fedora virtual pc as i intend to do) What can i do to solve this problem ?
How can i forward all packets to go to the fedora virtual pc first and then the fedora pc to forward them (if necessary) to the adsl router?
PS. I used Bridged connection on the networking configutration on the vmware player ! If you also want i can post the code for squid or iptables if needed !

I would appreciate all help. Thanks a lot.
 
Old 04-02-2011, 09:43 PM   #2
operat0r
LQ Newbie
 
Registered: Mar 2011
Posts: 4

Original Poster
Rep: Reputation: 0
I finally got it working

I fiured it out how to make it work ... here are the commands that helped me... Maybe they'll be of some use to another with a similar problem ! Thnx anyway

Code:
# Enable IP Forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

# Clean up iptables (flush it)
iptables -F
iptables -t nat -F
iptables -X

# Enable IP MASQUERADING/NAT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

# Set firewall policies (default behaviour)
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

# Allow all connections not from eth1
iptables -A INPUT -i ! eth1 -j ACCEPT

# Allow all ICMP connections (like ping)
iptables -A INPUT -p ICMP -j ACCEPT

# Allow all already established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
squid proxy server virtual nic mhekela Linux - Newbie 3 12-26-2010 03:41 PM
squid proxy+ virtual host question frieza Linux - Networking 11 03-03-2009 04:01 PM
setting download limit in squid proxy jomy Linux - Networking 2 12-06-2004 07:13 AM
help me in setting squid proxy sanam Linux - Networking 1 03-01-2003 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration