Improved Network Wizard (and rc.network)

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#541 Post by Dougal »

PaulBx1 wrote:Anyway, you probably don't need a hundred copies of backup, do you? Last time I cleaned them out, there must have been a hundred copies in /etc. Take a look at that code I supplied to limit it to 4 copies. Seems like that should be enough.
The code introduced in November should limit it to just the last one (I think you need to delete the others manually...).
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#542 Post by PaulBx1 »

Did that get into 4.1.2? I recently deleted all the backups, and already have 11 new ones.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#543 Post by Dougal »

PaulBx1 wrote:Did that get into 4.1.2? I recently deleted all the backups, and already have 11 new ones.
It should have been, so either I missed one place where it creates a backup, or you have an old version of rc.network in your pup_save...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#544 Post by PaulBx1 »

Huh, it turned out I did have one in /initrd/pup_rw/etc/rc.d; don't know why. However according to "diff" it was identical to the one in /initrd/pup_ro2/etc/rc.d. Anyway I renamed the one in the pupsave and rebooted. That didn't add any new resolv.conf's. We'll see...

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

/etc/resolv.conf

#545 Post by gyro »

How many backups of /etc/resolv.conf should be kept?
None.
Backups of /etc/resolv.conf are just a waste of space in a production environment.
This code should be commented out, in a release version.

When should /etc/resolv.conf be cleared?
Never.
An empty /etc/resolv.conf always produces a 99% useless network.
The Internet works on IP addresses not host names.
Before your machine can open a connection to a server, it needs to find the IP address of that server. It does this by sending a query to a nameserver. To find the IP address of a nameserver to query, it reads /etc/resolv.conf.
An /etc/resolv.conf containing a vaild but inappropriate nameserver IP address will most likely still produce a working network.
It's better to have an old /etc/resolv.conf than an empty /etc/resolv.conf.

When should /etc/resolv.conf be clobbered?
If, and only if, nameserver (DNS) IP addresses are provided.

When should DNS and Gateway be configured?
If, and only if, the up-stream/Internet interface is being statically configured?
Both of these entries should only be configured once on each machine.
The Gateway can only be configured if the network on which it exists has already been configured. So this might as well be done at the same time as this network, the up-stream network, is configured.
Might as well configure both the once only things at the same time.

When should an interface be statically configured?
If it's a down-stream interface.
Specify only the IP address and the netmask.

When should dhcp be used to configure an interface?
Always on the up-stream interface.
It not only gives the machine a valid IP address, it also defines the Gateway IP address, and clobbers /etc/resolv.conf with the DNS IP addresses given to it.
And, it automatically updates this information should it ever change.
This means that you can connect the machine to any network with a dhcp server (most do these days), and the network just works. Quite handy on a laptop.

But dhcp doesn't work?
If you are absolutely sure that there is only one Puppy machine active on your network, there could be a problem with the dhcp server.
Otherwise change the hostname of each Puppy machine to be unique, and try again. Some dhcp servers will not lease two IP addresses to the same hostname.
By default the hostname of every Puppy machine is "puppypc". Change this in both /etc/hostname and /etc/hosts, and reboot the machine.

gyro

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#546 Post by PaulBx1 »

I now have 10 backup copies of resolv.conf.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#547 Post by Dougal »

PaulBx1 wrote:I now have 10 backup copies of resolv.conf.
Well, for the life of me I can't figure out how they could accumulate: every time before moving it to the backup, it deletes all the old backups!

Anyway, I found a way to solve it once and for all: now it is copied to resolv.conf.old (rather than using the PID of the process running), so there can only be one backup...

See the parent post.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

hayagix
Posts: 131
Joined: Sat 07 Jun 2008, 15:41

#548 Post by hayagix »

I'm having pretty good luck with network wizard with puplets using 2.6.27 and 2.6.28 kernels.

Ralink 2500usb linux drivers and wpa interact well.

The only glitch I have is having to edit /etc/network-wizard/wireless/wpa_profiles. I need to change "defaultpsk" to the necessary key "xxxxxxx".

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#549 Post by Dougal »

hayagix wrote:I'm having pretty good luck with network wizard with puplets using 2.6.27 and 2.6.28 kernels.

Ralink 2500usb linux drivers and wpa interact well.

The only glitch I have is having to edit /etc/network-wizard/wireless/wpa_profiles. I need to change "defaultpsk" to the necessary key "xxxxxxx".
You mean the passphrase (or rather: the 64-char hex key) isn't substituted in there?
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

hayagix
Posts: 131
Joined: Sat 07 Jun 2008, 15:41

#550 Post by hayagix »

Yes. My passphrase. There is no 64-char hex key.


ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
ssid="PRT 2"
scan_ssid=1
psk="defaultpsk"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP

wireless profile -

TITLE="PRT_2"
WPA_DRV="wext"
WPA_TYPE=""
WPA_AP_SCAN="1"
ESSID="PRT 2"
NWID=""
KEY="tastycritters"
MODE="managed"
SECURE="open"
FREQ="2.437G"
CHANNEL="6"
AP_MAC="00:40:B3:W4:G5:7R"

When I exchange my "tastycritters" for "defaultpsk" I connect perfectly.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#551 Post by Dougal »

hayagix wrote:Yes. My passphrase. There is no 64-char hex key.


ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
ssid="PRT 2"
scan_ssid=1
psk="defaultpsk"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
This is strange... I just tested the code in the wizard and it should have replaced that line, just like it replaced the ssid line...
The one thing that seems odd about your profile is that you don't have a scan_ssid line at the top (it should be the second line, after ctrl_interface) -- that should also have been updated at the same time.
Are you using a non-English locale? Maybe that is somehow affecting sed...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

hayagix
Posts: 131
Joined: Sat 07 Jun 2008, 15:41

#552 Post by hayagix »

Sorry. Might have pasted info from an older profile. There were two and I normally delete the extras. My locale is English.
I deleted all profiles and reran the wizard. ap_scan ssid is present.
Passphrase glich has not changed.
Thanks.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#553 Post by Dougal »

hayagix wrote:Sorry. Might have pasted info from an older profile. There were two and I normally delete the extras. My locale is English.
I deleted all profiles and reran the wizard. ap_scan ssid is present.
Passphrase glich has not changed.
Thanks.
Could you try doing this again while running the wizard from a terminal ("net-setup.sh -d")? Maybe it'll show some error that will shed some light on this...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

hayagix
Posts: 131
Joined: Sat 07 Jun 2008, 15:41

#554 Post by hayagix »

# net-setup.sh -d
OK
PSK is |"tastycritters"
d2f21e85945b764d767df453ccc4fa14628de9bb5875586fd4eef84c29b1f8b7|
sed: -e expression #1, char 47: unterminated `s' command
PSK is |"tastycritters"
d2f21e85945b764d767df453ccc4fa14628de9bb5875586fd4eef84c29b1f8b7|
Configuring interface wlan0 to network PRT 2 with wpa_supplicant...
Waiting for connection...
EXIT="Ready"
aborted

cat: /tmp/wpa_status.txt: No such file or directory
rm: cannot remove `/tmp/wpa_status.txt': No such file or directory
OK
c4fa14628de9bb5875586fd4eef84c29b1f8b7|
Configuring interface wlan0 to network PRT 2 with wpa_supplicant...
Waiting for connection...
EXIT="Ready"
aborted

cat: /tmp/wpa_status.txt: No such file or directory
rm: cannot remove `/tmp/wpa_status.txt': No such file or directory
OK

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#555 Post by Dougal »

hayagix wrote:PSK is |"tastycritters"
d2f21e85945b764d767df453ccc4fa14628de9bb5875586fd4eef84c29b1f8b7|
sed: -e expression #1, char 47: unterminated `s' command
Aha, that it the problem. i'll look and see why that happens.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#556 Post by Dougal »

hayagix wrote:PSK is |"tastycritters"
d2f21e85945b764d767df453ccc4fa14628de9bb5875586fd4eef84c29b1f8b7|
I think I found what caused that, but have no idea why it happened:
wpa_passphrase return a few lines, including:

Code: Select all

#psk="tastycritters"
psk=d2f21e85945b764d767df453ccc4fa14628de9bb5875586fd4eef84c29b1f8b7
so to get the psk, the wizard used grep "[^#]psk" -- which worked fine with my test scripts, but apparently in your case it didn't exclude the commented out line...

Try the new version and see if it fixes that problem.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

hayagix
Posts: 131
Joined: Sat 07 Jun 2008, 15:41

#557 Post by hayagix »

March 3rd wizard works like a charm. Thanks.

# net-setup.sh -d
OK
PSK is |d2f21e85945b764d767cf453ccc4fa14628de9rr5875586fd4eef84c29b1f8b7|
PSK is |d2f21e85945b764d767cf453ccc4fa14628de9rr5875586fd4eef84c29b1f8b7|
Configuring interface wlan0 to network PRT 2 with wpa_supplicant...
Waiting for connection...
completed
EXIT="Ready"

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
dhcpcd: MAC address = 00:d0:51:t4:07:32
dhcpcd: your IP address = 10.2.2.81
#

98clru
Posts: 1
Joined: Fri 27 Feb 2009, 22:51

improved network wizard

#558 Post by 98clru »

Took a while to get converted to .pet but since I did my asus 900a is keeping the network settings after shutdown. Haven't run into any problems yet, of course most of the functionality I didn't need as I already had functioning network but had to be reinitialized with each reboot.

The connection is not established any more quickly (actually think it's less quickly) than right clicking on connection then directing to autoconnect with wif / ethernet but as it is a single step now to reboot/start that makes it easy enough for my wife to use!

I lost my touchpad on the ssd install, fortunately kept the usb drive version but will try fresh install to ssd soon and report on wifi unless someone else beats me to it.

Thanx Dougal!

User avatar
sue
Posts: 23
Joined: Sat 10 May 2008, 03:41
Location: Anaheim, CA, USA

iwlagn mssing from network wizard DB

#559 Post by sue »

iwlagn and maybe iwl5100 is missing from the network wizard DB.

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Re: iwlagn mssing from network wizard DB

#560 Post by Dougal »

sue wrote:iwlagn and maybe iwl5100 is missing from the network wizard DB.
Do you mean they're missing from the list of WPA supporting modules, or from the list of modules offered for you to load?

I've added them to the WPA whitelist, but the modules offered list is generated from /etc/networkmodules (or "ethernetmodules", I'm not sure), which is supposed to be updated by whoever compiles the kernel...
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

Post Reply