Build a wireless router in Ubuntu

Source: Internet
Author: User
Tags openssh server
PC + dual-nic + 802.11N wireless network card + Ubuntu = super 802.11N wireless soft route there are many wireless router models, but they are similar, but to be honest, the performance is very general, in addition, if there are newer and higher-speed technologies available, you have to pay for it again. There are many cases of using an old idle computer as a router, and the performance is also better than buying a finished router, such as ROS, but most of them are charged. I am a fast fan of those who are unwilling to lag behind. I like to try new technologies. Recently I decided to use my idle computer to install Ubuntu1.

PC + dual-nic + 802.11N wireless network card + Ubuntu = super 802.11N wireless soft route there are many wireless router models, but they are similar, but to be honest, the performance is very general, in addition, if there are newer and higher-speed technologies available, you have to pay for it again. There are many cases of using an old idle computer as a router, and the performance is also better than buying a finished router, such as ROS, but most of them are charged.

I am a fast fan of those who are unwilling to lag behind. I like to try new technologies. Recently I have no time to decide to use my idle computer to install Ubuntu 10.04 and try a free and efficient wireless router.

The following configuration materials are developed by the author. They may not be professional and complete. Please give me some advice.


The accessories used are as follows:
PC: Above P4, M memory, 40 Gb hard disk (this configuration is now mostly used to buy new big appliances in the old ).
Wired Network Adapter: Two 100 M network adapters. if conditions permit, one M network adapter can be used to connect to the broadband network, and one M network adapter can connect to the Intranet (M network adapter is not expensive now ).
Wireless Network Adapter: the author uses the TP-Link TL-WN951N 802.11N 300 M 3X3MIMO network adapter.

Bandwidth: PPPOE

Installation steps:
(1) install Ubuntu Server 10.04 and select DNS server & OpenSSH server (other options can be added as needed) for software installation ).
(2) I personally think it is more convenient to use the root account to manage and install software, so many commands do not need to start with sudo. Enable the root account: sudo passwd root. enter a new password and then log on to the system. (To delete other users, run the following command: userdel-r. The-r parameter indicates remove home directory and mail spool ).
(3) install graphical interfaces for ubuntu server:
> -------------------------------------------
Install the X window system: sudo apt-get install x-window-system-core
Install the logon MANAGER: sudo apt-get install TPD
Install the desktop environment or window manager. install only the most basic components: sudo apt-get install gnome-core. install the complete Ubuntu desktop Environment: sudo apt-get install ubuntu-desktop.
Installation terminal: sudo apt-get install konsole
Install update software Manager
Sudo apt-get install synaptic
Install Resource Manager: sudo apt-get install Konqueror
Installation Chinese display:
Sudo apt-get install language-pack-zh
Sudo apt-get install language-pack-kde-zh
Sudo apt-get install scim
Sudo apt-get install ttf-wqy-zenhei
After the installation is complete, refresh the download list: sudo apt-get update
------------------------------------------- <
(4) Installation DHCP3-SERVER: sudo apt-get install dhcp3-server
(5) server guard bridge kit: sudo apt-get install bridge-utils
(6) install hostapd (Wireless AP mode): sudo apt-get install hostapd, configure the/etc/hostapd. conf file:
> -------------------------------------------
Modify the following parameters
Interface = wlan0
Bridge = br0
Driver = nl80211
Ssid = # Your custom ssid.
# Country_code = US # unregister the country code.
Hw_mode = g # abg Nic can be changed to the corresponding mode value.
Channel = 11 # channel 11 (do not change it; otherwise, the ht_capab = [HT40-] parameter will be affected)
Dtim_period = 1 # Set the DTIM cycle, which is critical to stability.
Rts_threshold = 2347 # You can consider canceling this project to improve the NIC performance. If the change becomes unstable, cancel the cancellation.
Fragm_threshold = 2346 # You can consider canceling this project to improve the NIC performance. If the change becomes unstable, cancel the cancellation.
Macaddr_acl = 1 #0: Allow access to MAC addresses not listed in the hostapd. deny file; 1: Allow access to only the MAC addresses listed in the hostapd. accept file.
Accept_mac_file =/etc/hostapd. accept # specifies the location of the hostapd. accept file.
Deny_mac_flie =/etc/hostapd. deny # specifies the location of the hostapd. deny file.
Auth_algs = 3
Ieee80211n = 1 # If it is n, the parameter is 1; otherwise, it is 0.
Ht_capab = [HT40-] [SHORT-GI-40] [DSSS_CCK-40] # n Nic boot speed of M.
Wpa = 1 # Start WPA, 1 = WPA, 3 = WPA2.
Wpa_passphrase = ************ # WPA password. The length is generally 8-63 ASCII characters.
Wpa_key_mgmt = WPA-PSK # WPA encryption type.
Wpa_pairwise = tkip ccmp # If only WPA2 is enabled, remove the previous TKIP.
Rsn_pairwise = CCMP
------------------------------------------- <
(7) edit the/etc/default/hostapd File
> -------------------------------------------
RUN_DAEMON = "yes" # automatically run hostapd on the startup background.
DAEMON_CONF = "/etc/hostapd. conf" # the location of the hostapd. conf configuration file.
------------------------------------------- <
(8) install UPnP: apt-get install linux-igd
(9) set PPPOE command: pppoeconf
(10) configure the/etc/network/interfaces file:
> -------------------------------------------
Assume that eth0 is the Wan port and eth1 is the Lan port.
Add the following content
# Bridge interface
Auto eth1
Auto wlan0
Auto br0
Iface br0 inet static
Address 192.168.1.1
Network 192.168.1.0
Netmask 255.255.255.0
Broadcast 192.168.1.255
Bridge-ports eth1 wlan0
(The following content is automatically generated by pppoeconf)
Auto dsl-provider
Iface dsl-provider inet ppp
Pre-up/sbin/ifconfig eth0 up # line maintained by pppoeconf
Provider dsl-provider
Auto eth0
Iface eth0 inet manual
------------------------------------------- <
(11) configure the/etc/dhcp3/dhcpd. conf file
> -------------------------------------------
Add the following content at the end of the file
# Subnet for DHCP Clients
Subnet 192.168.1.0 netmask 255.255.255.0 {
Allow booting;
Allow bootp;
Interface br0;
Option domain-name-servers 192.168.1.1;
Default-lease-time 604800; #7 days
Max-lease-time 2592000; #30 days
Range 192.168.1.100 192.168.1.200;
Option subnet-mask limit 255.0;
Option broadcast-address 192.168.1.255;
Option routers 192.168.1.1;
}
------------------------------------------- <

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.