希望对大家有用。
经过一番折腾和测试,新版的Openwrt已经内置了ipv6支持,已经不需要像前面的博文所介绍的那样为了ipv6而折腾一番。
其实从今年8月笔者就获得了这个消息,只是当时的Openwrt存在致命的Bug(2013年8月编译的版本),对VLAN的支持不好,只要打开VLAN,就无法通过有线连接连上Openwrt,无论是WAN和LAN ping数据包均无回应,这对于很多路由,如rg100a、db120等必须依靠VLAN虚拟WAN的路由,是致命的。 不过最新编译的Openwrt(2013年12月编译的版本),已经修复了这个问题。最新Openwrt下载地址。 刷机时请注意,建议刷机时不要保留原有配置,因为新版OpenWrt的network与旧有的稍有不同,出现了新的WAN6接口用于支持ipv6,并且新蹭了配置config globals ‘globals’. 默认的/etc/config/network配置文件(部分): config globals 'globals' option ula_prefix 'fd00::/48'config interface 'wan6' option ifname '@wan' option proto 'dhcpv6'经过测试验证,config globals ‘globals’配置的是一个本地私有地址段,类似于ipv4中的192.168.1.1/24;新版Openwrt应该是实现了ipv6的穿透,LAN下的机器与Openwrt的WAN获取的地址的掩码相同,处于同一个网段。(但我的疑问在于LAN下的机器的ipv6默认网关是Openwrt路由的本地地址?而不是与Openwrt路由WAN的网关?)。新版Openwrt的ipv6原生支持ipv6,默认LAN下的电脑通过DHCPv6获取ipv6地址,除此以外,也同样持支持6to4,6in4等ipv6隧道,修改wan6接口的协议即可,即修改 option proto ‘dhcpv6’,如果想方便操作,也可以通过luci,即web界面修改。
另外,不保留配置刷机完成后,默认没有root密码,需要telnet 192.168.1.1进入路由修改密码。 教育网设备需要安装6relay.ipk作为ipv6中继代理,才能正常使用ipv6,官方可能没有提供ipk,需要自行编译。
WR841N V7.1固件下载
官方默认编译的固件没有luci,即web界面,需要自行安装。
一。安装luciroot@OpenWrt:/# opkg update root@OpenWrt:~# opkg install luci
root@OpenWrt:~# /etc/init.d/uhttpd enable
root@OpenWrt:~# /etc/init.d/uhttpd start
root@OpenWrt:~#
二、WAN/LAN网络设置网络配置文件为/etc/config/network,修改参考如下(红色为修改行,蓝色为添加行): root@OpenWrt:~# vi /etc/config/network config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config globals 'globals' option ula_prefix 'fd0f:5d48:301c::/48' ### LAN口设置修改,基本不用修改 ### config interface 'lan' option ifname 'eth1' option type 'bridge' option proto 'static' option ipaddr '192.169.1.1' option netmask '255.255.255.0' option ip6assign '60' ### WAN口PPPoE ### config interface 'wan' option ifname 'eth0' ##### option proto 'dhcp' option proto 'pppoe' option 'username' 'user' option 'password' 'password' config interface 'wan6' option ifname '@wan' option proto 'dhcpv6'
三、Wifi设置Wifi配置文件为/etc/config/wireless,下面是设置wifi名称为2934036269,采用psk2认证方式、密码2934036269。 root@OpenWrt:~# vi /etc/config/wireless config wifi-device radio0 option type mac80211 option channel 11 option hwmode 11ng option path 'platform/ar933x_wmac' option htmode HT20 list ht_capab SHORT-GI-20 list ht_capab SHORT-GI-40 list ht_capab RX-STBC1 list ht_capab DSSS_CCK-40 # REMOVE THIS LINE TO ENABLE WIFI: ##### option disabled 1 config wifi-iface option device radio0 option network lan option mode ap option ssid 2934036269 ##### option encryption none option encryption psk2 option key 2934036269
四、安装samba先查询当前可用的samba版本号和包名 root@OpenWrt:/# opkg update root@OpenWrt:~# opkg list | grep samba luci-app-samba - svn-r9834-1 - Network Shares - Samba SMB/CIFS module samba36-client - 3.6.11-2 - Samba 3.6 SMB/CIFS client samba36-server - 3.6.11-2 - The Samba software suite is a collection of programs that implements the SMB protocol for UNIX systems, allowing you to serve files and printers to Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred to as the LanManager or Netbios protocol. 然后安装 root@OpenWrt:~# opkg install samba36-server root@OpenWrt:~# opkg install luci-app-samba root@OpenWrt:~# /etc/init.d/samba enable root@OpenWrt:~# /etc/init.d/samba start root@OpenWrt:~# reboot 配置过程如下: 先增加samba用户root root@OpenWrt:~# smbpasswd -a root 可以使用luci通过Web进行配置 修改root用户可以访问samba,编辑template里面的invalid users = root
五,安装Transmission安装Transmission支持BT下载,以后再BT下载就不用开电脑了,省电。 root@OpenWrt:/# opkg update? root@OpenWrt:~# opkg install transmission-daemon root@OpenWrt:~# opkg install transmission-cli root@OpenWrt:~# opkg install transmission-web root@OpenWrt:~# opkg install transmission-remote root@OpenWrt:~# /etc/init.d/transmission enable root@OpenWrt:~# /etc/init.d/transmission start root@OpenWrt:~# 配置如下: root@OpenWrt: /# vi /etc/config/transmission config transmission option enabled 1 option config_dir '/home/trans' #option user 'nobody' option alt_speed_down 50 option alt_speed_enabled false option alt_speed_time_begin 540 option alt_speed_time_day 127 option alt_speed_time_enabled false option alt_speed_time_end 1020 option alt_speed_up 50 option bind_address_ipv4 '0.0.0.0' option bind_address_ipv6 '::' option blocklist_enabled false option blocklist_url '' option cache_size_mb 2 option dht_enabled true option download_dir '/home/trans/done' option download_queue_enabled true option download_queue_size 4 option encryption 1 option idle_seeding_limit 30 option idle_seeding_limit_enabled false option incomplete_dir '/home/trans/incomplete' option incomplete_dir_enabled false option lazy_bitfield_enabled true option lpd_enabled false option message_level 1 option peer_congestion_algorithm '' option peer_limit_global 240 option peer_limit_per_torrent 60 option peer_port 51413 option peer_port_random_high 65535 option peer_port_random_low 49152 option peer_port_random_on_start false option peer_socket_tos 'default' option pex_enabled true option port_forwarding_enabled true option preallocation 1 option prefetch_enabled true option queue_stalled_enabled true option queue_stalled_minutes 30 option ratio_limit 2.0000 option ratio_limit_enabled false option rename_partial_files true option rpc_authentication_required false option rpc_bind_address '0.0.0.0' option rpc_enabled true option rpc_password '12345678' option rpc_port 9091 option rpc_url '/transmission/' option rpc_username 'zp' option rpc_whitelist '127.0.0.1,192.169.1.*' option rpc_whitelist_enabled true option scrape_paused_torrents_enabled true option script_torrent_done_enabled false option script_torrent_done_filename '' option seed_queue_enabled false option seed_queue_size 10 option speed_limit_down 100 option speed_limit_down_enabled false option speed_limit_up 20 option speed_limit_up_enabled false option start_added_torrents true option trash_original_torrent_files false option umask 18 option upload_slots_per_torrent 14 option utp_enabled true option scrape_paused_torrents true option watch_dir_enabled false option watch_dir '' root@OpenWrt:/ #
、DLNA支持DLNA后,内容在网络上,就相当于云路由器了。 root@OpenWrt:/# opkg update root@OpenWrt:/# opkg install minidlna root@OpenWrt:/# /etc/init.d/minidlna enable root@OpenWrt:/# /etc/init.d/minidlna start 配置如下: root@OpenWrt:~# cat /etc/config/minidlna config minidlna config option 'enabled' '1' option port '8200' option interface 'br-lan' option friendly_name 'OpenWrt DLNA Server' option db_dir '/home/dlna/run/minidlna' option log_dir '/var/log' option inotify '1' option enable_tivo '0' option strict_dlna '0' option presentation_url '' #option notify_interval '900' option notify_interval '60' option serial '12345678' option model_number '1' option root_container '.' list media_dir '/home/dlna' option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg' root@OpenWrt:~# 当前Openwrt固件版本有个Bug,就是往DLNA目录下添加文件,不能自动更新。经验证可以用下面方法解决: 修改/etc/init.d/minidlna在minidlna启动时添加-R参数 start() { …… service_start /usr/bin/minidlna -R -f "$MINIDLNA_CONFIG_FILE" }
|