How to config my Linux machine to be my proxy etc.


I got a machine on which I installed RedHat 6.1, and I want it to act as a proxy server, but haven't the slightest clue as to how to do this, and I know next to nothing about UNIX/Linux.
(lol though I do know 'pico', nice little editor which is about the only thing I understand) :)
I got my network card to work, and when pinging to and from my machine all went fine, and when entering its IP address in a browser it displays the default web page... but... how can I tell it to act as a proxy server, so that I can hook up my cable modem to my Linux machine instead of to a seperate (Windoze) proxy server...
And how can I connect from a Windoze PC to my Linux machine, and the other way around, from my Linux machine to a Windoze PC (someone mentioned "smbmount" when I asked someone else before). (over a LAN beats the heck out of copying everything on floppies... specially when things get bigger in size)
Well that's about all I can think of for now....

(I know, I'm probably better off buying a book and learning about Linux) :)

And as you might have noticed, this is not the notorious CJ_S, but mgdPaul who has run out of points and needs to ask a big question :)

Thanks a whole lot in advance,

LVL 22
Who is Participating?
Oh that's lots of questions all rolled up together. I'd suggest that we start by getting the inside network functioning at the TCP/IP level and then take on setting the Linux system up as an Internet gateway.

I can't tell from the question exactly what your network configuration is at present. You do need the Linux system's ethernet (NIC) connected to the windoze box's NIC, either directly by a cross-over cable or via a HUB. Both systems will need to be configured to be in one of the "private reserved" networks. A decent choice would be, which would mean that one system would get the IP and the other could be If you've got everything right each system should be able to ping the other by IP address. The winoze box will need its default gateway pointing to the inside NIC of the Linux system ( perhaps) and it's nameserver entries set to that of your cable modem provider's DNS.

The next step would be to install a second NIC in the Linux system and get it talking to the cable modem (probably using DHCP). Two NIC's can require special configuration and I suggest that you read the Ethernet-HowTo to find out what to do and how to go about it. Depending on who your cable modem service is with, you may be able to get Linux "on the air" easily, or you might have problems. Setting up the outside NIC for DHCP is most easily done with linuxconf.

Once you've got both NIC's up and running, you'll need to set up IP Masquerade, and that's covered by the IPMasquerade-HowTo and the IPchains-HowTo.

All of the Howto's can be seen on-line at Redhat's site ( and at, as well as at a lot of other mirrors.
CJ_SAuthor Commented:
I'm sorry, forgot to mention that didn't I? (my network config) :)

My current Windoze proxy server's IP is (my neighbour set all this up, but since everything's under my maintenance I can change whatever I like) :)
My Linux machine has the IP
My own PC has the IP
My neighbour's IP is
Hmmm think I threw in some useless info but oh well :)
I don't know if you need to know my network card's settings too, but I suppose not..... :)
My Linux machine is connected via a HUB to all of the other computers I mentioned... I don't know if 169.254.100.x is a 'private reserved' network, but Windoze came up with it once so we kept it :)
All systems can ping eachother, and the proxy server config as it is works, I just want to change this for several reasons :)
My cable modem is hooked up to a COM port and well.... what else can I say about it..... lol it needs "4" as phone number to dial in :)

I don't know how I can tell the Windoze machines to have its default gateway pointing to inside the NIC.... um probably cause I am confused by all the terms here :) Just means I have to tell all my machines that the internet connection is going through a proxy server, and give the IP address? (I hope so, cause that I know how to do) :)

I already hooked my cable modem up to my Linux machine once before and I got it to connect and I surfed the Internet for a while, so that already works... and since my cable modem uses a COM port I don't need a second ethernet card I hope :) (though soon I hope to be getting ADSL and I _would_ need a second ethernet card) :)

Thanks a whole lot for your answer :)

(and again this wasn't CJ_S) :)
Are you sure you really want a proxy server? Squid is a proxy server for Linux, but on a small network, it seems a waste...even a performance bottleneck.

Your Linux box can serve as a default gateway for your network and masquerade the private (non routable) IP's you assign each of the other machines.

You say you are having trouble figuring out how to setup the Windows machines to use the default gateway? Linux Network Toolkit by Paul G.Sery, published by IDG Books is getting a bit dated (comes with a copy Of RedHat 5.0) but is still useful. Most of the book is oriented toward providing Windows clients services via Linux servers. You might want to get it.

Another book worth looking at -- and FREE to download as a PDF file is the e-smith users guide at

The e-smith server is a RedHat distribution, tweaked and modified to almost automatically configure itself as a gateway/router, samba file and print server, web server, and mail server.

The manual, starting on page 28, details setting up Windows machines to use the default gateway router -- which is what you are trying to configure.

E-smith also acts as a proxy server if you want -- again automatically -- just point the Windows box at port 3128 on the gateway.  

The book gives you a brief rundown of the pro's and con's of using a proxy versus a direct masqueraded connection.

It is worth a read.
Thanks for the tips! :)

But yes I'm sure I want a proxy, it's not really for me but more as a service to my neighbours.... I more than noticed already that it's a performance bottleneck, but oh well I can live with it.
Please follow jlevie's advice and choose a level 3 NAT rather than a level 7 Proxy. Read the ip-masquerading and ip-chains howtos' in order to config. Steps to take: install IP-masq en IP-chains packages, enable IP-forwarding, insert IP-chains-rules, config gateway and DNS on clients. Succes!
PS, don't skip the security issues in the howto's!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.