Raspberry Pi Wireless Router

Source: Internet
Author: User

RaspberryPi can be used in many ways. I will share my experience with you.

As a wireless router, we need to provide dhcp and Wireless AP capabilities through the isc-dhcp-server and hostapd software, forwarding between NICS is directly implemented through iptables defining nat rules.

Install dhcp and ap hotspot services

apt-get install isc-dhcp-serverapt-get install hostapd

Modify/etc/network/interfaces

Add/etc/dhcp/dhcpd. conf

Modify/etc/hostapd. conf

Enable the NIC forwarding capability of the kernel and set the/etc/sysctl. conf

net.ipv4.ip_forward=1

.

Modify the nat rules of iptables

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Add Rules to auto start Mode

iptables-save > /root/nat.rule

New/etc/network/if-pre-up.d/iptables

#!/bin/bash/sbin/iptables-restore < /root/nat.rule 

Or write the rule statement directly into the file.

If your hostapd cannot work properly, it should be hostapd does not support your Nic chip, download: https://github.com/cnsworder/RTL8188-hostapd/archive/master.zip

You can directly compile on raspberrypi (the compilation speed is really slow)

cd hostapdmake;make install

Modify the hostapd configuration file.

I saw the hot spot of Shumei School.

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.