| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| zh:docs:guide-user:network:wifi:atheroswds [2019/08/22 08:07] – [使用SSH] biaji | zh:docs:guide-user:network:wifi:atheroswds [2019/08/22 10:06] – [使用SSH] biaji |
|---|
| </code> | </code> |
| |
| After rebooting, the "ifconfig" command should show a new device named something like "wlan.staN" (where N is a number) in addition to the base "wlan0" wireless interface device. (**Note:** when tested on Barrier Breaker, there was no new interface created, neither on the AP nor on the STA, despite WDS working properly.) | 重启后,"ifconfig"命令将在原有"wlan0"接口设备的基础上,额外显示一个名字类似"wlan.staN"(N为数字)的设备(**注意:** 在Barrier Breaker上进行测试时,不论接入点还是基站都没有创建这个新接口,但WDS还是工作的很正常。) |
| |
| The new wlan.staN interface WILL NOT be bridged by default with the originating wlan interface if that interface is not itself part of a bridge, | 如果原有的wlan接口不是网桥的一部分的话,新的wlan.staN接口默认*不会*被桥接。 |
| If in your setup the AP interface is not already part of a bridge you will need to create a new bridge interface and associate only the AP wlan interface to it. In this case hostapd will automatically add any new wlan.staN interface to the bridge. | 如果您设置的AP接口目前还不是网桥的一部分的话,您必须新建一个网桥接口,并将其关联至接入点wlan接口。这样hostapd才会自动将wlan.staN接口添加至网桥。 |
| |
| === 远端无线终端 === | === 远端无线终端 === |
| |
| Initially connect to the router that will server as remote wireless station using an Ethernet cable. If you haven't already done so, [[docs:guide-user:installation:generic.flashing|install openwrt]] and [[docs:guide-quick-start:walkthrough_login|setup the password]]. SSH into the station. | 首先,使用网线连接至作为远程无线基站使用的路由。如果还没有进行[[docs:guide-user:installation:generic.flashing|安装openwrt]]和[[docs:guide-quick-start:walkthrough_login|设置密码]],则需要先进行。然后用SSH连接至基站。 |
| |
| The first step is preparing the device for the bridging. | 第一步:为桥接准备设备。 |
| |
| If this is a new OpenWrt setup, a DHCP server is enabled on the lan interface of the device by default. This needs to be disabled before the device is connected to the production network (assuming the production network already has DHCP set up). To do so, edit the [[docs:guide-user:base-system:dhcp|/etc/config/dhcp]] file. Find the ''config dhcp 'lan''' section and add the line ''option ignore '1''' to this section. This will disable the DHCP server on the lan interface. (The lan DHCP section will look like the wan DHCP section, as the DHCP server is already disabled on the wan interface by default.)[On Chaos Calmer 15.05 / LuCI (git-15.248.30277-3836b45), I had to disable the DHCP6 server as well, by changing ''option dhcpv6 'server''' to ''option dhcpv6 'disabled'''. MariusMatutiae] | 如果是首次配置OpenWrt,设备的lan接口默认会启用DHCP服务。在设备连接至生产环境网络之前,需要禁用它(假设生产环境网络已经配置了DHCP服务):编辑[[docs:guide-user:base-system:dhcp|/etc/config/dhcp]]文件,找到''config dhcp 'lan'''段落,并在其中添加一行:''option ignore '1'''。这将在lan接口上禁用DHCP服务器。(lan DHCP段与wan DHCP段看起来很类似,只是wan接口默认禁用了DHCP服务。)[在Chaos Calmer 15.05 / LuCI (git-15.248.30277-3836b45)上, 我还要将''option dhcpv6 'server'''改为''option dhcpv6 'disabled'''以禁用DHCP6服务。 --MariusMatutiae] |
| |
| Following this, reconfigure the lan interface to have another address than the default static IP assignment of 192.168.1.1. Edit the [[docs:guide-user:base-system:basic-networking|/etc/config/network]] file. Set the IP to an another address from the same subnet. For example 192.168.1.2. After rebooting the router, remember to access the console & config via the new IP addess. [Now that I rebooted the router with its dhcp server disabled, I had to temporarily set my PC's IP manually in order to access the router and continue this setup process. --Steve Newcomb] | 然后,要将lan接口默认配置的静态IP 192.168.1.1改为其它地址。编辑[[docs:guide-user:base-system:basic-networking|/etc/config/network]]文件。将IP设置为同一子网的其它地址,比如192.168.1.2。然后重启路由。记得用新IP地址访问并进行配置。[因为在前面禁用了DHCP服务,我不得不手动给我的PC设置一个临时IP,以访问路由并继续配置过程。 --Steve Newcomb] |
| |
| Alternatively, you may try to let the router itself to fetch an IP address via DHCP from the AP, but that may leave router inaccessible if the WDS connection does not work and that STA router does not reach the AP with DHCP. If you want to try that: in the ''lan'' section, remove the static IP configuration and reconfigure the interface to use DHCP. This is an example: | 或者,你也可以让路由从访问点通过DHCP获取一个地址,但如果WDS无法按预期工作,或者基站路由无法访问接入点的DHCP服务,可能会导致路由无法访问。方法为:在''lan''段落中,移除静态IP地址配置并将接口设置为使用DHCP,示例如下: |
| |
| <code> | <code> |
| </code> | </code> |
| |
| __**NOTE:**__ LAN interface can stay static ip but need to disable dhcp server for LAN interface. If set LAN interface to get ip from dhcp server then you have to search remote router ip each time you reboot it. | __**注意:**__ LAN接口可以保持静态ip,但必须禁用dhcp服务。如果将LAN接口设置为由dhcp服务获取ip的话,则每次启动时,都会查找远端路由ip。 |
| |
| Once those steps are completed, we can setup the actual wireless link. | 当上述步骤完成后,我们就可以开始设置wifi连接了。 |
| |
| Edit the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] file. In the ''radio0'' section, make sure that the wireless settings match the values in the access point. | 编辑[[docs:guide-user:network:wifi:basic|/etc/config/wireless]]文件。在''radio0''段,需确保无线设置与接入点的对应设置值保持一致。 |
| |
| Further down in the same file, modify the ''wifi-iface'' section to include the desired SSID to which to connect (the same one as on the access point) and ensure WDS is enabled by setting this value to 1. | 同一文件的下面一点,修改''wifi-iface''段,加入想要连接至的SSID(即接入点的SSID),并确认WDS已启用:其值设置为1。 |
| |
| This is an example from /etc/config/wireless on the wireless client bridge device. The specific options may be different depending on the hardware but the SSID, channel, encryption type and password must match the access point, and WDS mode must be turned on. | 以下是一个无线客户端桥接设备的/etc/config/wireless文件示例。某些选项根据硬件不同可能会有所差异,但SSID、无线通道、加密类型必须与接入点保持一致。而且WDS模式必须开启。 |
| |
| <code> | <code> |
| </code> | </code> |
| |
| See the [[docs:guide-user:network:wifi:encryption|Configure WiFi encryption]] for pointer on how to specify encryption and keys. | 参阅[[docs:guide-user:network:wifi:encryption|配置无线密码]]以获取更多密码和密钥配置的信息。 |
| |
| Disconnect the device from the wired network and reboot the device without any wired connection. | 将设备由有线网络断开,并在保持没有有线连接的情况下重启。 |
| |
| The device should boot and automatically connect wirelessly to the access point. **Wait until the client bridge device associates with the access point. This can take 1-2 minutes for the association to happen.** Once this has happened, the **wired interface (e.g. eth0)** should succeed in getting a DHCP address through the new wireless bridge connection. Note that the wireless interface itself on the remote client bridge device does not get an IP address as it is now acting as a transparent bridge. | 设备重启后将自动连入接入点的无线网络。**客户段网桥设备启动并连入接入点需要花费1-2分钟,需要等待这个过程结束。** 然后,**有线接口(比如eth0)**将通过无线桥接连接成功获取DHCP地址。注意,此时远端客户端网桥设备的无线网络自身却不会获取到IP地址,因为它作为透明网桥被使用。 |
| |
| Any //wired devices// connected via Ethernet to the LAN ports on the remote client bridge device should now be transparently bridged into the main network over the wireless link. | 通过LAN端口连接至远端客户端网桥设备的//有线设备//此时已经经由无线连接透明网桥至主网络了。 |
| |
| **无线连接,还需最后一步:** | **无线连接,还需最后一步:** |