全球主机交流论坛

标题: 求助 vir小鸡套用ipv6的问题 [打印本页]

作者: 昨晚上梦见你了    时间: 2021-3-16 15:04
标题: 求助 vir小鸡套用ipv6的问题
在tunnelbroker上申请了ipv6,直接执行也可以了,但是  加入到开机启动怎么也不成功,
于是手动启动一下sh脚本 ,出错了

root@BlueSnarling-VM:~# bash /mycmd/ipv6.sh
: Unknown host
ifconfig: `--help' gives usage information.
: Resolver Error 0 (no error)
: Unknown host
ifconfig: `--help' gives usage information.
SIOGIFINDEX: No such device
SIOGIFINDEX: No such device


但是我一行一行的从tunnelbroker复制过来就没有问题,可以完美的打开ipv6,

请教   开机自启动的方法!
作者: uuh    时间: 2021-3-16 15:10

      沙发。 VIR支持IP6吗      




  ∮⊱⊱⊱     遇到懂我的人是幸运,遇不到也是正常了,沉默,喜欢独处,三观正,比你想象的深情,也比你以为的冷漠。   ⊰⊰⊰∮

              

  尾巴不止能用来挠痒痒
   还能凑字数

作者: 昨晚上梦见你了    时间: 2021-3-16 15:12
uuh 发表于 2021-3-16 15:10
沙发。 VIR支持IP6吗      

用tunnelbroker套的,所以每次开机都要执行以下命令  很麻烦,用脚本总是失败
作者: ymcoming    时间: 2021-3-16 15:20
vir支持IPV6的:

[IPV4测试]
您的出口IP不能解锁Netflix,仅支持自制剧的观看

[IPV6测试]
您的出口IP完整解锁Netflix,支持非自制剧的观看
原生IP地域解锁信息:美国区(US) NetFlix 原生IP

作者: uuh    时间: 2021-3-16 15:22

     手输脚本可以执行。命令没问题。就多百度类似教程套用一下。




  ∮⊱⊱⊱     即使如此,我也有我想保护的世界!——《高达seed》   ⊰⊰⊰∮

              

  尾巴不止能用来挠痒痒
   还能凑字数

作者: 昨晚上梦见你了    时间: 2021-3-16 15:28
ymcoming 发表于 2021-3-16 15:20
vir支持IPV6的:

我的不支持哎,怎么弄,教教呗

作者: Num0    时间: 2021-3-16 15:30
我的vir吃灰机没有ipv6
作者: llyang    时间: 2021-3-16 15:31
修改  /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
sysctl -p
sysctl.conf 修改生效, 启用IPv6
作者: 昨晚上梦见你了    时间: 2021-3-16 15:55
llyang 发表于 2021-3-16 15:31
修改  /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=0


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#




这几行都没有,没找到,要自己添加吗?
作者: option    时间: 2021-3-16 16:09
别折腾了,啥用没有,刚弄完,发现gg 还是要验证,解琐也不行。
作者: coobar    时间: 2021-3-16 16:14
本帖最后由 coobar 于 2021-3-16 16:19 编辑
  1. vim /etc/sysctl.conf
复制代码

添加下面三行
  1. net.ipv6.conf.all.disable_ipv6 = 0
  2. net.ipv6.conf.default.disable_ipv6 = 0
  3. net.ipv6.conf.lo.disable_ipv6 = 0
复制代码


添加DNS
  1. vim /etc/resolv.conf
复制代码
  1. nameserver 2001:4860:4860::8844
  2. nameserver 2001:470:20::2
复制代码


执行ifconfig后看到eth0下面有个he-ipv6 网卡,没有的话,执行ifup he-ipv6即可。

修改hosts
  1. vim /etc/hosts
复制代码


如果需要指定域名通过IPv6 访问,修改Hosts文件即可。
例如强制用IPV6访问谷歌则需,添加下面代码到hosts
  1. 2607:f8b0:4005:801::200e google.com
  2. 2607:f8b0:4005:801::200e www.google.com
  3. 2404:6800:8005::68 www.google.com
  4. 2404:6800:8005::68 www.l.google.com
  5. 2404:6800:8005::68 encrypted.google.com
  6. 2404:6800:8005::11 mail.google.com
复制代码


刷新 DNS 缓存
  1. /etc/init.d/nscd restart
复制代码

完事收工!!
作者: panghu    时间: 2021-3-16 16:15
好像支持   vir跳过谷歌人机就是用的这个方法  
作者: wifitry    时间: 2021-3-16 16:37
不明觉厉
作者: zxxx    时间: 2021-3-16 16:39
option 发表于 2021-3-16 16:09
别折腾了,啥用没有,刚弄完,发现gg 还是要验证,解琐也不行。

确实如此
作者: 昨晚上梦见你了    时间: 2021-3-16 16:48
本帖最后由 昨晚上梦见你了 于 2021-3-16 16:55 编辑
coobar 发表于 2021-3-16 16:14
添加下面三行


大神   你这少了一步吧   

我执行ifup he-ipv6 出现
Unknown interface he-ipv6

是不是应该先修改网卡配置文件?

搞定了 ,非常感谢

修改/etc/network/interfaces这个文件,添加配置信息就好了,太感谢了,么么哒
作者: younghwan    时间: 2021-3-16 16:50
1、创建sh脚本
vi /home/tunnelbroker-ipv6

#!/bin/bash
ifconfig sit0 up
ifconfig sit0 inet6 tunnel ::216.218.221.66
ifconfig sit1 up
ifconfig sit1 inet6 add 2001:470:18:42e::66/64
route -A inet6 add ::/0 dev sit1
保存

2、重命名为tunnelbroker-ipv6.sh
mv /home/tunnelbroker-ipv6 /home/tunnelbroker-ipv6.sh

3、增加执行权限
chmod +x /home/tunnelbroker-ipv6.sh

4、添加到开机执行配置文件/etc/rc.local内
vi /etc/rc.local
/home/tunnelbroker-ipv6.sh

注意:CentOS 7的开机自定义配置文件(/etc/rc.local)默认不会开机执行,添加执行权限
chmod +x /etc/rc.d/rc.local

阿里云公开的CentOS镜像将IPv6支持给去掉了需要修改开启
开启网卡IPV6
1、
vi /etc/sysconfig/network
#添加
  NETWORKING_IPV6=yes
#保存退出

2、
vi /etc/sysconfig/network-scripts/ifcfg-eth1
#编辑要添加IPV6的网卡
IPV6INIT=yes
IPV6_AUTOCONF=yes
#添加这两行内容保存退出

3、
vi /etc/sysctl.conf 默认是1,这3项修改为0即可 没有的话加这3项
  net.ipv6.conf.all.disable_ipv6 = 0
  net.ipv6.conf.default.disable_ipv6 = 0
  net.ipv6.conf.lo.disable_ipv6 = 0
#保存退出
重启网卡 就开启IPV6支持了

直接输入
ifconfig sit0 up
ifconfig sit0 inet6 tunnel ::216.218.221.66
ifconfig sit1 up
ifconfig sit1 inet6 add 2001:470:18:42e::66/64
route -A inet6 add ::/0 dev sit1
添加IPV6  但重启服务器失效 所以创建前文的自动执行shell脚本即可。
作者: coobar    时间: 2021-3-16 16:59
昨晚上梦见你了 发表于 2021-3-16 16:48
大神   你这少了一步吧   

我执行ifup he-ipv6 出现

加IPV6也没什么卵用,就是折腾而已~
作者: mangohappy    时间: 2021-3-16 17:13
本帖最后由 mangohappy 于 2021-3-16 17:17 编辑

可惜 IPV6 解决不了谷歌学术的问题
作者: 昨晚上梦见你了    时间: 2021-3-16 17:15
coobar 发表于 2021-3-16 16:59
加IPV6也没什么卵用,就是折腾而已~

确实没用,还是弹出来
作者: 昨晚上梦见你了    时间: 2021-3-16 17:17
mangohappy 发表于 2021-3-16 17:13
老板愿意购买我的技术时间的话,手把手教会,一顿盒饭钱,站内信

弄好了,我还是留着自己买盒饭吧




欢迎光临 全球主机交流论坛 (https://loc.528866.xyz/) Powered by Discuz! X3.4