Difference between revisions of "Talk:Ad-hoc networking"

From ArchWiki
Jump to: navigation, search
m (Client/Server?: closing)
m (NetworkManager: rm closed discussion)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== <s>Client/Server?</s> ==
+
== Custom systemd service (with wpa_supplicant and static IP) ==
  
I was under the impression that this article would describe how to create a ''decentralized'' Ad-Hoc system, that does not depend on a router. [[User:IvarTJ|IvarTJ]] 03:47, 4 August 2011 (EDT)
+
Here is the original unit file by [[User:Bkuri]]:
  
:Before update, the article assumed that there are only two devices in the ad-hoc network. In this context, ''server'' would be the one creating the ad-hoc network and ''client'' the one connecting to it. You are right that ad-hoc is decentralized, [[Ad-hoc_networking#Wifi_link_layer]] mentions complex topologies. Closing. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:08, 2 September 2013 (UTC)
+
{{hc|/etc/conf.d/network-wireless-adhoc@<interface>|<nowiki>
 +
addr=192.168.0.2
 +
mask=24
 +
ssid=MySSID
 +
freq=2432
 +
</nowiki>}}
  
== <s>NetworkManager</s> ==
+
{{hc|/etc/systemd/system/network-wireless-adhoc@.service|<nowiki>
 +
[Unit]
 +
Description=Network connectivity for %i
 +
Wants=network.target
 +
Before=network.target
 +
BindsTo=sys-subsystem-net-devices-%i.device
 +
After=sys-subsystem-net-devices-%i.device
  
Hey, I've created the section (spent a while trying to figure out how to do this, frustratingly it was quite simple in the end). Thought it would be a good idea to add for someone else wanting to do the same. If someone could have a go at doing it an modify it or message me and I'll rectify any issues (if any). --[[User:XFire|XFire]] 20:04, 13 March 2012 (EDT)
+
[Service]
 +
Type=oneshot
 +
RemainAfterExit=yes
 +
EnvironmentFile=/etc/conf.d/network-wireless-adhoc@%i
 +
ExecStart=/usr/bin/iw %i set type ibss
 +
ExecStart=/usr/bin/ip link set %i up
 +
ExecStart=/usr/bin/ip addr add ${addr}/${mask} dev %i
 +
ExecStart=/usr/bin/iw dev %i ibss join ${ssid} ${freq}
 +
ExecStart=/usr/bin/wpa_supplicant -B -i %i -D nl80211,wext -c /etc/wpa_supplicant/adhoc.conf
 +
ExecStop=/usr/bin/ip addr flush dev %i
 +
ExecStop=/usr/bin/ip link set %i down
  
:Merged into [[NetworkManager#Ad-hoc]], closing. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:05, 2 September 2013 (UTC)
+
[Install]
 +
WantedBy=multi-user.target
 +
</nowiki>}}
 +
 
 +
It is fundamentally flawed as the [[Ad-hoc_networking#WPA_supplicant|wpa_supplicant method]] is a replacement to the [[Ad-hoc_networking#Manual_method|manual method]], but he reported that the service file in [[Ad-hoc networking#Custom systemd service (with wpa_supplicant and static IP)]] does not work for him (see [[User Talk:Bkuri#Systemd with wpa_supplicant and static IP (ad-hoc version)]]). If the service file from the main page does not work for you and this one does, please provide some details so that we have some base ground on resolving this problem. Thanks. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:31, 2 September 2013 (UTC)

Latest revision as of 23:23, 18 December 2013

Custom systemd service (with wpa_supplicant and static IP)

Here is the original unit file by User:Bkuri:

/etc/conf.d/network-wireless-adhoc@<interface>
addr=192.168.0.2
mask=24
ssid=MySSID
freq=2432
/etc/systemd/system/network-wireless-adhoc@.service
[Unit]
Description=Network connectivity for %i
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network-wireless-adhoc@%i
ExecStart=/usr/bin/iw %i set type ibss
ExecStart=/usr/bin/ip link set %i up
ExecStart=/usr/bin/ip addr add ${addr}/${mask} dev %i
ExecStart=/usr/bin/iw dev %i ibss join ${ssid} ${freq}
ExecStart=/usr/bin/wpa_supplicant -B -i %i -D nl80211,wext -c /etc/wpa_supplicant/adhoc.conf
ExecStop=/usr/bin/ip addr flush dev %i
ExecStop=/usr/bin/ip link set %i down

[Install]
WantedBy=multi-user.target

It is fundamentally flawed as the wpa_supplicant method is a replacement to the manual method, but he reported that the service file in Ad-hoc networking#Custom systemd service (with wpa_supplicant and static IP) does not work for him (see User Talk:Bkuri#Systemd with wpa_supplicant and static IP (ad-hoc version)). If the service file from the main page does not work for you and this one does, please provide some details so that we have some base ground on resolving this problem. Thanks. -- Lahwaacz (talk) 08:31, 2 September 2013 (UTC)