一、vmware的相關配置
(1)點擊編輯,選擇虛擬網絡編輯器
(2)選擇帶NAT模式的VMnet8網絡,點擊NAT設置
(3)在NAT設置中啟用IPV6
(4)設置好后,點擊應用
(5)再選擇鏡像,右鍵設置鏡像的網絡適配器模式為NAT模式,
以上過程只是建立了主機與虛擬機之間的ipv6信道。
二、虛擬機相關設置
登錄虛擬機,在虛擬機中進行ipv6的網絡設置,
命令行操作如下:
1. vi /etc/sysctl.conf
# /etc/sysctl.conf
#
# When the kernel panics, automatically reboot in 5 seconds
kernel.panic = 5
# Delay a few seconds and then panic.
kernel.panic_on_oops = 1
# bug38137
net.ipv4.neigh.default.gc_thresh1 = 10240
net.ipv4.neigh.default.gc_thresh2 = 20480
net.ipv4.neigh.default.gc_thresh3 = 40960
# bug33044
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
# bug111629
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.secure_redirects=0
net.ipv4.conf.default.secure_redirects=0
#要增加的部分
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
net.ipv6.conf.lo.disable_ipv6=0
2. sysctl -p
#此處為實體機配置,虛擬機中不用設置,已自動生成
//3. ifconfig M inet6 add f380::245:74/112
//4. route -A inet6 add ::/0 gw f380::245:ffff
//或者 route -A inet6 add default gw f380::245:ffff
5.開啟apache監聽IPv6的地址
vi /etc/apache2/vhosts.d/00_default_ssl_vhost.conf
設置
Listen 0.0.0.0:443
Listen [::]:443
6.重啟apache :apachectl restart
7.ifconfig查看虛擬機的ipv6地址,取圖中的地址訪問
利用ipv6地址訪問設備,注意格式[ipv6]
https://[fd15:4ba5:5a2b:1008:20c:29ff:fe12:2c46]/
三、虛擬機配置ipv4也可訪問
(1)查看虛擬機的子網ip和網關
(2)在命令行配置虛擬機ip和網關
(3) 虛擬機關機后重啟,需要重新執行命令
sysctl -p
apachectl restart