Solved

DHCP for 4 NIC

Posted on 2004-09-13
12
420 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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to add a new SAN disk to a linux vmware box 8 22
IPA and Samba (and NFS and Samba....) 1 87
Cron jobs 12 89
Squid Authentication 7 32
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now