差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
linux:network:test_ipv6 [2020/01/24 15:24] tony |
linux:network:test_ipv6 [2020/02/20 11:01] tony |
||
---|---|---|---|
行 3: | 行 3: | ||
===== Introduction ===== | ===== Introduction ===== | ||
本篇文章主要記錄測試IPv6功能時,會使用到的一些指令與方法。 | 本篇文章主要記錄測試IPv6功能時,會使用到的一些指令與方法。 | ||
+ | ===== Add/Delete IPv6 address ===== | ||
+ | Add: | ||
+ | <code bash> | ||
+ | ip -6 addr add 2001:db8:0:f101::1/64 dev eth0 | ||
+ | </code> | ||
+ | Delete: | ||
+ | <code bash> | ||
+ | ip addr del 2001:db8:0:f101::1/64 dev eth0 | ||
+ | </code> | ||
===== Delete IPv4 address===== | ===== Delete IPv4 address===== | ||
刪除IPv4 loopback: | 刪除IPv4 loopback: | ||
行 16: | 行 25: | ||
service network restart | service network restart | ||
</code> | </code> | ||
+ | ===== DHCP Configuration ===== | ||
+ | 先在某張網卡上設定static fc00::1/64,接著在dhcp的設定中加入: | ||
+ | <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::/64 { | ||
+ | range6 fc00:0:0:0::10 fc00:0:0:0::1000; | ||
+ | } | ||
+ | </code> | ||
+ | 最後重新啟動dhcpd6服務即可。 | ||
+ | ===== Reference ===== | ||
+ | * [[https://askubuntu.com/questions/1181511/disable-ipv4-on-ubuntu-16-04-lts|Disable IPv4 on Ubuntu 16.04 LTS]] | ||
+ | * [[https://blog.csdn.net/qq_36297359/article/details/86774608|如何使用Linux下的dhclient获取IPv6地址?]] | ||
+ | ===== ===== | ||
+ | ---- | ||
+ | \\ | ||
+ | ~~DISQUS~~ |