AP implemented with zd1211 + Ubuntu10.04

Source: Internet
Author: User
After the mastermode problem of zd1211 on Ubuntu10.04LTS is solved, the zd1211USB Nic can be used as an AP theoretically. In fact, there are several problems to solve: 1. IP Address allocation. This can be achieved through the DHCP service. 2. The computer on the AP can be connected to the computer on the fixed network card. There are two ideas here: one is that computers on different lines have different subnets, which are solved through fixed routes, and the other is to use bridges to make zd1211 and wired networks the same network. Select

After zd1211 solves the master mode problem on Ubuntu 10.04 LTS, it is theoretically possible to use zd1211 USB Nic as an AP. In fact, there are several problems to solve:

1. IP Address allocation. This can be achieved through the DHCP service.

2. The computer on the AP can be connected to the computer on the fixed network card. There are two ideas here: one is that computers on different lines have different subnets, which are solved through fixed routes, and the other is to use bridges to make zd1211 and wired networks the same network. I chose a bridge.

3. Internet access. This is implemented using firewall software.

1. Configure the AP and bridge.

DHCP is not difficult. The focus is on the settings of the bridge and AP.

To use a bridge, first install brigde-utils: sudo apt-get install bridge-utils.

The bridge setting of the wireless network card is a little different from that of the wired network card. You need to set the wireless network card to AP mode at www.linuxidc.com before proceeding.

I made all the operations into a script bridge_start.sh:

#! /Bin/sh
# Configure the wireless network card to enter AP Mode
Echo: configure the AP mode of the wireless network card
Ifconfig ath0 up
Iwconfig ath0 mode master
Sleep 1
Iwconfig ath0 essid "ZyDAS"
Sleep 1
Iwconfig ath0 rts 250
Sleep 1
Iwconfig ath0 frag 512
Sleep 10
Iwconfig ath0 channel 3
Sleep 10
Iwconfig ath0 rate 54 M auto
Sleep 10
Iwconfig ath0 key 0a0b0c0d0e
Sleep 15
# Bridge
Echo configure the bridge
Ifconfig ath0 down
Ifconfig eth2 down
Brctl addbr br0
Brctl addif br0 ath0
Brctl addif br0 eth2
Ifconfig ath0 0.0.0.0
Ifconfig eth2 0.0.0.0
# Start the bridge and assign an IP address
Echo starts the bridge
Ifconfig br0 192.168.38.1 netmask 255.255.255.0 up
Ifconfig br0 up
# Start the DHCP server
Echo start DHCP
/Etc/init. d/dhcp3-server start
Echo complete
 

Write the script and grant the x permission: sudo chmod + x bridge_start.sh

Run sudo./bridge_start.sh.

Note that DHCP is configured to assign IP addresses to br0. When the system starts, DHCP cannot be started because br0 is not ready, you can set DHCP to manual start. In the script, when br0 is up, you can start the DHCP3 Server.

By this time, the AP can run.

 

The connection test can successfully ping another computer on the wired network (in fact, another virtual machine connected to the Ubuntu Server) and copy files on the Samba Server of the Ubuntu Server. AP successful.

Ii. Configure auto start AP

The above steps can only be manually implemented. If you want an AP with complete functions, you must enable the AP to automatically bootup after power-on.

I once thought about configuring the AP and the bridge in/etc/network/interfaces. The result is that my Ubuntu Server crashes directly during the boot process. Thanks to the snapshot feature of vmware, it has reduced my work on system recovery.

I learned the Ubuntu system boot principle and found a feasible method. At least it is a feasible method in my knowledge. Use udev.

Add a rule file in/etc/udev/rules. d, such as sudo vi/etc/udev/rules. d/75-bridge_on_usb.rules.

# USBB device 0x0ace: 0x1211 (usb)
SUBSYSTEM = "net", ACTION = "add", ATTR {address} = "00: 02: e3: 42: 31: 2b ", RUN + = "/home/monk/bridge_start.sh"
After saving, do not unplug the NIC, restart the system, and the AP runs automatically.

3. access the internet. This is the Shorewall thing. It hasn't been done yet. Next time.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.