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.