close

※架設DHCP Server

  1. 安裝軟體
    yast –i dhcp-server

  2. 設定那些網卡要提供DHCP 伺服器
    vi  /etc/sysconfig/dhcpd
    DHCPD_INTERFACE =”eth0”
    image

  3. 設定DHCP設定檔(先刪除原先的設定檔 /etc/dhcpd.conf)
    vi  /etc/dhcpd.conf
    ddns-update-style none;
    subnet 192.168.120.0 netmask 255.255.255.0 {
    default-less-time 3600;
    max-less-time 7200;
    range 192.168.120.10 192.168.120.20;
    option routes 192.168.120.1;
    option domain-name-servers 10.0.0.254;
    }
    image

  4. 重新啟動DHCP Server
    service dhcpd restart

  5. 用Client測試
    service network rstart

※Client  資訊

/var/lib/dhcpcd/dhcpd-ethx.info             在Client  端電腦中依據使用的網卡可以查詢相關資料

image

※Server 資訊

/var/lib/dhcp/db/dhcpd.leases                  Server 端中保存的租約資訊

image

 

※使用tcpdump 觀察網路資訊

  1. 安裝dhcp-tools
    yast   -i  dhcp-tools
  2. 查看封包前1500 bytes  dhcp Client 以及dhcp server 的資訊
    tcpdump  -xlen  -s  1500  port  boots or port  bootps  |  dhcpdump
  3. 觀察DHCP 封包資訊
    tcpdump  -xlen  -s  1500  port  boots or port  bootps  |  dhcpdump  >  xxx.txt
    image
  4. 修改Client 租約最大時間
    vi  /etc/sysconfig/network/dhcp 

    image
  5. 針對一台Client 設定固定IP
    vi /etc/dhcpd.conf
    host  主機名稱 {
    hardware ethernet  MAC;
    fixed-address  固定IP;
    }
     image

arrow
arrow
    全站熱搜

    奔騰兔 發表在 痞客邦 留言(0) 人氣()