ipv6转发开启,关闭开启自动获取地址
以下加入/etc/sysctl.conf
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.default.autoconf = 0
开启自动获取地址
让linux机器自动获取ipv6地址2012-09-10 14:37:14
分类: 系统运维
ipv6地址相对于ipv4地址,相当复杂不好记忆,如果手动设定地址比较繁琐。这里采用简单快捷的方法可以让linux机器自动获取到ipv6地址。方法如下。
1. switch配置
在L3 switch上搭建ipv6 双栈:
全局配置:
启用ipv6单播路由:
ipv6 unicast-routing
端口配置:
interface Vlan42
ip address 192.168.211.1 255.255.255.0
ip helper-address 192.168.210.1
ipv6 address 2001:421:58FF:2::1/64 配置ipv6网关
ipv6 address autoconfig
ipv6 enable 启用ipv6
ipv6 nd ra suppress
end
ip address 192.168.211.1 255.255.255.0
ip helper-address 192.168.210.1
ipv6 address 2001:421:58FF:2::1/64 配置ipv6网关
ipv6 address autoconfig
ipv6 enable 启用ipv6
ipv6 nd ra suppress
end
2.客户端配置:
这里以linux机器为例,
这里以linux机器为例,
vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPV6_AUTOCONFIG=yes
重启网络
service network restart
3.查看客户端获取到的ipv6地址:
[root@vm1 ~]# ifconfig | grep inet6
inet6 addr: 2001:421:58ff:2:4d5:97b2:f9fc:ee86/64 Scope:Global
inet6 addr: 2001:421:58ff:2:4d5:97b2:f9fc:ee86/64 Scope:Global
inet6 addr: fe80::250:56ff:fe9c:6a8d/64 Scope:Link
inet6 addr: ::1/128 Scope:Host
Scope:Global的地址即为获取到的ipv6地址inet6 addr: ::1/128 Scope:Host
http://blog.chinaunix.net/uid-9657410-id-3343358.html