本文共 1076 字,大约阅读时间需要 3 分钟。
server2的配置设置server2的地址eth0 172.17.17.2安装dhcp并启动配置/etc/dhcpd.confddns-update-style none;default-lease-time 18800;max-lease-time 37600;ignore client-updates;option subnet-mask 255.255.255.0;option broadcast-address 192.168.1.255;subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.1.254; range 192.168.1.3 192.168.1.252;}subnet 192.168.2.0 netmask 255.255.255.0 { option routers 192.168.2.254; range 192.168.2.3 192.168.2.252}subnet 172.17.17.0 netmask 255.255.255.0 { option routers 172.17.17.254; range 172.17.17.3 172.17.17.252; host print{ hardware ethernet 00:0C:29:74:D7:19 fixed-address 172.17.17.3}}server1的配置安装dhcp服务并启动设置ip地址 eth0 172.17.17.1 eth1 192.168.18.1.1 eth2 192.168.18.2.1vim /etc/sysconfig/dhcrelay INTERFACES="eth0 eth1 eth2"DHCPSERVERS="172.17.17.2"echo 1 >/proc/sys/net/ipv4/ip_forwardservice dhcrelay start客户端测试linux利用dhclient 设备名称 获取IP地址 dhclient -r 释放IP地址windows设网卡为自动获取
转载于:https://blog.51cto.com/6235829/1078989