歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下Ipv6網絡配置的常用命令

Linux下Ipv6網絡配置的常用命令

日期:2017/2/28 16:49:06   编辑:Linux教程

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

Copyright © Linux教程網 All Rights Reserved