LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   dhcp??? (https://www.linuxquestions.org/questions/linux-networking-3/dhcp-399253/)

gigsz 01-03-2006 09:16 PM

dhcp???
 
ey is it possible that my linux machine will dynamically give the dns servers for the client connecting to it...

i have two internet connection.. first is xxx.xxx.xxx.1 and the second is xxx.xxx.xxx.8

the dns server for .1 is xxx.xxx.xxx.11 and xxx.xxx.xxx.10

theh dns server for .8 is xxx.xxx.xxx.223 and
xxx.xxx.xxx.224

so is it possible that i configure my client to obtain an ip address automatically and with xxx.xxx.xxx.5 (linux machine) as the gateway and it will change its dns servers to the connection (.1 or .8) being used???

thanks....

acid_kewpie 01-04-2006 02:49 AM

well yes, that's exactly what DHCP is designed to do. you might want to look at a painfully simple implementation like dnsmasq over the more complex dhcpd

Mishra100 01-04-2006 08:04 AM

If those IPs are on seperate networks then you will have to setup routing between them. If you have two internet connectons then I would guess you have two different networks. They need to be able to talk to each other. If you want clients to recieve DHCP addresses on totally different networks, you will need seperate DHCP servers (or at least seperate interfaces on your dhcp server).

flashingcurser 01-04-2006 05:08 PM

You should be able to do this with one nic and dnsmasq.
1 set up an alias interface like eth0:1 (eth0 on one subnet eth0:1 on the other)
You will have to google a little for your distro.
2 create copy the dnsmasq.conf rename one of them to somthing like dnsmasq2.conf
3 edit each dnsmasq.conf's to their specific functions
4 start dnsmasq something like:
/usr/bin/dnsmasq -C /etc/dnsmasq1.conf -i eth0 && /usr/bin/dnsmasq -C /etc/dnsmasq2.conf -i eth0:1
5 test
6 edit your startup scripts accordingly.

:)

dan

assacin 01-04-2006 05:33 PM

Hello,
I guess u r asking about DHCP & not DNS. This can be solved if u configure the servers as DHCP servers & your clients as DHCP clients. If u want to configure your client machine as a DHCP client then issue #chkconfig as root & tell it to assign IP automatically or frm DHCP server for eth0 interface.
Hope it will solve your probs...

Happy Computing :-)

gigsz 01-05-2006 12:19 AM

thanks for the help..

ey, acid_kewpie mentioned that dhcpd is more difficult than dnsmasq.. wel i have no luck with dnsmasq because i cannot install it... the howto of dnsmasq on the net is not that easy to undestand.. anyway... the dhcpd.conf file has xxx.xxx.xxx.8 as my default gw of my router.. and when i manually change my default router to xxx.xxx.xxx.1 and start the dhcpd, it does not change back to xxx.xxx.xxx.8... or is this just normal...

and also it is possible to configure my dhcpd to have 2 gateways with different dns servers for each gateway?

acid_kewpie 01-05-2006 12:35 AM

it doesn't make sense to have a different dns server for each gateway, as it's not until after you have finished with dns that you have the ip address of the destination and can therefore decide which gateway to use.

gigsz 01-05-2006 12:53 AM

here's the set.up...

the network has 2 internet connections .8 and .1 the linux box is configured as a router on some pc within the same network... the 2 connections have different dns servers... so what i want to do now is to change the dns server for the client if one connection is down... the dafault gw now is .1 with .11 and .10 as dns servers.. so if .1 is down, i want .8 to become the gw with .25 and .26 as dns...

is this possible?

i'm not really good at networking so forgive me if how i explain my problem is not that easy to understand...

=)

acid_kewpie 01-05-2006 01:45 AM

just set resolv.conf to use dns services from both networks.

gigsz 01-05-2006 02:14 AM

ok.. i'll see if it works.. thanks


All times are GMT -5. The time now is 03:59 AM.