差異處
這裏顯示兩個版本的差異處。
linux:commonsetting:dhcp:setup_ipv6_dhcp_on_centos7 [2020/02/21 10:31] tony 建立 |
linux:commonsetting:dhcp:setup_ipv6_dhcp_on_centos7 [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | {{tag>Linux CentOS}} | ||
- | ====== Setup IPv6 DHCP Server on CentOS7 ====== | ||
- | ===== Setup DHCP Server IP ===== | ||
- | 首先設定一組IPv6 IP在要處理DHCP的網卡上:\\ | ||
- | {{:linux:commonsetting:dhcp:centos7_ipv6_ip.png|}}\\ | ||
- | \\ | ||
- | 設定完後記得重新啟動網卡,並確認有正確配置。 | ||
- | <code bash> | ||
- | [root@localhost ~]# ifconfig eno2 | ||
- | eno2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 | ||
- | inet 10.68.0.6 netmask 255.255.255.0 broadcast 10.68.0.255 | ||
- | inet6 fe80::1e62:126a:5e95:ff1e prefixlen 64 scopeid 0x20<link> | ||
- | inet6 fc00::1 prefixlen 7 scopeid 0x0<global> | ||
- | ether 00:25:90:4b:6c:3f txqueuelen 1000 (Ethernet) | ||
- | RX packets 520773 bytes 778706143 (742.6 MiB) | ||
- | RX errors 0 dropped 0 overruns 0 frame 0 | ||
- | TX packets 61432 bytes 4300571 (4.1 MiB) | ||
- | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
- | device memory 0xfb900000-fb91ffff | ||
- | </code> | ||
- | ===== Setup DHCP Service ===== | ||
- | Install DHCP server: | ||
- | <code bash> | ||
- | yum install dhcp | ||
- | </code> | ||
- | 修改IPv6 dhcp設定(/etc/dhcp/dhcpd6.conf),加入以下內容: | ||
- | <code bash> | ||
- | default-lease-time 2592000; | ||
- | preferred-lifetime 604800; | ||
- | option dhcp-renewal-time 3600; | ||
- | option dhcp-rebinding-time 7200; | ||
- | allow leasequery; | ||
- | option dhcp6.info-refresh-time 21600; | ||
- | dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases"; | ||
- | |||
- | subnet6 fc00::/7 { | ||
- | range6 fc00:0:0:0:0:0:0:10 fc00:0:0:0:0:0:0:1000; | ||
- | } | ||
- | </code> | ||
- | 重新啟動services: | ||
- | <code bash> | ||
- | systemctl restart dhcpd6.service | ||
- | </code> | ||
- | 如果啟動有發生問題,請下systemctl status dhcpd6.service去看錯誤原因。 | ||
- | |||