Daily Command : วิธีดู DHCP Information บน Ubuntu Desktop

mrgill   | February 2, 2010   |   1,290 Views

ค้างคาใจอยู่นานแล้วครับสำหรับวิธีดูข้อมูล DHCP กรณีที่เราเป็น dhcp client ปกติ ifconfig ก็ดูได้เฉพาะว่าเราได้ ip อะไรแต่ดู gateway ไม่ได้

root@mrgill-laptop:~# ifconfig eth1 eth1 Link encap:Ethernet HWaddr 00:13:ce:34:94:ff inet addr:10.2.80.140 Bcast:10.2.80.255 Mask:255.255.255.0 inet6 addr: fe80::213:ceff:fe34:94ff/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:607200 errors:80 dropped:80 overruns:0 frame:0 TX packets:588053 errors:0 dropped:4 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:365549369 (365.5 MB) TX bytes:203281968 (203.2 MB) Interrupt:17 Base address:0xa000 Memory:b0101000-b0101fff

ครั้งจะไปดูใน /var/lib/dhcp3 ก็มีข้อมูลเยอะเสียจนไม่รู้ว่าอันไหนเป็นอันไหน

root@mrgill-laptop:/var/lib/dhcp3# ls -al total 84 drwxr-xr-x 2 root root 4096 2010-02-01 09:47 . drwxr-xr-x 73 root root 4096 2010-01-22 01:37 .. -rw-r--r-- 1 root root 1488 2010-01-23 12:49 dhclient-03fb849f-aed0-4560-8cb5-dd5336518d93-eth1.lease -rw-r--r-- 1 root root 497 2010-01-05 21:23 dhclient-03fb849f-aed0-4560-8cb5-dd5336518d93-wlan2.lease -rw-r--r-- 1 root root 10165 2010-02-01 17:46 dhclient-09f271e2-8327-47aa-a2b3-7d9e596d9953-eth0.lease -rw-r--r-- 1 root root 1100 2010-02-02 17:11 dhclient-1fe06dc5-f1ae-49c0-a8a7-4a8b41f72551-eth1.lease -rw-r--r-- 1 root root 1508 2010-01-19 17:31 dhclient-30ebb2f0-bfa4-45a2-ac06-23ec48487e7e-eth1.lease -rw-r--r-- 1 root root 992 2009-11-01 12:53 dhclient-36406c67-cbfa-471f-8ebf-6e41d6921e98-eth0.lease -rw-r--r-- 1 root root 767 2010-02-01 21:30 dhclient-55dee4d2-623f-445a-9b86-6bfd388aef8c-eth1.lease -rw-r--r-- 1 root root 769 2010-01-20 09:59 dhclient-55dee4d2-623f-445a-9b86-6bfd388aef8c-wlan2.lease -rw-r--r-- 1 root root 550 2009-12-17 22:08 dhclient-6ac2d0b1-a5d9-4ec9-825c-ccaaee54ff0e-eth1.lease -rw-r--r-- 1 root root 994 2009-10-23 20:32 dhclient-6ac2d0b1-a5d9-4ec9-825c-ccaaee54ff0e-wlan1.lease -rw-r--r-- 1 root root 497 2009-10-23 21:39 dhclient-6ac2d0b1-a5d9-4ec9-825c-ccaaee54ff0e-wlan2.lease -rw-r--r-- 1 root root 2475 2009-11-06 18:09 dhclient-7abf6b67-2f25-47c0-b9fb-fdc29501b75e-eth1.lease -rw-r--r-- 1 root root 448 2010-02-01 09:55 dhclient-845ea4c4-871f-4a1d-91e1-19b7c0cc5fe3-eth1.lease -rw-r--r-- 1 root root 550 2010-01-21 23:09 dhclient-98188c5a-e7d5-4515-8379-e00bd5274d85-eth1.lease -rw-r--r-- 1 root root 409 2010-01-28 10:42 dhclient-bcf946a9-63ac-411a-903f-7e0b3cfbbd6a-eth1.lease -rw-r--r-- 1 root root 0 2010-01-19 14:36 dhclient-cf8c29be-461b-4a22-abd6-b079d28eb017-eth1.lease -rw-r--r-- 1 root root 1030 2010-02-01 17:50 dhclient-d7e573a1-b0f6-408c-9ddc-8150ed91f473-eth1.lease -rw-r--r-- 1 root root 1100 2010-02-02 20:45 dhclient.leases

วันนี้เลยนำคำสั่ง nm-tool มาฝากครับ(ที่จริงคลิกดู information ที่ NetworkManager ก็ได้)

root@mrgill-laptop:~# nm-tool NetworkManager Tool State: connected - Device: eth1 [Auto mrgill_wifi] --------------------------------------------- Type: 802.11 WiFi Driver: ipw2200 State: connected Default: yes HW Address: 00:13:CE:34:94:FF Capabilities: Speed: 54 Mb/s Wireless Properties WEP Encryption: yes WPA Encryption: yes WPA2 Encryption: yes Wireless Access Points (* = current AP) truewifi: Infra, 00:02:CF:94:60:E0, Freq 2412 MHz, Rate 54 Mb/s, Strength 27 *mrgill_wifi: Infra, 02:23:69:3A:F9:AE, Freq 2412 MHz, Rate 54 Mb/s, Strength 98 WPA WPA2 true_homewifi: Infra, 00:13:49:E4:26:9C, Freq 2437 MHz, Rate 54 Mb/s, Strength 65 WEP IPv4 Settings: Address: 10.2.80.140 Prefix: 24 (255.255.255.0) Gateway: 10.2.80.254 DNS: 10.2.80.254 - Device: eth0 ----------------------------------------------------------------- Type: Wired Driver: 8139too State: unavailable Default: no HW Address: 00:C0:9F:EE:19:BA Capabilities: Carrier Detect: yes Speed: 10 Mb/s Wired Properties Carrier: off

จากคำสั่งดังกล่าวเราก็จะเห็น Gateway และ DNS ด้วย

Share/Save

Comments

comments

Powered by Facebook Comments

Category : Daily command,Daily tips,Linux,Ubuntu

Tags: , ,

Daily Command : ดูเนื้อที่ HDD ว่าเหลือเท่าไหร่ด้วย df Google Buzz


Recent Entries

Random Posts

Social Network

Tag Cloud

Calendar

February 2010
S M T W T F S
« Jan   Mar »
 123456
78910111213
14151617181920
21222324252627
28  

Twitter: imrgill

RSS LinuxToday

RSS HowToForge

RSS UbuntuClub

RSS Blognone

RSS PowerWindowsBlog

Tag

Categories

Archives

Blogroll