請教udhcpd(DHCP伺服器)在2410開發版

顯示結果從第 1 筆 到 4 筆,共計 4 筆
  1. #1
    會員
    註冊日期
    2007-02-05
    討論區文章
    31

    請教udhcpd(DHCP伺服器)在2410開發版

    核心系統是linux(非uclinux)
    2410有一個網卡eth0(外網)
    我另裝上一個usb有線網卡作為eth1來當dhcp伺服器
    語法:
    # Sample udhcpd configuration file (/etc/udhcpd.conf)
    
    # The start and end of the IP lease block
    
    start                 192.168.2.2        #default: 192.168.0.20
    end                192.168.2.254        #default: 192.168.0.254
    
    
    # The interface that udhcpd will use
    
    interface        eth1  #default: eth0
    
    
    # The maximim number of leases (includes addressesd reserved
    # by OFFER's, DECLINE's, and ARP conficts
    
    #max_leases        101                #default: 254
    
    
    # If remaining is true (default), udhcpd will store the time
    # remaining for each lease in the udhcpd leases file. This is
    # for embedded systems that cannot keep time between reboots.
    # If you set remaining to no, the absolute time that the lease
    # expires at will be stored in the dhcpd.leases file.
    
    #remaining        yes                #default: yes
    
    
    # The time period at which udhcpd will write out a dhcpd.leases
    # file. If this is 0, udhcpd will never automatically write a
    # lease file. (specified in seconds)
    
    #auto_time        7200                #default: 7200 (2 hours)
    
    
    # The amount of time that an IP will be reserved (leased) for if a
    # DHCP decline message is received (seconds).
    
    #decline_time        3600                #default: 3600 (1 hour)
    
    
    # The amount of time that an IP will be reserved (leased) for if an
    # ARP conflct occurs. (seconds
    
    #conflict_time        3600                #default: 3600 (1 hour)
    
    
    # How long an offered address is reserved (leased) in seconds
    
    #offer_time        60                #default: 60 (1 minute)
    
    # If a lease to be given is below this value, the full lease time is
    # instead used (seconds).
    
    #min_lease        60                #defult: 60
    
    
    # The location of the leases file
    
    lease_file        /usr/local/etc/udhcpd.leases        #defualt: /var/lib/misc/udhcpd.leases
    
    # The location of the pid file
    #pidfile        /var/run/udhcpd.pid        #default: /var/run/udhcpd.pid
    
    # Everytime udhcpd writes a leases file, the below script will be called.
    # Useful for writing the lease file to flash every few hours.
    
    #notify_file                                #default: (no script)
    
    #notify_file        dumpleases         # <--- usefull for debugging
    
    # The following are bootp specific options, setable by udhcpd.
    
    #siaddr                192.168.0.22                #default: 0.0.0.0
    
    #sname                zorak                        #default: (none)
    
    #boot_file        /var/nfs_root                #default: (none)
    
    # The remainer of options are DHCP options and can be specifed with the
    # keyword 'opt' or 'option'. If an option can take multiple items, such
    # as the dns option, they can be listed on the same line, or multiple
    # lines. The only option with a default is 'lease'.
    
    #Examles
    opt        dns        192.168.2.1
    option        subnet        255.255.255.0
    opt        router        192.168.2.1
    #opt        wins        192.168.2.1
    #option        dns        192.168.2.1 168.95.1.1 168.95.192.1        # appened to above DNS servers for a total of 3
    #option        domain        local
    #option        lease        864000                # 10 days of seconds
    
    
    ###static_lease    08:08:08:08:27:12       192.168.104.104
    
    # Currently supported options, for more info, see options.c
    #opt subnet
    #opt timezone
    #opt router
    #opt timesvr
    #opt namesvr
    #opt dns
    #opt logsvr
    #opt cookiesvr
    #opt lprsvr
    #opt bootsize
    #opt domain
    #opt swapsvr
    #opt rootpath
    #opt ipttl
    #opt mtu
    #opt broadcast
    #opt wins
    #opt lease
    #opt ntpsrv
    #opt tftp
    #opt bootfile
    第一次啟動dhcp,eth1的網卡ip是設定成192.168.2.1(在/etc/rc.d/rc.inet1.conf改)確定動起來後,dhcp設定檔如上
    我的dhcp啟動指令是/usr/sbin/udhcpd -fS /usr/local/etc/udhcpd.eth1.conf
    ok~~dhcp功能可以正常配給WINXP電腦網卡(IP和DNS都設定自動取得)得到192.168.2.2
    目前很正常
    問題來了
    我現在把eth1網卡ip是設定成192.168.3.1(在/etc/rc.d/rc.inet1.conf改),/etc/rc.d/rc.inet1 restart確定動起來後,dhcp設定檔把192.168.2.....都改成了192.168.3.....
    我先關掉dhcp指令是killall udhcpd,/etc/rc.d/rc.inet1 restart確定動起來後,然後一樣啟動dhcp指令是/usr/sbin/udhcpd -fS /usr/local/etc/udhcpd.eth1.conf
    但在winxp電腦網卡(IP和DNS都設定自動取得)按右鍵選"修復"卻不能得到192.168.3.2~192.168.3.254的IP,而是出現Windows無法完成修復這個問題, : 因為無法完成下列動作:更新您的IP位址
    而我試過一些ip分享器產品或adsl數據機開dhcp功能可以修復成功得到ip說,所以覺得是不是哪裡有問題?
    而且發現如果真要得到ip,要把開發版手動撥開關重開機(不能reboot),或是在winxp電腦網卡按右鍵停用=>啟用,以上兩種方法可以取得ip


    此文章於 2009-11-25 07:55 PM 被 kalowt 編輯。

  2. #2
    會員
    註冊日期
    2005-11-27
    所在地區
    Seednet FTTB 60M/15M
    討論區文章
    2,610

    回覆: 請教udhcpd(DHCP伺服器)在2410開發版

    ipconfig /release
    ipconfig /renew

    http://www.pczone.com.tw/thread/41/149429/

    http://paching.myweb.hinet.net/lesson13.htm

    另外,你的dhcpd.conf如上,是如上天堂嗎??

  3. #3
    會員
    註冊日期
    2007-02-05
    討論區文章
    31

    回覆: 請教udhcpd(DHCP伺服器)在2410開發版

    引用 作者:tvirus 瀏覽文章
    ipconfig /release
    ipconfig /renew

    http://www.pczone.com.tw/thread/41/149429/

    http://paching.myweb.hinet.net/lesson13.htm

    另外,你的dhcpd.conf如上,是如上天堂嗎??
    不好意思我加上了
    我知道xp用以上指令可以取得ip
    但我想用修復就可以更新取得ip

  4. #4
    會員
    註冊日期
    2005-11-27
    所在地區
    Seednet FTTB 60M/15M
    討論區文章
    2,610

    回覆: 請教udhcpd(DHCP伺服器)在2410開發版

    引用 作者:kalowt 瀏覽文章
    不好意思我加上了
    我知道xp用以上指令可以取得ip
    但我想用修復就可以更新取得ip
    那你就要動點手腳
    語法:
    # The location of the leases file
    lease_file        /usr/local/etc/udhcpd.leases        #defualt: /var/lib/misc/udhcpd.leases
    指到 /dev/null 去
    PS:不確定行不行,請自己試一下
    說真的
    喜歡用非正規方式取得IP,真是怪...

類似的主題

  1. 請教關於架設DNS伺服器∼
    作者:woodrew 所在討論版:-- FreeBSD & Linux 討 論 版
    回覆: 1
    最後發表: 2002-11-18, 08:22 AM
  2. 請問在mandrake上如何架 dhcp伺服器呢
    作者:aday 所在討論版:-- FreeBSD & Linux 討 論 版
    回覆: 0
    最後發表: 2002-05-25, 01:17 PM
  3. CS伺服器
    作者:聰明的豬 所在討論版:-- 閒 話 家 常 灌 水 版
    回覆: 2
    最後發表: 2002-01-01, 01:06 PM

 

udhcpd config file

開發版 取得 ip

發表文章規則

  • 不可以發表新主題
  • 不可以回覆文章
  • 不可以上傳附加檔案
  • 不可以編輯自己的文章
  •