You are not logged in.

#1 2011-03-26 18:55:10

olivine
Member
Registered: 2009-10-24
Posts: 19

netcfg and net-auto-wired issues

I'm trying to set-up netcfg and net-auto-wired to connect my laptop as painlessly as possible with a static IP at work and with a dhcp profile at home. The problem (as mentioned in other posts) is that net-auto-wired will keep trying to connect with the dhcp profile in both places. To get around this, I've tried using the customized netcfg.action posted by cgarcia on this page: https://bugs.archlinux.org/task/17190?s … &project=1 , using the AUTO_WIRED flag in the static profile.

As a result, I can connect properly with the static IP at work. However, now my set-up keeps connecting with the static IP profile at home as well. The daemon seems to think that the static connection is fine even though I actually get no connection at all with it (obviously). I do not understand why it doesn't realize that and doesn't try the other profile. Unfortunately, my knowledge of bash is pretty poor.

Is there something obvious that I have missed?

Last edited by olivine (2011-03-26 18:56:14)

Offline

#2 2011-03-26 23:51:19

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: netcfg and net-auto-wired issues

Look at it from the point of view of the computer. Unlike a wireless connection where it can see N networks, all of which are identified by ESSID, the lan part is just the lan port, and the computer doesn't know what network its plugged in to.

So it'll try whatever default you have (I think it depends on the name of the network.d profile). If that doesn't work it'll fallback on the next one. I doubt its possible to have the behaviour you seem to be asking for (connect to different profile based on location), because netcfg doesn't know where you're sitting when you plug that cable in.


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

#3 2011-03-27 09:38:29

olivine
Member
Registered: 2009-10-24
Posts: 19

Re: netcfg and net-auto-wired issues

Thanks for the explanation. I thought that somehow the computer not only connects, but also check that the connection actually works.

I guess I'll try that with a script: connect to profile A, check connection with a ping and if it doesn't work switch to profile B. Would it make sense to modify netcfg.action, or is it better to write a separate script that runs at startup and starts netcfg as needed? (any pointers to wiki/help for this kind of scripting would be appreciated).

Offline

#4 2011-03-27 10:25:24

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: netcfg and net-auto-wired issues

olivine wrote:

Thanks for the explanation. I thought that somehow the computer not only connects, but also check that the connection actually works.

I guess I'll try that with a script: connect to profile A, check connection with a ping and if it doesn't work switch to profile B. Would it make sense to modify netcfg.action, or is it better to write a separate script that runs at startup and starts netcfg as needed? (any pointers to wiki/help for this kind of scripting would be appreciated).

net-auto-wired, if I remember correctly, tries another profile if the first fails (doesn't connect due to no DHCP reply etc).

The 'quickest' hackery script I'd use is to use two static IPs, one in each location. Try the first one, then log the result of a quick ping to the router (or some permanent machine). If that fails try the second one.

You don't need to involve netcfg since you're basically duplicating its work.


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

#5 2011-05-06 08:44:26

made_in_nz
Member
From: Wellington, New Zealand
Registered: 2010-01-04
Posts: 53

Re: netcfg and net-auto-wired issues

And bear in mind that the lastest netcfg.action is broken for static ips, though this has been fixed in the latest code.  You can manually apply this patch to fix it: https://bugs.archlinux.org/task/17190?getfile=4924
If there's any netcfg dev reading this, any word on when the next release might be?  There looks like a lot of good changes in store since the last release which was over a year ago.

Offline

Board footer

Powered by FluxBB