天天看點

DHCP中繼

DHCP中繼

伺服器:在/etc/dhcpd.conf内再加一個192.168.2.0網段

        關閉防火牆

        網關指向中繼機同網段ip(route add default gw 192.168.1.1)

中繼機:也要安裝dhcp的rpm包,cp以上步驟同伺服器

       # vi /etc/sysctl.conf

       net.ipv4.ip_forward = 1

       :wq

       # sysctl -p

       # vi /etc/sysconfig/dhcrelay

       INTERFACES="eth0 eth1"

       DHCPSERVERS="192.168.1.2"                      (伺服器ip)

       # ifconfig eth0 192.168.1.1

       # ifconfig eth1 192.168.2.1

       # service dhcrelay start

       # chkconfig -- level 3 5 dhcrelay on

中繼機兩個網卡,一個與伺服器同,一個與客戶機同

關閉防火牆

客戶機:可linux也可windows

配置臨時的MAC位址(虛假MAC):

ifconfig eth0 hw ether MAC位址

配置/添加一個新的虛拟網卡(非實體網卡):

ifconfig eth0:0 192.168.1.10

為列印機配置設定固定ip(在DHCP内):

安裝dhcp的rpm包、cp以上步驟同DHCP伺服器

# vi /etc/dhcpd.conf          (在最後編寫)

host prtsvr {

hardware ethernet MAC位址

fixed-address 192.168.1.5

}

繼續閱讀