LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-07-2008, 07:00 PM   #1
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Rep: Reputation: 32
Exclamation How do I configure a proxy and DHCP server


Hi all,

So I am trying to configure my CentOS 5.0 server as a proxy and DHCP server. So far my investigation and digging into how to setup one of these puppies requires Squid and the configuration of /etc/dhcpd.conf file. Now I am Googling what I can but if anyone has setup a proxy and DHCP server and can point me in the right direction or even to a tutorial that would be great!

Thanks in advance!
 
Old 09-07-2008, 07:43 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
For DHCP http://www.linuxhomenetworking.com/
 
Old 09-10-2008, 07:37 AM   #3
dbmacartney
Member
 
Registered: Mar 2007
Location: London, UK
Distribution: Debian, Red Hat Enterprise, Fedora
Posts: 70

Rep: Reputation: 15
to install squid, run "yum install squid"

set it to start up on boot
"chkconfig squid on"

What kind of idea did you have for your squid deployment? transparent, authenticated, did you wish to allow or deny specific sites/networks/users??
 
Old 09-11-2008, 02:46 PM   #4
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Original Poster
Rep: Reputation: 32
Exclamation CentOS 5 with Poxry-> Squid and DHCP Server

Thanks for the replies!

DHCP SERVER
First off I am having some difficulties with the DHCP server. I have Googled many different tutorials but they all are different. They have many similarities but none are consistently the same. Here is how I plan to setup my DHCP server:

I used this site as a guide: http://www.howtoforge.com/home-gatew...haring-centos5


dhcpd.conf Configuration

This is how I think my dhcpd.conf should look:
Code:
ddns-update-style none; # keep it simple for now
ignore client-updates;  # here too
DHCPARGS=eth1;          # tells it what interface to listen on
subnet 192.168.0.1 netmask 255.255.255.0 {
# --- default gateway
       option routers                  192.168.0.2;   # gateway on your eth1 internal interface
       option subnet-mask              255.255.255.0; # subnet mask
       option domain-name              mydomain.com; # domain name given to client
       option domain-name-servers      192.168.0.1; # the IP of your ISP's nameservers you're using
       option time-offset              -7;        # Mountain Standard Time - set to what you have
       range 192.168.0.10 192.168.0.254;             # the range of IP's your clients will get
       default-lease-time 21600;                      # how long the client's will keep the same IP
       max-lease-time 43200;
}
eth0 configuration
eht0 is the NIC that has connects to the ISP
Code:
eht0
IP: 192.168.0.100 (static, maybe DHCP)
Gateway: 192.168.0.1
Primary DNS: 192.168.0.1 OR ISP 64.59.133.133
Secondary DNS: 192.168.0.1 OR ISP 64.59.133.135
Subnet: 255.255.255.0
eth1 configuration
configuring eth1 is confusing me a little.....
eth1 allocates DHCP addresses and forwards traffic via eth0
Code:
eht1
IP: 192.168.xxx.xxx
Gateway: 192.168.xxx.xxx
Primary DNS: 192.168.xxx.xxx OR ISP 64.59.133.133
Secondary DNS: 192.168.xxx.xxx OR ISP 64.59.133.135
Subnet: 255.255.255.xxx
ifcfg-eth1 Configuration
emacs /etc/sysconfig/network-scripts/ifcfg-eth1
Code:
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.0.1
NETMASK=255.255.255.0
GATEWAY=192.168.0.100
So, if anyone could confirm or help me with my DHCP server settings that would be great. I manage to get my server to serve DHCP but I don't get internet access. I am guessing my gateway, subnet or IP is wrong.

--------------------------------------------
--------------------------------------------

SQUID
As for Squid well I just wanted to use it to cache anything done on the internet. I am going to use this server in a technician bay so we can store updates and files we use a lot, that way when I have 10 computers on the tech bench they all access the same server and download via the cached info.

This is the guide I used: http://www.cyberciti.biz/tips/howto-...iguration.html

Here is what I have done so far:
emacs /etc/squid/squid.conf
Code:
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks
I then ran the IPtables settings and restarted squid. I haven't go to test this yet since my DHCP server isn't working yet. I did notice that the change to IPtables didn't save. I will working on that when I get there.

--------------------------------------------
--------------------------------------------

dbmacartney, I will do a little more research but could you explain to me there different types of porxy servers? based on what I want this server for maybe you can narrow down the type of proxy I should be using.

Quote:
What kind of idea did you have for your squid deployment? transparent, authenticated, did you wish to allow or deny specific sites/networks/users??
Thanks again for your replies!
 
Old 09-11-2008, 03:23 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
DHCP is reasonably simple, so go to a client machine and type "ifconfig" and see if it looks like it's getting what it needs (valid IP, etc). It probably is.

On you server, what is the value of

cat /proc/sys/net/ipv4/ip_forward

If it isn't "1", try

echo "1" > /proc/sys/net/ipv4/ip_forward
 
Old 09-11-2008, 10:18 PM   #6
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Original Poster
Rep: Reputation: 32
Question CentOS DHCP Server - no internet

Hi all,

Thanks billymayday for the reply. I did do that in the original setup but it seems as though it didn't save. I did edit the file /etc/sysconfig/network so that is has the following line:

Code:
HOSTNAME=domain.com
NETWORKING=yes
FORWARD_IPV4=YES
Still no internet..... Any idea why the file change wouldn't save? The Kernel should see that I have added that line.
 
Old 09-11-2008, 10:24 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You probably need to put the echo statement in rc.local so it is re-executed on startup
 
Old 09-11-2008, 10:25 PM   #8
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Original Poster
Rep: Reputation: 32
Haha, how do I do that?
 
Old 09-12-2008, 10:48 PM   #9
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Original Poster
Rep: Reputation: 32
billymayday or someone else would i add this statement to the rc.local?

Quote:
You probably need to put the echo statement in rc.local so it is re-executed on startup
i also have found that some people try adding a line to the /etc/sysctl.conf however in my case that did not work.
 
Old 09-13-2008, 10:16 AM   #10
martinezjr
LQ Newbie
 
Registered: Aug 2008
Location: Texas
Distribution: F14, F15, F19, openSUSe12.2,openSUSe12.3
Posts: 16

Rep: Reputation: 0
I see that you have put a lot of time and effort into making you box work, but try IPCOP (www.ipcop.org). It offers all that stuff already configured plus alot of addons.
 
Old 09-13-2008, 04:23 PM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Edit /etc/rc.local and put an exact copy of the line at the end.
 
Old 09-15-2008, 03:57 PM   #12
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Original Poster
Rep: Reputation: 32
Thanks martinezjr, I will look into that once I have accomplished setting up my DHCP server. When I get it up and working it is another piece of the open source world I can give back and help someone else with... Plus its just good to know!

billymayday, I will try what you suggest and see if that helps. Thank you very much for your help thus far!
 
Old 03-17-2009, 04:32 PM   #13
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Original Poster
Rep: Reputation: 32
Question DHCP and Proxy Server with Dual NICS

Hi Billymayday (and others)... I am finally going to re-attempt my DHCP and Proxy server setup. I wanted to clear up a few things first:

1) my server has dual nics, eth0 and eth1
2) I would like eth0 outward facing, meaning it plugs directly into my cable modem and sits between the internet and my home network
3) I would like eth1 to connect to my internal network, thus providing the computers connected via eth1 through a switch with DHCP and Proxy access (probably and most definitely firewall services as well)

The link you gave me Linux Home Networking, looks as though they only show this setup on one NIC, I need someone to help or provide me with a link that shows an example of how I want to setup my DHCP server...

Any ideas, maybe the link you gave me does explain exactly this and I am just not getting it? I really need someone to "hold my hand."

Thank you in advance!
 
Old 03-18-2009, 02:33 AM   #14
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You're going to have to give us an update on exactly where you are at I think.

In terms of dhcp though, if you have 2 NICs, one with an IP of 192.168.0.1 (external) and the other 192.168.1.1 (internal), I have my dhcpd.conf set up along the lines of:
Code:
subnet 192.168.0.0 netmask 255.255.255.0 { }

subnet 192.168.1.0 netmask 255.255.255.0 {

normal dhcp options go here (range, etc.)
}
 
Old 03-18-2009, 10:37 PM   #15
bskrakes
Member
 
Registered: Sep 2006
Location: Canada, Alberta
Distribution: RHEL 4 and up, CentOS 5.x, Fedora Core 5 and up, Ubuntu 8 and up
Posts: 251

Original Poster
Rep: Reputation: 32
Ok, I will post back once I have got all the info... I have a test machine that I am going to reset and record all my steps then post back in the next couple of days.

Thanks Billymayday
 
  


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
How to configure DHCP server for ( 1 server + 500 Clients) in RHEL 4 paulin Linux - General 4 07-18-2007 08:33 AM
Configure dhcpd (Configure DHCP Server) hanserver2004 LinuxQuestions.org Member Success Stories 3 10-23-2006 06:39 AM
configure redhat enterprise server 4 as Router and Proxy server amdattani Linux - Networking 0 06-15-2006 05:50 AM
All in one Proxy Server, DHCP server & Router binary1011100 Linux - Networking 1 05-08-2006 11:18 AM
Configure dhcpd (Configure DHCP Server) hanserver2004 General 1 08-16-2004 01:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:21 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