没有合适的资源?快使用搜索试试~ 我知道了~
本文档是用openwrt 14的源码树编译出来的,适合于想要定制openwrt的人员学习
资源推荐
资源详情
资源评论
Contents
1 The Router 3
1.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.2 Initial configuration . . . . . . . . . . . . . . . . . . . . . 3
1.1.3 Failsafe mode . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Configuring OpenWrt . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Wireless . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Advanced configuration . . . . . . . . . . . . . . . . . . . . . . . 16
1.3.1 Hotplug . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.3.2 Init scripts . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.3.3 Network scripts . . . . . . . . . . . . . . . . . . . . . . . . 19
2 Development issues 21
2.1 The build system . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.1.1 Building an image . . . . . . . . . . . . . . . . . . . . . . 21
2.1.2 Creating packages . . . . . . . . . . . . . . . . . . . . . . 24
2.1.3 Creating binary packages . . . . . . . . . . . . . . . . . . 29
2.1.4 Creating kernel modules packages . . . . . . . . . . . . . . 30
2.1.5 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.6 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.7 Using build environments . . . . . . . . . . . . . . . . . . 32
2.2 Extra tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.1 Image Builder . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.2 SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.3 Working with OpenWrt . . . . . . . . . . . . . . . . . . . . . . . 33
1
2 CONTENTS
2.3.1 Compiling/recompiling components . . . . . . . . . . . . 33
2.3.2 Using quilt inside OpenWrt . . . . . . . . . . . . . . . . . 34
2.4 Adding platform support . . . . . . . . . . . . . . . . . . . . . . 35
2.4.1 Which Operating System does this device run? . . . . . . 36
2.4.2 Finding and using the manufacturer SDK . . . . . . . . . 38
2.4.3 Adding your target in OpenWrt . . . . . . . . . . . . . . 45
2.5 Debugging and debricking . . . . . . . . . . . . . . . . . . . . . . 47
2.5.1 Adding a serial port . . . . . . . . . . . . . . . . . . . . . 48
2.5.2 JTAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.6 Reporting bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.6.1 Using the Trac ticket system . . . . . . . . . . . . . . . . 49
2.7 Submitting patches . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.7.1 How to contribute . . . . . . . . . . . . . . . . . . . . . . 50
2.7.2 Where to listen and talk . . . . . . . . . . . . . . . . . . . 50
2.7.3 Patch Submission Process . . . . . . . . . . . . . . . . . . 51
Chapter 1
The Router
1.1 Getting started
1.1.1 Installation
1.1.2 Initial configuration
1.1.3 Failsafe mode
1.2 Configuring OpenWrt
1.2.1 Network
The network configuration is stored in /etc/config/network and is divided
into interface configurations. Each interface configuration either refers directly
to an ethernet/wifi interface (eth0, wl0, ..) or to a bridge containing multiple
interfaces. It looks like this:
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 specifies the Linux interface name. If you want to use bridging on one
or more interfaces, set ifname to a list of interfaces and add:
option type "bridge"
3
4 CHAPTER 1. THE ROUTER
It is possible to use VLAN tagging on an interface simply by adding the VLAN
IDs to it, e.g. eth0.15. These can be nested as well. See the switch section for
this.
config interface
option ifname "eth0.15"
option proto "none"
This sets up a simple static configuration for eth0. proto specifies the protocol
used for the interface. The default image usually provides ’none’ ’static’,
’dhcp’ and ’pppoe’. Others can be added by installing additional packages.
When using the ’static’ method like in the example, the options ipaddr and
netmask are mandatory, while gateway and dns are optional. You can specify
more than one DNS server, separated with spaces:
config interface "lan"
option ifname "eth0"
option proto "static"
...
option dns "192.168.1.254 192.168.1.253" (optional)
DHCP currently only accepts ipaddr (IP address to request from the server)
and hostname (client hostname identify as) - both are optional.
config interface "lan"
option ifname "eth0"
option proto "dhcp"
option ipaddr "192.168.1.1" (optional)
option hostname "openwrt" (optional)
PPP based protocols (pppoe, pptp, ...) accept these options:
• username
The PPP username (usually with PAP authentication)
• password
The PPP password
• keepalive
Ping the PPP server (using LCP). The value of this option specifies the
maximum number of failed pings before reconnecting. The ping inter-
val defaults to 5, but can be changed by appending ”,<interval>” to the
keepalive value
• demand
Use Dial on Demand (value specifies the maximum idle time.
• server: (pptp)
The remote pptp server IP
1.2. CONFIGURING OPENWRT 5
For all protocol types, you can also specify the MTU by using the mtu option.
A sample PPPoE config would look like this:
config interface "lan"
option ifname "eth0"
option proto "pppoe"
option username "username"
option password "openwrt"
option mtu "1492" (optional)
Setting up static routes
You can set up static routes for a specific interface that will be brought up after
the interface is configured.
Simply add a config section like this:
config route foo
option interface "lan"
option target "1.1.1.0"
option netmask "255.255.255.0"
option gateway "192.168.1.1"
The name for the route section is optional, the interface, target and gateway
options are mandatory. Leaving out the netmask option will turn the route into
a host route.
Setting up the switch (broadcom only)
The switch configuration is set by adding a ’switch’ config section. Example:
config switch "eth0"
option vlan0 "1 2 3 4 5*"
option vlan1 "0 5"
On 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<n> where <n> is the VLAN number as used in
the switch driver. As value it takes a list of ports with these optional suffixes:
• ’*’: Set 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
剩余50页未读,继续阅读
资源评论
磨刀的天使
- 粉丝: 13
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C#,煎饼排序问题(Pancake Sorting Problem)算法与源代码
- C#,排列组合的堆生成法(Heap’s Algorithm for generating permutations)算法与源代码
- C#,老鼠迷宫问题的回溯法求解(Rat in a Maze)算法与源代码
- 6693eeb8d683458a07938615fba9e68f.apk
- C#,数值计算,解微分方程的龙格-库塔二阶方法与源代码
- C#,数值计算,用割线法(Secant Method)求方程根的算法与源代码
- C#,子集和问题(Subset Sum Problem)的算法与源代码
- mongodb 数据库基本操作
- Linux操作系统基础教程
- Linux操作系统相关习题集
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功