Skip to content

Instantly share code, notes, and snippets.

@blackstuend
Last active December 18, 2018 03:34
Show Gist options
  • Save blackstuend/fb2c7fdd4c4f73c9d4b84c8336c6d9b1 to your computer and use it in GitHub Desktop.
Save blackstuend/fb2c7fdd4c4f73c9d4b84c8336c6d9b1 to your computer and use it in GitHub Desktop.

Install dhcp server

  • 伺服器設定
# yum install dhcp dhcp-devel -y
# ip addr add 192.168.10.254/24 brd + dev enps08
# gedit /etc/dhcp/dhcpd.conf 
# iptables -t nat --append POS -s 192.168.10.0/24 -o enp0s3 -j MASQUERADE
# echo "1" > /proc/sys/net/ipv4/ip_forward
  • 內容如下
subnet 192.168.10.0 netmask 255.255.255.0 {
    option routers 192.168.10.254;
    option subnet-mask 255.255.255.0;
    option domain-name-servers 8.8.8.8;
    range 192.168.10.100 192.168.10.200
}
  • 客戶端
# dhclient enps08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment