Have to run "ifconfig wlan0 192.168.0.1" to get ip.

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby ladrua » Tue Dec 04, 2012 11:32 pm

Hello, first post.
I have set up my rasp to act as a wireless access point with hostapd and dnsmasq.

I can see my network, but cant connect.. timeout without getting ip.

I see from my "ifconfig" that Im not getting a IP for my wlan0.

So, if I run "ifconfig wlan0 192.168.0.1" and try to reconnect.. everything works. dnsmasq gives out an Ip in the range I gave it.

My question is.. what must I do to not have to run "ifconfig wlan0 192.168.0.1" at every boot? There must be someplace I can set this value?

Thanks.
ladrua
 
Posts: 5
Joined: Tue Dec 04, 2012 10:53 pm

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby WarheadsSE » Tue Dec 04, 2012 11:49 pm

Check the upstream Arch wiki for setting a static IP with systemd
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby ladrua » Wed Dec 05, 2012 1:07 am

Thanks for the reply.

I have done that now.. and I ran "systemctl enable network.service" and rebooted.

But it wont give wlan0 an ip until i run "systemctl start network.service", even though I ran the systemctl enable network.service command before reboot..

EDIT:
After running "systemctl enable network.service" and reboot...

$this->bbcode_second_pass_code('', '[root@alarmpi ~]# systemctl status network.service
network.service - Network Connectivity
Loaded: loaded (/etc/systemd/system/network.service; enabled)
Active: failed (Result: exit-code) since Thu, 1970-01-01 01:00:08 BST; 42 years and 11 months ago
Process: 112 ExecStart=/sbin/ip link set dev ${interface} up (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/network.service
')

And after I run "systemctl start network.service"
$this->bbcode_second_pass_code('', '[root@alarmpi ~]# systemctl status network.service
network.service - Network Connectivity
Loaded: loaded (/etc/systemd/system/network.service; enabled)
Active: active (exited) since Wed, 2012-12-05 09:32:21 GMT; 12s ago
Process: 228 ExecStart=/sbin/ip route add default via ${gateway} (code=exited, status=0/SUCCESS)
Process: 225 ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface} (code=exited, status=0/SUCCESS)
Process: 223 ExecStart=/sbin/ip link set dev ${interface} up (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/network.service

Dec 05 09:32:20 alarmpi systemd[1]: Starting Network Connectivity...
Dec 05 09:32:21 alarmpi systemd[1]: Started Network Connectivity.')
ladrua
 
Posts: 5
Joined: Tue Dec 04, 2012 10:53 pm

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby pepedog » Wed Dec 05, 2012 2:59 pm

Don't use network.service, use netcfg.service and of course hostapd.service
Edit /etc/conf.d/netcfg and put file names of both interfaces in NETWORK line

If after all that it still needs command run (I doubt it) then look up how to use postup in /etc/network.d/wlanfile
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby ladrua » Wed Dec 05, 2012 3:41 pm

Thanks, that, and a little help form this forum posthttps://bbs.archlinux.org/viewtopic.php?id=136332 did the trick. Now I have Airplay in my 1969 Beetle. Thanks! :)
ladrua
 
Posts: 5
Joined: Tue Dec 04, 2012 10:53 pm

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby WarheadsSE » Wed Dec 05, 2012 6:50 pm

Awesome. I want pics.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby ladrua » Wed Dec 05, 2012 11:13 pm

Had a little power issue, its a 6v beetle.. But I think I sorted it now with a 5v regulator. Will take some pictures tomorrow and post!
ladrua
 
Posts: 5
Joined: Tue Dec 04, 2012 10:53 pm

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby ladrua » Fri Dec 07, 2012 5:31 pm

http://youtu.be/P2ASS4SWmG4 Here is a video of it in action.
ladrua
 
Posts: 5
Joined: Tue Dec 04, 2012 10:53 pm

Re: Have to run "ifconfig wlan0 192.168.0.1" to get ip.

Postby WarheadsSE » Fri Dec 07, 2012 5:39 pm

Nice.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 35 guests