On Sun, May 15, 2016 at 09:36:19PM +0200, LÉVAI Dániel wrote:
> hostname.athn0:
> ==========8<==========
> media autoselect
> mode 11g
> chan 10
> nwid daniell
> wpakey _
> wpaprotos wpa2
> mediaopt hostap
> #nwflag hidenwid
> inet6 eui64
> up

> ##!/sbin/ifconfig athn0 media autoselect mode auto mediaopt hostap
> #!/sbin/ifconfig athn0 chan 10
> #!/sbin/ifconfig athn0 media autoselect mode 11g chan 10 mediaopt hostap

You don't need '!/sbin/ifconfig athn0' at the start of a line in hostname.athn0.
That's redundant because the default action is to pass the line as arguments
to 'ifconfig athn0'.

Note that each line in hostname.athn0 invokes ifconfig separately.
For each command which affects media settings, ifconfig will read the
current media settings from the kernel, tweak them, and write them back.
Quite possibly there is a bug which causes some of your media settings
to get lost while individual commands from your hostname.athn0 lines
are run in quick succession. I suspect that if you run just one media
settings command you will not hit this problem.

So try putting all your media settings on a single line in your
hostname.athn0 file, instead of splitting media commands across
several lines with other commands in-between. Like this:

media autoselect mode 11g chan 10 mediaopt hostap

Does that help? It has the same effect as this line you wrote:

!/sbin/ifconfig athn0 media autoselect mode 11g chan 10 mediaopt hostap

> ==========8<==========
> 
> hostname.athn1:
> ==========8<==========
> media autoselect
> mode 11a
> chan 36
> nwid daniell
> wpakey _
> wpaprotos wpa2
> mediaopt hostap
> #nwflag hidenwid
> inet6 eui64
> up
> ==========8<==========
> 
> athn1 comes up just fine, but athn0 gets configured only half-baked:

Reply via email to