LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where.. (https://www.linuxquestions.org/questions/linux-networking-3/eth0-ip-assigned-by-dhcp-how-would-i-know-the-ip-address-of-the-dhcp-server-where-443419/)

kublador 05-10-2006 07:38 AM

eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where..
 
eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where eth0 is connected?

thanks in advance :)

Artanicus 05-10-2006 08:26 AM

perhaps capture it with tcpdump? I can't think of any other way off the top of my head.

gbell72 05-10-2006 09:09 AM

You should be able to find the dhcp servers ip in /var/dhcpd/dhcpd.leases file.

NetAX 05-10-2006 12:51 PM

type "ifconfig eth0" on the command line and look at the broadcast address.

kublador 05-10-2006 04:52 PM

thanks .. ill try all of em :)

vimal 05-10-2006 08:38 PM

Hello kublador,

Check the /var/log/messages file. You will find the request for Ip from DHCP with the directive 'DHCP REQUEST', 'DHCP ACK'.. etc.. The 'DHCP REQUEST' is sent to the DHCP server. You can find the Ip from that particular line.
--------------
Sep 15 08:55:07 b5c1m4p204 dhclient: DHCPREQUEST on eth0 to \ 255.255.255.255 port 67

Sep 15 08:55:07 b5c1m4p204 dhclient: DHCPACK from 192.168.0.209
----------------

Here 192.168.0.20 is the DHCP server.


Thanks,,

kublador 05-10-2006 09:43 PM

kewl! thanks so much wooohooooo

Amuro-Ray2020 05-10-2006 11:43 PM

Generically speaking, you could assume that your default gateway is your DHCP server as well. That's usually (especially on cheap home use routers) where your DHCP is unless you have a dedicated computer doing it.

kublador 05-10-2006 11:59 PM

yup im aware of that one but i cant seem to find a way to get the ip of the gateway or the dhcp server

Amuro-Ray2020 05-11-2006 02:05 AM

Sometimes you'll see it if you type route. If not, you can do traceroute, generally your gateway should be one of the first hops.

kublador 05-11-2006 08:33 AM

yup, but im using pppoe , still no good.. please help hehe :)
im running slackware 10



# traceroute www.yahoo.com
traceroute: Warning: www.yahoo.com has multiple addresses; using 66.94.230.44
traceroute to www.yahoo.akadns.net (66.94.230.44), 30 hops max, 38 byte packets
1 210.x.x.x (210.x.x.x) 5.266 ms 5.863 ms 5.037 ms
2 210.y.y.y (210.y.y.y) 5.614 ms 5.570 ms 5.440 ms



# cat /var/state/dhcp/dhcpd.leases
#




# ifconfig
eth0 Link encap:Ethernet HWaddr 00:01:02:75:FE:0C
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:588 errors:0 dropped:0 overruns:0 frame:0
TX packets:601 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:449566 (439.0 Kb) TX bytes:132539 (129.4 Kb)
Interrupt:3 Base address:0xb800

ppp0 Link encap:Point-to-Point Protocol
inet addr:124.x.x.x P-t-P:210.x.x.x Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:557 errors:0 dropped:0 overruns:0 frame:0
TX packets:562 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:435243 (425.0 Kb) TX bytes:113535 (110.8 Kb)




# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
210.x.x.x 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 210.x.x.x 0.0.0.0 UG 0 0 0 ppp0



# cat /var/log/messages | grep "DHCP"
# cat /var/log/messages | grep "dhcp"

still nothing.. please help :)

gbell72 05-11-2006 08:50 AM

Try, tcpdump -n -i eth0 broadcast or host your ip and not arp

////// 05-11-2006 08:54 AM

root@debian:~#arp

and:

cat /proc/net/arp

That works for me.

tredegar 05-11-2006 08:56 AM

Can you use www.whatismyip.com? Is this what you want to know?
Otherwise, if your dhcp server is in your modem/router, you can usually telnet, to your modem/router/dhcp server or even connect to its LAN address with your browser (eg, for mine, I do http://10.0.0.1) to find out this information.

HTH

kublador 05-16-2006 06:33 AM

thanks all for the replies..
i got it now..

i viewed the files in /etc/dhclient
im using slackware 10 :)


All times are GMT -5. The time now is 10:54 PM.