LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   DHCP server and LAN setup in LINUX (http://www.linuxquestions.org/questions/linux-server-73/dhcp-server-and-lan-setup-in-linux-812416/)

mangup 06-06-2010 02:01 AM

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.

ComputerErik 06-06-2010 01:27 PM

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?

mangup 06-07-2010 01:27 AM

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...

ComputerErik 06-07-2010 08:27 AM

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.

mangup 06-08-2010 01:23 AM

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...

koflanagan 06-09-2010 02:26 PM

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.

ComputerErik 06-09-2010 09:32 PM

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.

mangup 06-10-2010 05:36 AM

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??

ComputerErik 06-11-2010 07:51 PM

Quote:

Originally Posted by mangup (Post 3998772)
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)?

mangup 06-13-2010 01:55 AM

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..??


All times are GMT -5. The time now is 04:47 AM.