You are not logged in.
Ok, I made the switch, and I like it. I was lacking a way to monitor the connectivity, so I wrote a lightweight tray icon (80 loc).
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
from __future__ import with_statement
import gtk
import gobject
import subprocess
import shlex
TIMEOUT = 5
class MainApp:
def __init__(self):
self.icon = gtk.StatusIcon()
self.update_icon()
gobject.timeout_add_seconds(TIMEOUT, self.update_icon)
def get_connected(self, gateway):
try:
stdout = subprocess.check_output(shlex.split("ping -q -w 3 -c 1 %s" % gateway))
return True
except subprocess.CalledProcessError:
return False
def get_network_info(self):
"""
In case anyone experiment bugs with this method,
http://en.wikipedia.org/wiki/Routing might be handy
"""
interface = None
connected = False
stdout = subprocess.check_output(shlex.split("ip route show"))
for line in stdout.split("\n"):
route = line.split(" ")
if len(route) >= 5 and (route[0], route[1], route[3]) == ("default", "via", "dev"):
gateway = route[2]
interface = route[4]
connected = self.get_connected(gateway)
break
return {"interface": interface, "connected": connected}
def get_icon_name(self, info):
if info["connected"]:
if info["interface"].startswith('eth'):
return 'network-wired'
else:
return 'network-wireless'
else:
return 'network-error'
def update_icon(self):
info = self.get_network_info()
icon_name = self.get_icon_name(info)
self.icon.set_from_icon_name(icon_name)
if info["connected"]:
tooltip = "Connected on %s" % info["interface"]
else:
tooltip = "Disconnected"
self.icon.set_tooltip_text(tooltip)
return True
if __name__ == "__main__":
try:
MainApp()
gtk.main()
except KeyboardInterrupt:
pass
Of course, there is a mirror on github: https://github.com/chmduquesne/netmon/b … ter/netmon
Offline
Hi guys!
I'm new to Arch and I tried to upgrade to netctl following wiki instructions, but connection fails.
I have a wireless connection with dhcp¹
the first time I thought there was some problems with old netcfg profile, even if I edited it manually, substituting all variables to camelcase, according to man page netctl.profle. so I removed it and copied a wireless-wpa example in the netctl folder and edited it. Neither this worked, even if I auto-enable it with netctl-auto@myinterface.service.
So, I tried wifi-menu to create another profile with same features as the old one (with a wpa key). It asked me to choose the profile and enter wpa key as usual.
The output was the same. "Job for netctl@etcetera.service failed. See 'systemctl status nectl@etcetera.service' and 'journactl -xn' for details.
Thanks for help!
¹(I cannot set it up to static due to router firmware)
EDIT: Nevermind. Found the solution. I just have to add an IP6 variable set with dhcp to my profile, after finding an ipv6 error from the 'systemctl status' output, and only after changing the profile name (maybe some troubles with hyphen characters... what a retard I was).
Last edited by Babelfish (2013-04-16 11:27:08)
Offline
Hello,
I'm migrating from netcfg, I have a question reading the wiki https://wiki.archlinux.org/index.php/Netctl. It says :
Warning: netctl conflicts with netcfg so disable existing netcfg@<profile> service before installing netctl.
If I disable netcfg before installing netctl, how am I supposed to install netctl if I do not have Internet access for downloading packages and installing them ? I see two options here :
- I am supposed to make an offline installation of netctl. Which options of pacman do I use for that ?
- The wiki is wrong and it meant "disable existing netcfg services before enabling netctl"
EDIT : third option, using another method for connexion than netcfg, such as a manual use of wpa_supplicant and dhcp
Last edited by Vinouz (2013-04-16 11:26:11)
Offline
Hello,
I'm migrating from netcfg, I have a question reading the wiki https://wiki.archlinux.org/index.php/Netctl. It says :
Warning: netctl conflicts with netcfg so disable existing netcfg@<profile> service before installing netctl.
If I disable netcfg before installing netctl, how am I supposed to install netctl if I do not have Internet access for downloading packages and installing them ? I see two options here :
- I am supposed to make an offline installation of netctl. Which options of pacman do I use for that ?
- The wiki is wrong and it meant "disable existing netcfg services before enabling netctl"EDIT : third option, using another method for connexion than netcfg, such as a manual use of wpa_supplicant and dhcp
The second option was also good. AFAIK, archlinux packages *never* start a service when installed. So you can install netctl safely, and then play with systemctl for enabling/disabling the right services.
Last edited by duquesnc (2013-04-16 13:04:18)
Offline
Hi,
Yesterday I changed from initscripts to systemd, and then from netcfg to netctl. Wireless works, but not at boot. This is because I have to turn off power saving to my card. So I first issue the command "/usr/sbin/iwconfig wlan0 power off". After that I start the wireless with netctl and it works excellent.
What is the best way to automate this at boot?
Thanks!
Offline
Guys, can anyone answer please my question above or at least current question?
How to get that shit working?
I've disabled netcfg profile before migration. Then issued "netctl enable ethernet-static". But it doesn't set my ip on boot with an error: the device is already up.
Please, help!
Offline
Try rebooting first.
Offline
This is turning into a netctl support thread, which was not its purpose. Please post separate topics for issues you may be facing.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
This is turning into a netctl support thread, which was not its purpose.
Then the wiki boldly contradicts you:
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670
Offline
Its a wiki, not a bible. Support threads do have a history in these forums, but until/unless jouke confirms that this is a support thread I'm considering it not to be one. Support threads just get messy.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
With netcfg, I could specify profile order. For example, if I wanted to bring up a tap interface, then bridge that tap interface to an Ethernet interface and assign an IP address, I could specify NETWORKS=(tuntap bridge) in /etc/conf.d/netcfg. This is necessary as I (obviously) have to create the tap interface before trying to bridge it. I have not, however, discovered a way to order profiles with netctl.
Offline
netctl has the arrays BindsToInterfaces and After to deal with profile order and interface dependencies. You have to enable the profiles mentioned in After manually, though.
Last edited by progandy (2013-04-21 00:28:07)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Thank you, progandy! BindsToInterfaces is exactly what I need. Not sure how I missed it in NETCTL.PROFILE(5), but it's right there:
An array of physical network interfaces that this profile needs
before it can be started. For `enabled' profiles, *systemd* will
wait for the presence of the specified interfaces before starting a
profile. If this variable is not specified, it defaults to the value
of 'Interface'.
Perfect.
Offline
Someone will can writter a guide to netctl to dummies.
Offline
It works like a charm. Only openvpn is not working. According to the man pages it`s not supported.
Will be the openvpn connection type added?netcfg openvpn profile:
CONNECTION="openvpn" INTERFACE="ignore" OVPN_CONFIG="/etc/openvpn/clients/lan/input-udp-1194.ovpn" OVPN_FLAGS=""
or to use systemd to control openvpn profiles is a better choice.
https://wiki.archlinux.org/index.php/Op … figuration
Last edited by seenxu (2013-04-30 09:13:12)
Offline
Hi.
I don't know if I'm using netcfg, then I don't know if iI must migrate to netctl. How can I know it?
If I browse /etc/network.d in order to see "my profiles" only I find two subfolders: examples and interfaces. The /examples subfolder contains different files (examples I figure) that I never edited them, and /interfaces subfolder does'nt contain anything.
Then have I to migrate? I'm using netcfg...
sorry for my english and thank you
(Note: I use wired connection)
Last edited by ppsalama (2013-04-30 11:21:00)
Offline
<snip>
But I'm getting timeout-error messages during/after startup regarding wired and strangely enough also the wireless connection when no cable is plugged. Both wireless and wired connect if cable is present during boot, but I still get the following message:Timed out waiting for device sys-subsystem-net-devices-multi-user.service
[DEPEND] Dependency failed for Automatic wired/wireless network connection using netctl profilesI'm sure this is because I've somehow misconfigured this, but I've read the man pages, and to be frank, info is pretty sparse atm.
-- https://bbs.archlinux.org/viewtopic.php … 5#p1252585
Hey.
Did you solve this problem? I'm getting the same error and I don't know why. Internet is working fine so the profile should be all fine... just this annoying timeout.
Offline
Hi,
I'm reading about the switch from netcfg to netctl to avoid problems when I actually try the switch, but I'm a bit confused.
I don't seem to have netcfg installed, I don't have profiles in an associated folder in /etc.
All I have seems to be simple network support and this in my rc.conf:
interface=eth0
address=
netmask=
broadcast=
gateway=
# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"
and I use 'sudo pon' and 'sudo poff' for connections.
So what does that mean for my switch to netctl? What do I have to do? Nothing, just install netctl? All the advices I read don't seem to apply to my simple config.
Offline
this in my rc.conf
Sorry, you're still using /etc/rc.conf?
Because, netctl isn't for you then. netctl is for use with systemd, and if you're still using rc.conf to setup your network connections, I have a feeling you might not have done the systemd update yet… and that happened a while ago…
All the best,
-HG
Offline
4on6 wrote:this in my rc.conf
Sorry, you're still using /etc/rc.conf?
Actually, I did switch to systemd quite sometime ago, and there is nothing else in my rc.config than the lines cited above. I remember that I couldn't connect to the internet otherwise, so I probably skipped the move to netcfg when I should have done it.
But now netcfg is kind of obsolete, and I'm asking myself how to move directly to netctl from my minimal rc.conf configuration?
Offline
Did you already read over the wiki?
https://wiki.archlinux.org/index.php/Netctl
Based on your rc.conf, it seems you would just use the profile for ethernet-dhcp. Actually, you wouldn't even need netctl. You can just enable the dhcpcd service.
Offline
Did you already read over the wiki?
https://wiki.archlinux.org/index.php/Netctl
Based on your rc.conf, it seems you would just use the profile for ethernet-dhcp. Actually, you wouldn't even need netctl. You can just enable the dhcpcd service.
Yes, I read it, and even more stuff, but got a bit confused how all the advices relate to my minimal setup. You actually solved my problem, because now I know what I need. Thanks.
Offline
I used to use networkmanager with the kdeplasma-applet to handle wifi connections.
When i am on a new wifi network -hotel, coffee bar- i have to create a new profile and enable it, correct?
So, i must know the protection mode -wpa, wpa2, wep- and the default gateway.
Assuming that the most reception-people dont even know some kind of information, is there any way to have an applet?
Offline
I don't think it has a tray icon yet, but you want to keep an eye on the progress of WiFiz:
Offline
I had issues when first setting up netctl. My network always failed on boot, but after logged in I could issue:
# netctl start <myprofile>
And my network came up (same with both wired and wireless)
After checking the systemd journal, I discovered I was getting a conflict on boot at the devices were set up (wn... and en.....) then when netctl-auto@..... and netctl-ifplugd@..... were activated, they were failing as the devices already existed, so netctl failed to start on boot.
My solution was to simply name the profiles to the exact same name as the actual devices. netctl now starts on boot without issue.
Cheers.
Offline