creating NAT on Raspberry: error adding address

Ask questions about Arch Linux ARM. Please search before making a new topic.

creating NAT on Raspberry: error adding address

Postby favorinus » Tue Apr 26, 2016 2:29 am

arch linux on Raspberry pi.

Has wlan0 and eth0

I want to conect to an AP with wlan0 with ip=192.168.2.3 255.55.255.0 and gateway 192.168.2.1
eth0 is connected to a switch in my house.

I want to have NAT on the raspberry to have internet in my house.

[root@raspberry-wifi netctl]# cat eth0
Description='A basic static ethernet connection'
Interface=eth0
Connection=ethernet
IP=static
Address=('10.0.0.2/24')
#Gateway='10.0.0.1'
DNS=('8.8.8.8')


[root@raspberry-wifi netctl]# cat wireless-wpa-static
Description='A simple WPA encrypted wireless connection using a static IP'
Interface=wlan0
Connection=wireless
Security=wpa
ESSID='xxxx'
Key='xxxx'
IP=static
Address=('192.168.2.3/24')
Gateway='192.168.2.1'
DNS=('192.168.2.1')


[root@raspberry-wifi netctl]# sysctl -a | grep forward
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 1
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.wlan0.forwarding = 1
net.ipv4.conf.wlan0.mc_forwarding = 0
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0


also I have added the iptables:

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i net0 -o wlan0 -j ACCEPT


eth0 works fine, but when I try to start wireless-wpa-static ::

Sep 28 23:11:31 raspberry-wifi systemd[1]: Starting Networking for netctl profile wireless-wpa-static...
Sep 28 23:11:31 raspberry-wifi network[853]: Starting network profile 'wireless-wpa-static'...
Sep 28 23:11:35 raspberry-wifi network[853]: RTNETLINK answers: File exists
Sep 28 23:11:35 raspberry-wifi network[853]: Could not add address '192.168.2.3/24' to interface 'wlan0'
Sep 28 23:11:35 raspberry-wifi network[853]: Failed to bring the network up for profile 'wireless-wpa-static'


what I am doing wrong?

thanks in advance, Mariano
favorinus
 
Posts: 1
Joined: Tue Apr 26, 2016 2:06 am

Return to User Questions

Who is online

Users browsing this forum: No registered users and 30 guests