I'm on a mission to setup a wireless software access point (WiFi Router) on a basis of Raspberry Pi, Model B, Arch Linux and RLT8188CUS USB WiFi dongle. I have followed the steps described in https://wiki.archlinux.org/index.php/Software_access_point. I have tried both the bridge and the NAT approach for the network configuration. I can see the WLAN created on the basis of RPi. Unfortunately, I can not obtain an IP address from RPi on my Nexus smartphone. I believe something is wrong with my DHCP settings.
Contents of my configuration files are the following:
/etc/hostapd/hostapd.conf
$this->bbcode_second_pass_code('', '
ssid=WiFi
wpa_passphrase=passwd
interface=wlan0
bridge=br0
auth_algs=3
channel=7
driver=rlt871xdrv
hw_mode=g
logger_stdout=-1
logger_stdout_level=2
max_num_sta=5
rsn_pairwise=CCMP
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
')
/etc/netctl/bridge
$this->bbcode_second_pass_code('', '
Description="RPi bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0)
IP=dhcp
')
Static IPv4 address for wlan0 is assigned as
$this->bbcode_second_pass_code('', '
ip link set up dev wlan0
ip addr add 192.168.0.1/24 dev wlan0
')
/etc/sysctl.d/30-ipforward.conf
$this->bbcode_second_pass_code('', '
net.ipv4.ip_forward=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1
')
NAT is enabled with iptables as
$this->bbcode_second_pass_code('', '
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
')
/etc/dhcpd.conf
$this->bbcode_second_pass_code('', '
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
option routers 139.96.30.100;
subnet 139.96.30.0 netmask 255.255.255.0 {
range 139.96.30.150 139.96.30.250;
}
')
I also notice there is an error in DHCP configuration:
$this->bbcode_second_pass_code('', '
dhcpd4.service - IPv4 DHCP server
Loaded: loaded (/usr/lib/systemd/system/dhcpd4.service; enabled)
Active: active (running) since Thu 1970-01-01 23:10:47 CET; 44 years 2 months ago
Process: 2625 ExecStart=/usr/sbin/dhcpd -4 -q -pf /run/dhcpd4.pid (code=exited, status=0/SUCCESS)
Main PID: 2628 (dhcpd)
CGroup: /system.slice/dhcpd4.service
`-2628 /usr/sbin/dhcpd -4 -q -pf /run/dhcpd4.pid
Jan 01 23:10:47 rpi dhcpd[2625]: Wrote 0 leases to leases file.
Jan 01 23:10:47 rpi dhcpd[2625]:
Jan 01 23:10:47 rpi dhcpd[2625]: No subnet declaration for eth0 (10.29.231.68).
Jan 01 23:10:47 rpi dhcpd[2625]: ** Ignoring requests on eth0. If this is not what
Jan 01 23:10:47 rpi dhcpd[2625]: you want, please write a subnet declaration
Jan 01 23:10:47 rpi dhcpd[2628]: Server starting service.
Jan 01 23:10:47 rpi systemd[1]: Started IPv4 DHCP server.
')
Any troubleshooting guidance would be most welcome. Thank you.