没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
1 OpenWRT-Document 中文
内容
1 路由器
1.1 开始
1.1.1 安装
1.1.2 初始配置
1.1.3 安全模式
1.2 配置 OpenWrt
1.2.1 网络
1.2.2 无线
1.3 高级配置
1.3.1 热插拔
1.3.2 初始化脚本
1.3.3 网络脚本
2 开发需知
2.1 构建系统
2.1.1 构建一个镜像
2.1.2 创建包
2.1.3 创建内核模块包
2.1.4 Conventions
2.1.5 Troubleshooting
2.1.6 Using build environments
2.2 Extra tools
2.2.1 Image Builder
2.2.2 SDK
2.3 Adding platform support
2.3.1 Which Operating System does this device run?
2.3.2 Finding and using the manufacturer SDK
2.4 Debugging and debricking
2.4.1 Adding a serial port
2.4.2 JTAG
2.5 Reporting bugs
2.5.1 Using the Trac ticket system
2.6 Submitting patches
2.6.1 How to contribute
2.6.2 Where to listen and talk
2.6.3 Patch Submission Process
1.1 第一节
路由器 1.1 开始
1.1.1 安装
1.1.2 初始化配置
1.1.3 Failsafe mode
1.2 1.2 配置 OpenWrt
1.2.1 1.2.1 网络
Kamikaze 中的网络配置信息储存在 /etc/config/network 文件中,并且各个接口都有自己的配置。每个接口的配置直接关
联到一个 eth 或者 wifi 接口(eth0, wl0, ..) ,或者桥接到多个接口。像下面这样:
config interface "lan"
option ifname "eth0"
option proto "static"
option ipaddr "192.168.1.1"
option netmask "255.255.255.0"
option gateway "192.168.1.254"
option dns "192.168.1.254"
ifname 定义了特殊的 Linux 接口。如果你想桥接到一个或者多个接口,设置 ifname 为一个接口列表,并添加:
option type "bridge"
可以通过简单的加入 VLAN ID 号标记来使用 VLAN,例如 eth0.1。这样就可以了。
这里对 eth0.proto 有一个简单的静态配置来描述该接口所使用的协议,默认的 Image 中通常会提供'none' 'static', 'dhcp'
和'pppoe'方式。其他方式,可以通过加载包来安装其他协议。
像例子中这样使用'static'方法时,ipaddr 和 netmask 是强制的,gateway 和 dns 是可选的。你可以指定不止一个的 DNS
server,用空格分开。
DHCP 目前只可以设置 ipaddr(希望从 server 请求的 IP 地址)和 hostname(客户端主机名标签),两者都是可选的。PPP 协议族
接受如下选项:
基于 PPP 的协议(pppoe, pptp, ...) 接受下列选项:
� username
� The PPP username (usually with PAP authentication)
� password
� The PPP password
� keepalive
� Ping PPP server(使用 LCP)。这个选项定义了重连前的失败 ping 最大个数。这个 ping
间隔默认为 5,但是可以通过附加"," 来修改 keepalive 值。Ping the PPP server
(using LCP). The value of this option specifies the maximum number of failed
pings before reconnecting. The ping interval defaults to 5, but can be changed
by appending "," to the keepalive value(注:我的路由器中此值叫 ‘LCP 响应故障阈
值’)(http://www.cisco.com/en/US/tech/tk713/tk507/technologies_tech_note0918
6a00800ae945.shtml)
� demand
� Use Dial on Demand (value specifies the maximum idle time).单位为秒,在此时间后
断开非活动连接
� server: (pptp)
� 远程 pptp server IP The remote pptp server IP
对于所有类型的协议,都可以通过设置 mtu 选项来设置 MTU。
设置静态路由 Setting up static routes
你可以给特定的接口设置静态路由,它将在该接口被配置以后显示出效果。
像下面这样简单的加入:
config route foo
option interface lan
option target 1.1.1.0
option netmask 255.255.255.0
option gateway 192.168.1.1
route 段中的 name 是可选的,interface,target 和 gateway 选项是强制的。不使用 netmask 选项将会使该 route 设置成 host
route。
The name for the route section is 可选的, the interface, targetand gateway options are mandatory. Leaving
out the netmaskoption will turn the route into a host route.
设置交换(目前仅支持 broadcom)Setting up the switch (currently broadcom only)
交换设置需要加入'switch'设置段。例如:
The switch configuration is set by adding a 'switch'config section. 例子:
config switch "eth0"
option vlan0 "1 2 3 4 5*"
option vlan1 "0 5"
在 Broadcom 的硬件上,段名称需要是 eth0,所以交换驱动不能识别其他物理交换设备。每个 vlan 选项都要有个名字 vlan,是交
换驱动中使用的 VLAN 序号。这些值可以取如下后缀:
VLANOn Broadcom hardware the section name needs to be eth0, as the switch driver does not detect the switch on any
other physical device. Every vlan option needs to have the name vlan where is the VLAN number as used in the switch
driver. As value it takes a list of ports with these 可选的 suffixes:
� '*': 将当前 VLAN 设置成该端口的默认 VLANSet the default VLAN (PVID) of the Port
to the current VLAN
� 'u': 强制该端口为非标记的 Force the port to be untagged
� 't': 强制该端口为标记的 Force the port to be tagged
CPU 的端口默认是标记的,其他所有端口为非标记。在 Broadcom 硬件上,CPU 端口永远是 5。其他端口可能会因不同的硬件而异。
The CPU port defaults to tagged, all other ports to untagged. On Broadcom hardware the CPU port is always 5. The other
ports may vary with different hardware.
例如,如果你希望有 3 个 vlan,3 个端口用于交换,1 个端口是 DMZ(隔离区),另外一个端口是 WAN 口,可以使用如下配置:
For instance, if you wish to have 3 vlans, like one 3-port switch, 1 port in a DMZ, and another one as your WAN interface,
use the following configuration :
config switch "eth0"
option vlan0 "1 2 3 5*"
option vlan1 "0 5"
option vlan2 "4 5"
交换层将会自动建立 3 个接口:eth0.0(vlan0), eth0.1(vlan1) and eth0.2(vlan2)。
Three interfaces will be automatically created using this switch layout : eth0.0(vlan0), eth0.1(vlan1)
andeth0.2(vlan2). You can then assign those interfaces to a custom network configuration name
like lan, wanordmzfor instance.
Setting up IPv6 connectivity
OpenWrt supports IPv6 connectivity using PPP, Tunnel brokers or static assignment.
If you use PPP, IPv6 will be setup using IP6CP and there is nothing to configure.
To setup an IPv6 tunnel to a tunnel broker, you can install the 6scriptspackage and edit
the/etc/config/6tunnelfile and change the settings accordingly :
config 6tunnel
option tnlifname 'sixbone'
option remoteip4 '1.0.0.1'
option localip4 '1.0.0.2'
option localip6 '2001::DEAD::BEEF::1'
option prefix '/64'
� 'tnlifname': Set the interface name of the IPv6 in IPv4 tunnel
� 'remoteip4': IP address of the remote end to establish the 6in4 tunnel. This
address is given by the tunnel broker
� 'localip4': IP address of your router to establish the 6in4 tunnel. It will
usually match your WAN IP address.
� 'localip6': IPv6 address to setup on your tunnel side This address is given
by the tunnel broker
� 'prefix': IPv6 prefix to setup on the LAN.
Using the same package you can also setup an IPv6 bridged connection :
config 6bridge
option bridge 'br6'
By default the script bridges the WAN interface with the LAN interface and uses ebtables to filter anything that is
not IPv6 on the bridge.
IPv6 static addressing is also supported using a similar setup as IPv4 but with the ip6prefixing (when applicable).
config interface "lan"
option ifname "eth0"
option proto "static"
option ip6addr "fe80::200:ff:fe00:0/64"
option ip6gw "2001::DEAF:BEE:1"
1.2.2 1.2.2 无线网络 Wireless
WiFi 设置储存在/etc/config/wireless 中(目前支持 Broadcom, Atheros 和 mac80211)。当第一次启动路由器时,将会
自动检测你的卡并且创建简单的配置文件。默认情况下 'option network lan' 是被注释掉的。它提供了一个非安全的无线网
络共享。
The WiFi settings are configured in the file /etc/config/wireless(currently supported on Broadcom, Atheros and
mac80211). When booting the router for the first time it should detect your card and create a sample configuration
file. By default 'option network lan' is commented. This prevents unsecured sharing of the network over the wireless
interface.
每一个无线驱动都有自己的配置脚本/lib/wifi/driver_name.sh ,用来处理驱动选项和配置。这个脚本也调用特殊二进制,
例如 Broadcom 的 w1c,或者 atheros 的 hostapd 和 wpa_supplicant 。
Each wireless driver has its own configuration script in /lib/wifi/driver_name.sh which handles driver specific
options and configurations. This script is also calling driver specific binaries like wlc for Broadcom, or hostapd
and wpa_supplicant for atheros.
使用不同的架构配置是因为不同的驱动配置。
The reason for using such architecture, is that it abstracts the driver configuration.
标准的 Broadcom 无线配置: Generic Broadcom wireless config:
config wifi-device "wl0"
option type "broadcom"
option channel "5"
剩余114页未读,继续阅读
资源评论
Just810
- 粉丝: 10
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Windows系统下安装与配置Neo4j的步骤
- 基于matlab实现潮流计算和最优潮流计算的程序1,对毕业设计有一定用处.rar
- 基于大数据学习资源推荐系统的设计与实现(部署视频)-kaic.mp4
- 哈工大形式语言和自动机2022期末含答案
- Windows系统下安装与配置Neo4j的步骤
- 哈希算法(Hash Algorithm)是一种将任意长度的二进制数据映射为较短的、固定长度的二进制值的函数.txt
- Windows系统下安装与配置Neo4j的步骤
- 在二叉树或更复杂的树形结构中,先序输出叶结点.txt
- 列出所有祖先结点的概念通常与树形结构或图论中的节点相关.txt
- 基于matlab实现潮流计算程序,MATLAB潮流计算程序.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功