Linux下Ipv6网络配置的常用命令


Linux下Ipv6网络配置的常用命令

*默认网关设置:route -A inet6 add  ::/0 gw  xxxxxx

(若搜索不到主机,查看是否有相关路由表需删除)

在windows下ipv6 rtu  ::/0  6(接口)   /xxxxxx   默认路由

在windows下add  route  xxxxxx/size  6  /xxxxx  默认网关

*添加路由:route  -A inet6  add   网段或网址  gw   地址

(对于linux系统作为路由器,不用配任何路由表,只要路由器接口地址与机器接口在同一网段)

*地址配置:ifconfig eth0 inet6 add/del   xxxxxx  或者ip -6  addr  add  xxxxxx  dev  eth0

*接口启用/关闭:ifconfig eth0 up/down

(当配置地址不成功可以检查端口是否启用)

*信息查看:ip -6 addr  show

ip -6 route show 或者ip -6  route show  dev  eth0

* 开启转发:echo 1 > /proc/sys/net/ipv6/conf/all/forwarding

——————————————

——————————————

如果配置地址没有成功可以/etc/network/interfaces  restart

/etc/init.d/networking restart

如果配置地址不成功,也可以修改机器启动脚本/etc/rc.local,加入如下内容

auto lo interface lo inet loopback

auto eth0 interface inet6 static 地址  network size

/sbin/ifconfig  eth0  inet6 add 地址/size  exit

如果配置转发不成功,可以修改配置文件/etc/sysctl.conf如下

net.ipv6.conf.all.forwarding=1

net.ipv6.conf.default.forwarding=1

相关内容