linux上为IPV6设置静态路由,写入文件

1. 先为interface设置静态的ipv6地址:

/etc/sysconfig/network-scripts/ifcfg-eth0:

 IPV6INIT=yes
 IPV6ADDR=2001:db0::1096/64
 IPV6_DEFAULTGW=2001:db0::196

2. 可以编辑或添加vi /etc/sysconfig/static-routes-ipv6:

#Device   IPv6 network to route   IPv6 gateway address
eth0      fec0:0:0:2::/64         fec0:0:0:1:0:0:0:20
eth0      2000::/3                3ffe:ffff:0000:f102:0:0:0:1
或者是添加或者编辑/etc/sysconfig/network-scripts/route6-eth0:

64:ff9b::/96 via 2001:db0::196 dev eth0


3. service network restart

你可能感兴趣的:(Linux,Network)