Solved

DHCP for 4 NIC

Posted on 2004-09-13
12
434 Views
Last Modified: 2010-03-18
I got 4 NIC, using Fedora Core...

eth0
ip: 222.222.222.222
netmask: 255.255.255.255
gateway: 222.222.222.220

eth1
ip: 192.168.1.1
netmask: 255.255.255.0
gateway: 192.168.1.1

eth2
ip: 192.168.2.1
netmask: 255.255.255.0
gateway: 192.168.2.1

eth3
ip: 192.168.3.1
netmask: 255.255.255.0
gateway: 192.168.3.1

i have active dhcp and dhcrelay at my Services Configuration

but i cannot see any dhcp.conf at my /etc but i found similiar to dchp where is /etc/log.d/conf/services/dhcpd.conf. but the dhcpd.conf only contains this:

###########################################################################
# $Id: dhcpd.conf,v 1.2 2002/10/12 02:08:09 kirk Exp $
###########################################################################

# You can put comments anywhere you want to.  They are effective for the
# rest of the line.

# this is in the format of <name> = <value>.  Whitespace at the beginning
# and end of the lines is removed.  Whitespace before and after the = sign
# is removed.  Everything is case *insensitive*.

# Yes = True  = On  = 1
# No  = False = Off = 0

Title = "dhcpd"

# Which logfile group...
LogFile = messages

# Only give lines pertaining to the dhcpd service...
*OnlyService = dhcpd
*RemoveHeaders

########################################################
# This was written and is maintained by:
#    Kirk Bauer <kirk@kaybee.org>
#
# Please send all comments, suggestions, bug reports,
#    etc, to kirk@kaybee.org.
########################################################

I already share the internet from eth0 to other NIC....and i try to connect client pc xp with one of this NIC and succesfully get the internet connection. but from the client i have to set the manual for network configuration. but i would like to make it dhcp....

thanks

0
Comment
Question by:emlily
  • 6
  • 6
12 Comments
 
LVL 10

Expert Comment

by:Luxana
ID: 12052071
HI


#EXAMPLE: /etc/dhcpd.conf


default-lease-time 86400;
max-lease-time 172800;
option domain-name "your_domain";
option domain-name-servers 192.168.1.1;
option routers 192.168.1.1;
#setting for eth1
subnet 192.168.0.0 netmask 255.255.0.0 {
        range 192.168.2.1 192.168.254.254;
}
#setting for eth0
subnet 10.0.0.0 netmask 255.0.0.0.{
       range 10.0.1.1 10.0.2.254;
}

is that what you need, to create dhcp for more subnets?
0
 

Author Comment

by:emlily
ID: 12061036
yeah...but for eth1 and others, i just need to add setting same like eth0? the eth0 is using static ip where it directly connect to the modem...the dchp only for other NIC except eth0
0
 

Author Comment

by:emlily
ID: 12061040
can you show me the example similiar to my configuration at my first message?
0
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
LVL 10

Expert Comment

by:Luxana
ID: 12061128
default-lease-time 86400;
max-lease-time 172800;
option domain-name "your_domain";
option domain-name-servers 192.168.1.1;
option routers 192.168.1.1;
#setting for eth1
subnet 192.168.0.0 netmask 255.255.0.0 {
        range 192.168.2.1 192.168.254.254;
}
#setting for eth0 for youe eth0 which is atached to modem just specify subnet and netmask and leave {} empty so #dhcp will be disabled on that particular subnet
subnet 222.222.222.222 netmask 255.255.255.250{  
}



0
 
LVL 10

Expert Comment

by:Luxana
ID: 12061145
emlily,

Why you are having eth1-3 on the same subnet? Why don't you use only eth1 to conect your clients as they all are on same network?

eth1
ip: 192.168.1.1
netmask: 255.255.255.0
gateway: 192.168.1.1

eth2
ip: 192.168.2.1
netmask: 255.255.255.0
gateway: 192.168.2.1

eth3
ip: 192.168.3.1
netmask: 255.255.255.0
gateway: 192.168.3.1
0
 
LVL 10

Expert Comment

by:Luxana
ID: 12061156
also I'm a bit confused;

you need to setup eth0-3 to use dhcp server or you want to run dhcp server on your subnets using eth1 eth2 eth3?
0
 

Author Comment

by:emlily
ID: 12061293
i dont know....what i know is the eth0 is spread the internet to orther NIC....

example for eth1, all the client of dhcp after i connect to the router will be 192.168.1.X.

so which proper way?
0
 

Author Comment

by:emlily
ID: 12061335
i mean which are the best setting for my situation. I using fedora for Linux router, where i split the office network, web server and ftp server.
0
 
LVL 10

Expert Comment

by:Luxana
ID: 12061605
emlily,

How many clients do you have on your network?
Here is the setting what you should use:

internet->eth0(externalIP)->translate externalIP to eth1 on subnet 192.168.0.1 using masqurade(or you can use proxy)->client

there is no point use one network car for each user so:

clients will get ip setting from eth1 whre will be your dhcpd service running lets say:
client 1:
ip:192.168.0.10
mask: 255.255.255.0
dns server 192.168.0.1
gateway 192.168.0.1

client 2:
ip:192.168.0.11
mask: 255.255.255.0
dns server 192.168.0.1
gateway 192.168.0.1

and so on...

http://www.faqs.org/docs/Linux-HOWTO/Firewall-HOWTO.html
0
 

Author Comment

by:emlily
ID: 12061696
i understand...the purpose i put the NIC is to separate the network. the eth1 i want to connected to the router. and from the router will do the dhcp to the client...

my question is how to do the dhcp for all the NIC by following my configuration above

thanks
0
 
LVL 10

Accepted Solution

by:
Luxana earned 50 total points
ID: 12062130
try have a look on this link there is the solution what you need:

http://www.experts-exchange.com/Networking/Linux_Networking/Q_21035744.html

also

http://www.experts-exchange.com/Networking/Linux_Networking/Q_21124494.html

emlily,

try first make dhcp server and internet sharing for one subnet if it works add more.

0
 

Author Comment

by:emlily
ID: 12186964
thank you
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question