sysu宿舍网络路由器分享——IPv6篇

来源:互联网 发布:手机上的数据处理软件 编辑:程序博客网 时间:2024/05/01 02:37

  • 系统硬件:树莓派一个,8G sd卡一个,usb无线网卡一个,usb键盘、显示器等外设。
  • 操作系统:raspbian wheezy
  • 配置eth0为dhcp自动获取地址,wlan0为固定ip,安装isc dhcp和hostap实现从eth0把ipv4分享到无线网卡上。
  • 安装yah3c,实现从eth0进行宿舍的上网认证。ipv4的分享至此结束。
  • 安装bridge-utils 和 ebtables ,用来建立ipv6网桥。
  • 建立ipv6网桥。 

ifconfig eth0 downifconfig eth2 down #关闭两块网卡brctl addbr br0ifconfig br0 up #启动网桥brctl addif br0 eth0brctl addif br0 eth2 #桥接两块网卡ebtables -t broute -A BROUTING -p ! ipv6 -j DROP #只允许ipv6包通过网桥ifconfig eth0 upifconfig eth2 up #启动网卡


具体参见:http://bigeagle.me/2011/11/linux_as_ipv6_gateway/

  • 把以上代码写入/etc/rc.local中,以便开机自动启动。