hallo iedereen, ik heb arch linux op een Raspberry pi.
Deze heeft wlan0 en eth0
Nu wil ik deze wlan0 met een AP verbinden, met ip=192.168.2.3 255.55.255.0 en gateway 192.168.2.1
de eth0 is verbonden met een switch. Nu wil ik deze twee netwerken verbinden met NAT.
dit is de config die ik nu heb:
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
de 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 werkt goed, maar als ik wireless-wpa-static wil starten::
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'
heeft iemand een idee wat ik fout doe?
groeten uit Argentinie.
Mariano
Deze heeft wlan0 en eth0
Nu wil ik deze wlan0 met een AP verbinden, met ip=192.168.2.3 255.55.255.0 en gateway 192.168.2.1
de eth0 is verbonden met een switch. Nu wil ik deze twee netwerken verbinden met NAT.
dit is de config die ik nu heb:
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
de 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 werkt goed, maar als ik wireless-wpa-static wil starten::
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'
heeft iemand een idee wat ik fout doe?
groeten uit Argentinie.
Mariano