全球主机交流论坛

标题: hetzner使用proxmox或者solusvm开Nat kvm独立ipv6桥接网卡设置 [打印本页]

作者: eqblog    时间: 2018-10-3 15:18
标题: hetzner使用proxmox或者solusvm开Nat kvm独立ipv6桥接网卡设置
本帖最后由 eqblog 于 2018-10-3 15:27 编辑

结果谷歌一系列的查找资料,最后还是到了hetzner的wiki找到了解决办法。

另外如果配置完成后,在小鸡仍然出现ping不通ipv6的情况请执行以下步骤:
在/etc/sysctl.conf中添加:net.ipv6.conf.all.proxy_ndp=1
然后执行sysctl -p
关闭ip6tables等操作


1.proxmox桥接网卡配置:

  1. # /etc/network/interfaces
  2. ### Hetzner Online GmbH - installimage
  3. # Loopback device:
  4. auto lo
  5. iface lo inet loopback
  6. #
  7. # device: eth0
  8. auto  eth0
  9. iface eth0 inet static
  10.        address   <Main IP>
  11.        netmask   255.255.255.255
  12.        pointopoint   <Gateway>
  13.        gateway   <Gateway>
  14. #
  15. iface eth0 inet6 static
  16.        address   <Address from the IPv6 Subnet> #eg: 2001:db8::2
  17.        netmask   128
  18.        gateway   fe80::1
  19.        up sysctl -p
  20. # for single IPs
  21. auto vmbr0
  22. iface vmbr0 inet static
  23.         address  10.0.1.1
  24.         netmask  255.255.255.0
  25.         bridge_ports none
  26.         bridge_stp off
  27.         bridge_fd 0
  28. #
  29. iface vmbr0 inet6 static
  30.        address   <Address from the IPv6 Subnet> #eg: 2001:db8::2
  31.        netmask   64
复制代码


关于Nat链接网络请使用iptables实现。

solusvm下网卡配置:
主网卡中默认配置请不要修改,仅需将IPV6ADDR的/64换为/128
例如:IPV6ADDR= 2001:db8::2/128
然后将桥接网卡更改为:

  1. DEVICE=br0
  2. ONBOOT=yes
  3. TYPE=Bridge
  4. BOOTPROTO=static
  5. IPADDR=10.0.1.1
  6. NETMASK=255.255.255.0
  7. IPV6ADDR=2001:db8::2/64
复制代码


关于联网与端口映射请使用iptables

关于虚拟机(kvm)的配置:
这里拿2001:db8::此ipv6做示范
Debian or Ubuntu:
iface eth0 inet6 static
       address    2001:db8::f001
       netmask   64
       gateway   2001:db8::2

Centos:

IPV6INIT=yes
IPV6ADDR=2001:db8::f001/64
IPV6_DEFAULTGW=2001:db8::2



发表自我的小博客:https://eqblog.com/hetzner-proxmox-solusvm-nat-kvm-ipv6.html



关于iptables的设置:
端口映射:
iptables -t nat -A PREROUTING -d main_ip -p tcp -m tcp --dport ssh_port -j DNAT --to-destination user_ip:22
main_ip为你公网Ip ssh_port为公网映射端口 user_ip为你nat分配的IP
联网:
iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -j SNAT --to-source main_ip
10.0.1.0/24为你分配的内网IP段 main_ip为公网IP






作者: mean    时间: 2018-10-3 15:19
eq大佬 前排预定
作者: daliu    时间: 2018-10-3 15:20
EQ又要上机器了?
作者: Apollo520    时间: 2018-10-3 15:20
大佬 前排预定
作者: inlife    时间: 2018-10-3 15:21
那t667的NAT小鸡的IPV6可以正常使用了吧?以前一直用不了。
作者: zrj766    时间: 2018-10-3 15:22
EQ大佬你在发什么?根本看不懂!独服都用不起!
作者: eqblog    时间: 2018-10-3 15:22
inlife 发表于 2018-10-3 15:21
那t667的NAT小鸡的IPV6可以正常使用了吧?以前一直用不了。

芬兰的可以用了 重装或者将网关更换为2a01:4f9:2a:399::2 即可

作者: myseil    时间: 2018-10-3 15:31
貌似开nat鸡 容易被警告  之前狠毒开这个的
作者: 小奶狗    时间: 2018-10-3 15:32
提示: 作者被禁止或删除 内容自动屏蔽
作者: eqblog    时间: 2018-10-3 15:34
myseil 发表于 2018-10-3 15:31
貌似开nat鸡 容易被警告  之前狠毒开这个的

不会的,我测试过这样的配置了。。以前的配置我也被警告过。。
作者: eqblog    时间: 2018-10-3 15:36
小奶狗 发表于 2018-10-3 15:32
大佬知道solusvm添加IPv6剩下俩个框对应啥不,

哪2个框?

作者: inlife    时间: 2018-10-3 15:38
eqblog 发表于 2018-10-3 15:22
芬兰的可以用了 重装或者将网关更换为2a01:4f9:2a:399::2 即可

可以了,添加这个网关后,终于可以用了,谢谢
作者: 小奶狗    时间: 2018-10-3 15:38
提示: 作者被禁止或删除 内容自动屏蔽
作者: fl20002    时间: 2018-10-3 15:41
我是esxi配的lede,ipv6的地址管理,ipv4的地址用lede转发开小鸡,懒得手打命令配iptables
作者: Skywalker    时间: 2018-10-3 16:53
myseil 发表于 2018-10-3 15:31
貌似开nat鸡 容易被警告  之前狠毒开这个的

直接把主ip配置到vmbr,服务商好像会检测到多个虚拟网卡
不过unreal这家好像不管




欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/) Powered by Discuz! X3.4