OpenWrt利用6plat部署IPv6环境
May 13, 2019 | 分类:linux/" style="margin: 0px; padding: 0px; color: rgb(34, 85, 136); text-decoration-line: none;">Linux
No Comments
1、申请6plat账号
前往http://6plat.org申请46模块个人帐号。
从6plat网站上下载最新的配置文件,另存为6plat.ovpn
编辑6plat.ovpn,增加红色部分。
client dev tun proto tcp remote 46.6plat.org 9185 comp-lzo resolv-retry infinite nobind persist-key persist-tun setenv CLIENT_CERT 0 auth-user-pass pass.txtremote-cert-tls server verb 3route-ipv6 ::/0 240c:f:1:6000::1cipher none-----BEGIN CERTIFICATE----- MIIE3zCCA8egAwIBAgIJAJVvrlqcS4YsMA0GCSqGSIb3DQEBCwUAMIGlMQswCQYD VQQGEwJDTjEQMA4GA1UECBMHQmVpamluZzEQMA4GA1UEBxMHQmVpamluZzESMBAG A1UEChMJNnBsYXQub3JnMRMwEQYDVQQLEwo2cGxhdGdyb3VwMRUwEwYDVQQDEww2 cGxhdC5vcmcgQ0ExEDAOBgNVBCkTB0Vhc3lSU0ExIDAeBgkqhkiG9w0BCQEWETZw bGF0QGJpaWdyb3VwLmNuMB4XDTE3MDEwNDA5MTc1NVoXDTI3MDEwMjA5MTc1NVow gaUxCzAJBgNVBAYTAkNOMRAwDgYDVQQIEwdCZWlqaW5nMRAwDgYDVQQHEwdCZWlq aW5nMRIwEAYDVQQKEwk2cGxhdC5vcmcxEzARBgNVBAsTCjZwbGF0Z3JvdXAxFTAT BgNVBAMTDDZwbGF0Lm9yZyBDQTEQMA4GA1UEKRMHRWFzeVJTQTEgMB4GCSqGSIb3 DQEJARYRNnBsYXRAYmlpZ3JvdXAuY24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDpTRpxYttg0EsUYWCE3GKLMPTDXlzVtn93yb9MdgUJkCiGNgaXHQ6Y NCcOXb3pLIxZN7eYH873ZgAY74+LiEIIAAPn+CTQjTcZ82r92xuSj47mMNd4/CcG 5byC9clsNijsWvJ7Rq2Fy2ynSddWMMkmVGZ8oS3psPc57cEOBUBdhTI4szo6aLE0 N3/AAFpIdfxlTATc5EWFxEk4SMPWAIcqkvZ1ETBit+HHU+Bv2oYcpzzi6jHmVw0d EofxV0w3AUNUN894mWprBtZKZ+DVqms0+LI3mLWPXsv3m8zYBNTXqgE5p4vJ+E3J 3AzDKH2Rb/coBiy3V2g0Cdgc9vATQ4XzAgMBAAGjggEOMIIBCjAdBgNVHQ4EFgQU M/hZJqaKeV9UVH6WoS7iwAk8/Q0wgdoGA1UdIwSB0jCBz4AUM/hZJqaKeV9UVH6W oS7iwAk8/Q2hgaukgagwgaUxCzAJBgNVBAYTAkNOMRAwDgYDVQQIEwdCZWlqaW5n MRAwDgYDVQQHEwdCZWlqaW5nMRIwEAYDVQQKEwk2cGxhdC5vcmcxEzARBgNVBAsT CjZwbGF0Z3JvdXAxFTATBgNVBAMTDDZwbGF0Lm9yZyBDQTEQMA4GA1UEKRMHRWFz eVJTQTEgMB4GCSqGSIb3DQEJARYRNnBsYXRAYmlpZ3JvdXAuY26CCQCVb65anEuG LDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBzYlX/RgvViVvcxwGQ SN9wP32U9aALFI4GCQz6ODrlYVx4m00zJeuR69bjLO3NZgMv6LtcovbuME+FYq/4 uXJJIfMlo2S/kKp5dBaGk9ERx0xs2OLAKyzc4wgx5zah5Nke1NhdYdCB6Lj6tM+s vthNz2SWpcctvlOvV+5IdVrefiaLl7RBgf2j81DYmPCILZwHo8rQ0zKppgqAFcFk tDO0FnHQcwe6xfTE1cIoOU39t+hTnvxQDBW4p9xkxX0hAFnNV41OadgEwxqyo6J0 BZ4dtEw8E9FFF8ewWl897xSv6AMPZTizFl3OReE376Kgv+gtFlSuj4kizCd7uiRp o5ab -----END CERTIFICATE-----
新建一个pass.txt的文本文件,第一行填6plat申请的用户名,第二行填密码。
user password
2、部署网络环境
用SSH登陆路由器并安装软件包:
opkg update opkg install ip6tables-mod-nat kmod-ip6tables ip6tables openvpn-openssl openssh-sftp-server mtr
在路由器根目录下建立/6plat/目录,用工具(如:winscp)把6plat.ovpn和pass.txt都传到这个目录下。
修改/etc/config/openvpn文件为:
config openvpn ipv6 option enable 1 option config /6plat/6plat.ovpn
重启openvpn:
/etc/init.d/openvpn restart
执行logread –f来查看系统日志。成功分配到了Ipv6地址则openvpn连接建立成功。
或使用ifconfig命令查看tun0接口是否存在,如存在则openvpn连接建立成功。
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.199.7.10 P-t-P:10.199.7.10 Mask:255.255.0.0 inet6 addr: fe80::77bd:9c45:6522:4bfd/64 Scope:Link inet6 addr: 240c:f:1:6000::xxxx/64 Scope:Global UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:41664 errors:0 dropped:0 overruns:0 frame:0 TX packets:32774 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:19611403 (18.7 MiB) TX bytes:3879181 (3.6 MiB)
3、配置OpenWrt
用浏览器登陆OpenWrt,进入 网络 -> 防火墙 ,将"Input","Output"以及"Forward"全部设置为"accept"
网络 -> 端口 -> IPv6 ULA 前缀 无需变动。如需变动,切记不要使用公网地址。
进入 网络 -> 端口 -> LAN -> HDCP服务器 -> IPv6 设置 ,勾选 总是通告默认路由 ,广播的DNS服务器填写为240c::6666。
在 网络 -> 防火墙 -> Custom Rules 增加以下内容:
ip6tables -t nat -A POSTROUTING -j MASQUERADE
重启防火墙后就能连通IPV6啦。
参考博文:http://blog.sina.com.cn/s/blog_6d96545f0102wmvn.html
打赏
支付宝微信扫一扫,打赏作者吧~
本文链接:https://www.kinber.cn/post/1431.html 转载需授权!
推荐本站淘宝优惠价购买喜欢的宝贝: