ubuntu下如何安装及配置tayga(NAT64)?
- 安装tayga
$ sudo apt install tayga
- 配置
主要涉及两个文件/etc/tayga.conf, /etc/default/tayga
2.1. 配置/etc/tayga.conf,笔者的配置如下:
tun-device nat64
ipv4-addr 192.168.255.1
ipv6-addr fdaa:bb:1::1
prefix 64:ff9b::/96
dynamic-pool 192.168.255.0/24
2.2. 配置/etc/default/tayga, 笔者的配置如下:
RUN="yes"
CONFIGURE_IFACE="yes"
CONFIGURE_NAT44="yes"
IPV4_TUN_ADDR="192.168.255.1"
IPV6_TUN_ADDR="fdaa:bb:1::2"
2.3. 通过iptables配置FORWARD链(使nat64虚拟网卡与其它网卡之间能转发数据包)
$ sudo iptables -A FORWARD -i nat64 -o eth0 -j ACCEPT
$ sudo iptables -A FORWARD -i eth0 -o nat64 -j ACCEPT
- 启动tayga
$ sudo systemctl restart tagya
or
$ sudo service tayga restart
- 测试NAT64服务
$ ping6 64:ff9b::8.8.8.8 (64:ff9b::这个前缀是在2.1中配置的)