You are not logged in.

#1 2012-02-22 17:14:54

spctrl
Member
Registered: 2010-06-20
Posts: 32

[SOLVED] netcfg, assigning a static address to wireless card. how?

I have successfully set up my wireless card to act as an AP for my droid by manually starting the services (hostapd, dhcp, iptables, ...) and using ifcfg wlan0 add 192.168.0.1.
However, I have tried to start all this automatically with netcfg through net-profiles in rc.conf and I can't get it to work properly. What happens is that it tries to connect to
the internets through wlan0 rather than just assigning it a static address. I even tried CONNECTION='ethernet' on it to stop it from trying to connect with wep/wpa but no go.
Can I just add a /etc/network.d/interfaces/wlan0 with an IP and ADDR field? Or doesn't that get used unless I am refering to it from some profile?
Help welcome!

Last edited by spctrl (2012-02-22 21:57:12)

Offline

#2 2012-02-22 18:56:09

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] netcfg, assigning a static address to wireless card. how?

You need to establish a profile in /etc/network.d  Read the netcfg and netcfg-profiles man pages and look in /etc/network.d/examples/ethernet-static for your template.

Scott

P.S. Remember to read the forum rules and post the configuration that you're trying to use and where you've looked for help before posting here! You'll typically get a much more detailed response smile

Offline

#3 2012-02-22 19:34:06

spctrl
Member
Registered: 2010-06-20
Posts: 32

Re: [SOLVED] netcfg, assigning a static address to wireless card. how?

Ok I have /etc/network.d/wireless-static:

CONNECTION='ethernet'
DESCRIPTION='foo'
INTERFACE='wlan0'
IP='static'
ADDR='192.168.1.1'

and in /etc/rc.conf:

NETWORKS=(ethernet-dhcp wireless-static)
DAEMONS=(... net-profiles ...)

on boot I get:

Wed Feb 22 20:25:42 2012: :: ethernet-dhcp up    [BUSY]    [DONE] 
Wed Feb 22 20:25:46 2012: :: wireless-static up    [BUSY]  > No connection 
Wed Feb 22 20:25:50 2012:    [FAIL] 

however if i manually do "sudo netcfg wireless-static" once i have booted all goes well? Have no idea why it's not working at boot-time..

Offline

#4 2012-02-22 20:16:57

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] netcfg, assigning a static address to wireless card. how?

My apologies...I didn't read your post carefully enough, and I misunderstood what you were trying to do hmm Unfortunately I don't have any experience setting up a wireless card as an AP...hopefully someone else will come along and be able to answer your question.

Scott

Offline

#5 2012-02-22 21:56:43

spctrl
Member
Registered: 2010-06-20
Posts: 32

Re: [SOLVED] netcfg, assigning a static address to wireless card. how?

Ok, it's working now. I started hostapd before net-profiles in the daemons array in rc.conf, but not really sure why I have to do that..

Offline

#6 2012-08-26 06:13:55

cleanrock
Member
Registered: 2008-11-17
Posts: 109

Re: [SOLVED] netcfg, assigning a static address to wireless card. how?

I got my wlan AP working now and i also tried to use netcfg to configure the interface, at last i noticed the SKIPNOCARRIER='yes' option so i can configure the interface before starting hostapd:

CONNECTION='ethernet'
DESCRIPTION='wlan access point'
INTERFACE='wlan0'
IP='static'
ADDR='192.168.1.1'
NETMASK='255.255.255.0'
SKIPNOCARRIER='yes'

Offline

Board footer

Powered by FluxBB