Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to get startup file for wireless interface?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ratcheer
n00b
n00b


Joined: 27 Sep 2013
Posts: 14
Location: Alabama, USA

PostPosted: Fri Mar 28, 2014 12:09 am    Post subject: How to get startup file for wireless interface? Reply with quote

I'm a newbie, but I'm making some progress. :wink:

I have successfully turned on kernel support for my Ralink RT-3062 wireless card. After doing that, I got an interface named wlp6s0. The wireless driver is loaded and "lspci -v" shows "Kernel driver in use: rt2800pci"

However, there is no corresponding file in /etc/init.d for starting the interface. I am expecting to have a file net.wlp6s0, but it still does not exist. I have searched the wiki, but everything just refers to running that file, there's nothing on how to create it. Where does that file come from and/or how do I create it?

Tim
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Fri Mar 28, 2014 1:00 am    Post subject: Re: How to get startup file for wireless interface? Reply with quote

ratcheer wrote:
However, there is no corresponding file in /etc/init.d for starting the interface. I am expecting to have a file net.wlp6s0, but it still does not exist.

Tim ... simply create a symbolic link from net.lo to net.wlp6s0 ...

Code:
# ln -s /etc/init.d/net.lo /etc/init.d/net.wlp6s0

For wireless you will need net-wireless/wpa_supplicant and an /etc/wpa_supplicant/wpa_supplicant.conf that describes the AP ... you might also want to provide some configuration in /etc/conf.d/net ... some examples:

/etc/wpa_supplicant/wpa_supplicant.conf
Code:
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel
update_config=1

network={
    ssid="Your_AP/ESSID"
    psk=your_password
    proto=WPA2
    auth_alg=OPEN
    key_mgmt=WPA-PSK
}

... that would be for a WPA2 (your AP may use something else).

You could leave the following undefined (dhcp will be used) but here is an example of various things you could provide as configuration ...

/etc/conf.d/net
Code:
modules_wlp6s0="!plug !iwconfig wpa_supplicant dhcpcd"
wpa_supplicant_wlp6s0="-Dnl80211"
config_wlp6s0="dhcp"
#enable_ipv6_wlp6s0="false" # if you want to disable ipv6

HTH & best ... khay
Back to top
View user's profile Send private message
ratcheer
n00b
n00b


Joined: 27 Sep 2013
Posts: 14
Location: Alabama, USA

PostPosted: Fri Mar 28, 2014 2:41 pm    Post subject: Reply with quote

Thank you, khayyam.

So, if my ethernet interface is also started by a link to net.lo, and it is run automatically at startup, does it need to be run again for wireless, or will the one invocation handle both interfaces?

Tim
Back to top
View user's profile Send private message
ratcheer
n00b
n00b


Joined: 27 Sep 2013
Posts: 14
Location: Alabama, USA

PostPosted: Fri Mar 28, 2014 4:33 pm    Post subject: Reply with quote

ratcheer wrote:
Thank you, khayyam.

So, if my ethernet interface is also started by a link to net.lo, and it is run automatically at startup, does it need to be run again for wireless, or will the one invocation handle both interfaces?

Tim


This is what I have found by experimenting: With only net.enp4s0 started in default run level, wireless was not started. So, I added net.wlp6s0 to default run level. Wireless was still not started. However, if I manually run "/etc/init.d/net.wlp6s0 start", wireless starts, successfully.

Why is automation not working?

Tim
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1361
Location: Montréal

PostPosted: Fri Mar 28, 2014 7:03 pm    Post subject: Reply with quote

Try
Code:
rc-update add net.wlp6s0 boot

_________________
Paul
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Mar 29, 2014 2:46 pm    Post subject: Reply with quote

ratcheer wrote:
Thank you, khayyam.

ratcheer/tim ... you're welcome ...

ratcheer wrote:
This is what I have found by experimenting: With only net.enp4s0 started in default run level, wireless was not started. So, I added net.wlp6s0 to default run level. Wireless was still not started. However, if I manually run "/etc/init.d/net.wlp6s0 start", wireless starts, successfully. Why is automation not working?

Both net.wlp6s0 and net.wlp6s0 "provide net", having both is not "strict[ly]" needed ... /etc/rc.conf has the following to say ...

Quote:
# Do we allow any started service in the runlevel to satisfy the dependency
# or do we want all of them regardless of state? For example, if net.eth0
# and net.eth1 are in the default runlevel then with rc_depend_strict="NO"
# both will be started, but services that depend on 'net' will work if either
# one comes up. With rc_depend_strict="YES" we would require them both to
# come up.
rc_depend_strict="YES"

So, if you want both interfaces to "provide net" then you need to rc_depend_strict="YES". That said, its not clear in your case why both interfaces are needed, or what you're trying to achieve, it may be that you might want to have the interfaces managed by sys-apps/ifplugd or similar ...

HTH & best ... khay
Back to top
View user's profile Send private message
ratcheer
n00b
n00b


Joined: 27 Sep 2013
Posts: 14
Location: Alabama, USA

PostPosted: Sat Mar 29, 2014 5:15 pm    Post subject: Reply with quote

Thank you, again.

I now have everything working satisfactorally, but based on what you just described, I am somewhat more confused than before. It seems that I do have to run both net.enp4s0 and net.wlp6s0, but I don't think I did anything to make it be that way. I certainly did not mess with that variable or, even know that it exists. But, I suppose alls well that ends well. :wink:

Tim
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Mar 30, 2014 2:24 am    Post subject: Reply with quote

ratcheer wrote:
Thank you, again.

... and again, you're welcome.

ratcheer wrote:
I now have everything working satisfactorally, but based on what you just described, I am somewhat more confused than before. It seems that I do have to run both net.enp4s0 and net.wlp6s0, but I don't think I did anything to make it be that way. I certainly did not mess with that variable or, even know that it exists. But, I suppose alls well that ends well.

For them both to be active then you must have added both to the runlevel. Now, when you write "[...] seems that I do have to run both" it suggests thats not your intention, so simply remove one or other from default ... eg:

Code:
# rc-update del net.enp4s0 default

One or other interface "provide[s] net" so any service started via init that requires net is satisfied. Thats the basic idea at least ... the "rc_depend_strict" variable is so that in cases where both (or "all" if there are more than two) interfaces must be available (say if NATing, or in cases where there are many interfaces whose functioning are interdependent) it can be set to YES so that all of these must come up for "net" to be satisfied. This doesn't sound like what you're aiming at, and so I'm fairly sure you don't need both interfaces active (unless you have two seperate subnets or some such) ... that is why I asked about your particular use case, and what you're trying to achieve.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum