LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-06-2010, 03:01 AM   #1
mangup
LQ Newbie
 
Registered: May 2010
Posts: 9

Rep: Reputation: 0
DHCP server and LAN setup in LINUX


Hi sir...

My DHCP conf. file is :

#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
ddns-update-style none;
default-lease-time 3600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option domain-name "ngouts.com";
option domain-name-servers 192.168.1.200;
option routers 192.168.1.200;

subnet 192.168.1.0 netmask 255.255.255.0

{

range 192.168.1.202 192.168.1.254;

host www.ngouts.com {

hardware ethernet A0:00:00:04:C7:64;

fixed-address 192.168.1.103;

}

}

There is an ADSL broadband router before the linux router. (This linux box will act as a router as well as DHCP server). Is it necessary to configure DHCP server to provide Internet access to all the LAN users? If not so, I will not need the DHCP server. Any way I need to distribute the Internet to all LAN users and I need to control some sites form their access. So the same box will be configured as a Firewall as well.

The clients are MS windows user. So i went to the client and oped the dos command mode. I issued the command :
ipconfig and it gives the output:
Connection-specific DNS suffix : ngouts.com
Physical address:
IP address: 192.168.1.252
Subnet mask: 255.255.255.0
Default Gw: 192.168.1.200
here ngouts is my dns name. 192.168.1.252 is the valid ip address given by the dhcp server. But if i ping 192.168.1.200, the output comes as a request time out.
if I ping 192.168.1.252 from the linux to ms client, the same error.
the ping is not blocked. Any page cant be opened from the clients.
There are 2 NIC. eth1 ( 192.168.1.200 )is connected to INTERNET and eth0 (192.168.1.201) to LAN switch.

MS client is configure to Obtain IP automatically. So what can be the problem here.

Last edited by mangup; 06-06-2010 at 03:05 AM.
 
Old 06-06-2010, 02:27 PM   #2
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 268

Rep: Reputation: 42
Why do you have two interfaces on the same subnet? If you want the Linux machine to act as a router/firewall it would need to have to have two interface and be configured to do NAT.

Is DHCP turned off on the DSL router? Is the Linux server configured to do routing?
 
Old 06-07-2010, 02:27 AM   #3
mangup
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
DHCP server and LAN setup in LIN

DHCP is turned on the DSL router but this linux box is configured to
have fixed private ip i.e. eth0 :192.168.1.200 and eth1 is
192.168.1.201. So I am trying to NAT in these two interface but not
been able. Here eth0 is linked to DSL router(Internet connection) and
eth1 connected to switch to provide the internet in the LAN.
Linux server is configured to serve as a router. I think this much is
sufficient to do so.
#vi /etc/sysctl.conf
#### # Controls IP packet forwarding
net.ipv4.ip_forward = 1

#### Controls source route verification
net.ipv4.conf.default.rp_filter = 1

all other lines are left as it is.

Do I need to have different subnet for two interfaces??

The client is obtaining the IP of the given range but can't ping and
no chance of web site browsing....
So what can be the reason and the solution sir...
 
Old 06-07-2010, 09:27 AM   #4
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 268

Rep: Reputation: 42
What is the DSL router IP?

Yes you do need different subnets on each interface in order to do NAT or any routing on the Linux server. What are you hoping to accomplish, since it seems like you already have a router in place connecting you to the outside world? In general for a simple setup you would have your router/firewall setup with one interface connecting to the internet and the other to your internal network.

Since you already have a device connecting you to the internet (which pretty much can't get changed since it is also your DSL modem) you have a couple of options. You could reconfigure your DSL router to act as a modem only (possibly not an option) or setup your Linux box to do an additional NAT for certain (or all) internal users.

Depending on what you really want to accomplish the setup will be different.
 
Old 06-08-2010, 02:23 AM   #5
mangup
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you for the help sir..
DSL router is not getting the Public IP. It connects to the Internet by dialing a user name and password (i.e. PPPOE account). The default private IP of DSL router is 192.168.1.1.

The linux box will work as a dhcp server as well as as firewall, because I want to block some specific sites from only some LAN users. Others will enjoy every sites. So this is not possible from the DSL router and I can;t go for more expensive routers such as CISCOs.

I can't configure the DSL router as a modem only coz there are some wireless users with laptops who enjoy the Internet via wireless.

So, what I want is :

I want to give internet to both wireless as well as wired users. I want to control some sites from the wired users. Thus I am configuring linux as a router as well as firewall. The wired users will get the internet via the linux router. Thus they will pass through the linux firewall. The same site which is blocked for wired users will be available to wireless users.

In a sense , my LAN looks like two LANs. One wireless and one wired.
Now, what i have done till now.
I have 2 NIC cards: eth0 =192.168.1.200 which is connected to DSL router.
eth1=192.168.1.201 which is connected to a switch for wired LAN usrs.
eth0 and eth1 are given the fixed private IP.
I have configured a DNS, DHCP, APPACHE, FTP servers coz I need a FTP servers as well.
So, what can be done and how it be accomplished. ....this is taking my breath away..
please help me sir...
 
Old 06-09-2010, 03:26 PM   #6
koflanagan
LQ Newbie
 
Registered: Mar 2005
Location: San Antonio
Posts: 20

Rep: Reputation: 0
I think this is what you are wanting/trying to do?

DSL router = 192.168.1.1
Linux Box = 192.168.1.200 (eth0) & 192.168.2.1 (eth1)
Connect eth0 into DLS router or hub/switch it is connected to
Connect eth1 into different hub/switch
Connect clients to the same hub/switch that eth1 is connected to.

Last edited by koflanagan; 06-09-2010 at 03:44 PM.
 
Old 06-09-2010, 10:32 PM   #7
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 268

Rep: Reputation: 42
If all you really are looking to accomplish is block certain sites you are probably best off just connecting one interface of the Linux machine, installing Squid, and configuring the browsers to use the proxy.

At least part of your problem is that there is a DHCP server running on the DSL router already, and you are trying to bring one up on the Linux machine to run one as well. Having two DHCP servers on the same network trying to assign the same addresses will give unpredictable results.

If you want to move forward with the Linux as a gateway for all wired traffic you will need to change the IP of one of the interfaces as in the above post. Then enable routing, and bind DHCP to the new subnet. You will still need Squid anyway to handle filtering the web traffic.
 
Old 06-10-2010, 06:36 AM   #8
mangup
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Thank u very much sir
Finally , your idea worked. I assigned different subnet to two interfaces and it worked. Now I can access internet form any computer in the LAN. I have directly connected my linux router to DSL router with cross-over cable. does it work if i connect with straight through as well? I haven't tested yet. Now I will go for ftp and web server and I will configure squid as well.
But one problem is that, in this configuration, the Internet usually gets disconnected in the clients computers (in about 5-6 minutes). What problem may be this??
 
Old 06-11-2010, 08:51 PM   #9
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 268

Rep: Reputation: 42
Quote:
Originally Posted by mangup View Post
Thank u very much sir
Finally , your idea worked. I assigned different subnet to two interfaces and it worked. Now I can access internet form any computer in the LAN. I have directly connected my linux router to DSL router with cross-over cable. does it work if i connect with straight through as well? I haven't tested yet. Now I will go for ftp and web server and I will configure squid as well.
But one problem is that, in this configuration, the Internet usually gets disconnected in the clients computers (in about 5-6 minutes). What problem may be this??
What specifically do you mean by disconnected? Can you ping the gateway? Can you ping the DSL modem? Can you ping an internet destination (4.2.2.2)?

How is the DSL modem configured (some can do a disconnect after X minutes of idle)?
 
Old 06-13-2010, 02:55 AM   #10
mangup
LQ Newbie
 
Registered: May 2010
Posts: 9

Original Poster
Rep: Reputation: 0
thanks sir
disconnected means the page cant be displayed and no clients ping neither the linux router nor the gateway after 5/6 minutes. And this was not a big problem which was solve itself..after rebooting the server and clients as well as DSL router. I dont know how it happened.


Thanks for ur support and now i am going to install SVN in linux. I came to know that there is no exact svn which can be installled in linux. So i am trying to install esvn which is creating the problem of package dependencies of packages. ...Is there any module that can work as svn and compatible to linux..??
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
dns and dhcp server on lan - what's the correct setup? bruceh Linux - Networking 1 08-09-2009 08:56 AM
HELP: how to setup a linux DHCP proxy server andwan0 Linux - Server 1 01-14-2009 05:12 PM
trying to setup linux firewal/dhcp server but its not sharing the internet connection abefroman Linux - Networking 4 05-01-2005 05:39 AM
setup a linux box to act as file server in LAN? sabex Linux - Newbie 12 02-07-2005 06:35 PM
How do you make the ip masquerade server/dhcp server broadcast dns to lan cmisip Linux - Networking 6 01-25-2003 11:43 PM


All times are GMT -5. The time now is 06:50 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration