Improved Network Wizard (and rc.network)

Under development: PCMCIA, wireless, etc.
Message
Author
ejfrolich
Posts: 1
Joined: Sun 28 Dec 2008, 14:38

WiFi

#521 Post by ejfrolich »

Hello all,

I am new to Puppy, not to linux (i use Ubutu). I use 4.1.2 on my old Topline Amicus 3100 with a Celeron 466 and 192mb of ram. For WiFi I use a E-Tech WGPC03 pcmcia card.

It was a bit of a hassle to get it working. The live CD was not regognising the card. After instalation (FULL) it's vissible. I used the wizzatd to get it working. It took a while before it was clear to me I had to reboot before it would work. Now it works directly after bootup. After about 20 or so min. It just stops. The lights of the card are stil lit but it will not work annymore. After a reboot it again works well but after about 20 or so min... again it stops... :?:

HELP!

I use DHCP. I tyed today to cofigure a fixed IP adress. It does not work. It then still sees my DHCP adres. Can I get rid of my DHCP configuration??
Last edited by ejfrolich on Mon 29 Dec 2008, 12:52, edited 1 time in total.

JMX
Posts: 23
Joined: Mon 29 Dec 2008, 06:06

#522 Post by JMX »

PaulBx1 wrote:I have two network interfaces, one wireless (wlan0, 192.168.1.15) and one ethernet (eth0, 192.168.1.14). It was my intention to use eth0 for a LAN and wlan0 (connected to my wireless router which is 192.168.1.1) for the internet, using static ip addresses.
I think my problem was very similar to yours.

I wanted to alternately choose between my wired RJ45 connection and my PCMCIA wireless connection in a single laptop, with both devices in the same subnet. But I kept getting that SIOCADDRT error when trying to connect via my other onboard device. I do not use DHCP anywhere in my private network.

The trick, I think, is to avoid the SIOCADDRT error. This attaches like glue, it seems, whenever DHCP is invoked, even one time. The only way I could get rid of it was to start afresh and to never accidentally run DHCP. (If there is a way to completely undo the DHCP tags without the reboot procedure, that would be nice.)

Here is what I did to get it going…

1) I booted from the CD using “puppy pfix=ram

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

#523 Post by gyro »

JMX wrote:I wanted to alternately choose between my wired RJ45 connection and my PCMCIA wireless connection in a single laptop, with both devices in the same subnet. But I kept getting that SIOCADDRT error when trying to connect via my other onboard device.
I would be surprised if you had any problems with the wizard and/or dhcp, if you only plugged in only one of the devices at a time. Either unplug the ethernet cable, or unplug the PCMCIA card. Both when configuring them, and when using them.

gyro

User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

#524 Post by rjbrewer »

gyro;

I think connecting, disconnecting a few hundred times is likely to
wear out the card contacts.
When I have both wifi and rj45 connected I use the wizard:
load modules
more
unload module I'm not using (and blacklist if necessary)

rjb

JMX
Posts: 23
Joined: Mon 29 Dec 2008, 06:06

#525 Post by JMX »

gyro wrote:I would be surprised if you had any problems with the wizard and/or dhcp, if you only plugged in only one of the devices at a time.
Good point.

But I have been doing some more tweaking. I can now move back and forth from DCHP to static routing in real time without rebooting and without any SCIOADDRT errors, and without plugging/unplugging cards.

I simply run a script like this for the desired network device:


#!/bin/bash
ifconfig eth0 down
ifconfig eth1 down
rm /var/run/dhcpcd/*
rm /var/lib/dhcpcd/*
ifconfig eth1 192.168.0.71
route add default gw 192.168.0.1 eth1
echo nameserver 4.2.2.1 > /etc/resolv.conf
echo nameserver 66.243.243.101 >> /etc/resolv.conf
ifconfig eth1 up


If I want to be sure to use that particular ethernet device at bootup I simply put the above script in the Startup folder. The script seems to effectively clean out all prior “hidden

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

#526 Post by PaulBx1 »

Normally each interface is in a different network. Configure eth0 to be 192.168.2.1
Ah. Shoulda figured out that by myself. :roll:

I tried that. That is, I specified eth0 as 192.168.2.14, and the gateway as 192.168.1.1, which would be on the same network as the other interface, wlan0. Unfortunately the wizard complained that "Your gateway 192.168.1.1 is not on this network." Since as you say, each computer needs only one gateway, it appears the wizard is in error assuming the gateway must be on any particular network. In fact it looks like the wizard is assuming a gateway is on a per-network (per-interface) basis, which does in fact jive with the fact that gateways are specified on interface configurations, not computer-wide configurations. Your claim that gateways are a per-computer thing makes more sense to me, but something is off here...

BTW, a per-computer gateway would seem to imply that the wizard must include checks that the gateway on all interfaces is the same.

Maybe the network wizard is not really up to handling complex requirements. If I'm building a server, I should simply not use it.
It's not clear what you want to achieve with eth0. If you want to attach other machines to it and have traffic pass through your Puppy machine to the internet, then you are trying to make your Puppy machine a router and there are quite a few more considerations. How do you intend to pass on the DNS addresses and you eth0 address as their gateway, (will you run a dhcp server on your Puppy machine). How is the upstream router 192.168.1.1 going to know about the network that is beyond your Puppy machine, (will you run a NAT firewall on your Puppy machine).
Yeah, I'm trying to make something like a proxy server including a NAT firewall and other such frills. I am a total newbie on networks so I don't even know if these things are possible. So your questions are mostly answered by "huh?" Guess I need to do a lot more reading. As to DHCP server, I tend to like things simple, don't like extraneous services and daemons running. Since these are small, static networks, it looks like DHCP should not be needed. I also don't see why it should have any connection at all to DNS, but then again, I don't know anything.

I'm thinking of making my server an OpenBSD rather than a Puppy one, since there seems to be a lot of know-how about this sort of application on the internet.

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

#527 Post by gyro »

JMX wrote:I simply run a script like this for the desired network device:


#!/bin/bash
ifconfig eth0 down
ifconfig eth1 down
rm /var/run/dhcpcd/*
rm /var/lib/dhcpcd/*
ifconfig eth1 192.168.0.71
route add default gw 192.168.0.1 eth1
echo nameserver 4.2.2.1 > /etc/resolv.conf
echo nameserver 66.243.243.101 >> /etc/resolv.conf
ifconfig eth1 up
That's pretty much what dhcpcd would do, only dynamically. (No hard coded addresses.)
JMX wrote:The script seems to effectively clean out all prior “hidden

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

#528 Post by gyro »

PaulBx1 wrote:I tried that. That is, I specified eth0 as 192.168.2.14, and the gateway as 192.168.1.1, which would be on the same network as the other interface, wlan0. Unfortunately the wizard complained that "Your gateway 192.168.1.1 is not on this network." Since as you say, each computer needs only one gateway, it appears the wizard is in error assuming the gateway must be on any particular network. In fact it looks like the wizard is assuming a gateway is on a per-network (per-interface) basis, which does in fact jive with the fact that gateways are specified on interface configurations, not computer-wide configurations. Your claim that gateways are a per-computer thing makes more sense to me, but something is off here...
I think the wizard is only providing you with an opportunity to specify the gateway on each interface, since it does not know which interface connects to the up-stream network, and hence contains the address of the up-stream router. i.e. in your case you should only specify 192.168.1.1 as the gateway when configuring wlan0. When configuring eth0 as 192.168.2.14, leave the gateway field and dns fields blank. (In the eth0 network, you are the gateway, and the down-stream machines are going to have to specify 192.168.2.14, as their gateway.)
PaulBx1 wrote:Yeah, I'm trying to make something like a proxy server including a NAT firewall and other such frills.
I'm not sure if there's proxy software available on Puppy, but it does have a NAT firewall which can be easily utilised to turn Puppy into an Internet connection sharing router. (Done that.)
PaulBx1 wrote:As to DHCP server, I tend to like things simple, don't like extraneous services and daemons running. Since these are small, static networks, it looks like DHCP should not be needed. I also don't see why it should have any connection at all to DNS, but then again, I don't know anything.
DHCP makes networking a whole lot simpler, because it automatically passes on vital network information, (this is especially handy should any of that information change.)

If I were attempting to setup such a box I would use the dhcp client on the up-stream interface. This not only gives me an IP address that will work on the existing network, but it also sets up my box with a default gateway to the upstream router, and also configures my box to use the DNS servers that are used on the current network.
I would also run a dhcp server on my box so that down-stream machines can be automatically configured with a valid IP address, to use me as their gateway, and use the DNS server information that was given to me.
I would also enable NAT on my firewall, so I can use local/non-routing IP addresses on my down-stream network, and also avoid having to "tell" the up-stream router about my down-stream network.

Good luck with your box.

gyro

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

#529 Post by PaulBx1 »

Unfortunately, I have gotten things in a state where I cannot change anything, at least over boot. Now, whenever I boot, my wireless interface wlan0 cannot find the internet. That is because it insists on using the static IP stuff I had set up previously (where eth0 grabbed the 192.168.1.1 gateway first, so wlan0 is stuck). Even if I reconfigure both interfaces using dhcp, so I can then get to the internet (and "ifconfig" shows the ipaddress I had assigned to wlan0, 192.168.1.15, has been replaced by one handed out by the router), when I reboot, the ipaddress is back to 192.168.1.15 and the gateway is borked.

Yes, I saved the configuration.

This sounds like other complaints I have heard, that changes done with the network wizard do not get saved. Has that problem been fixed already in this thread? I suppose I could plow through all 36 pages to find out... :(

BTW, your recommendations are starting to make sense to me. Takes a while to sink in; I'm not as sharp as I used to be.

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

#530 Post by PaulBx1 »

I tried to dig into why my config does not get saved over a boot. Here is the rxvt session of that. The original condition is just after a boot:

Code: Select all

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:13:A9:5F:3F:EA  
          inet addr:169.254.220.217  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1209 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:253646 (247.7 KiB)
          Interrupt:16 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:18:DE:62:8F:54  
          inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:274 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:98810 (96.4 KiB)  TX bytes:13060 (12.7 KiB)

wmaster0  Link encap:UNSPEC  HWaddr 00-18-DE-62-8F-54-00-00-00-00-00-00-00-00-00                                                                   -00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# cd /etc
# cd network-wizard/
# ls
network  wireless
# cd network/
# ls
interfaces
# cd interfaces/
# ls
00:13:A9:5F:3F:EA.conf  00:18:DE:62:8F:54.conf
#    
#           
# cat 00:13:A9:5F:3F:EA.conf

IS_WIRELESS=''
# 
# 
# cat 00:18:DE:62:8F:54.conf
IS_WIRELESS='yes'
# 
# pwd
/etc/network-wizard/network/interfaces
# 
# cd ..  
# ls
interfaces
# cd ..
# ls
network  wireless
# cd wireless/
# ls
interfaces  profiles  wpa_profiles
# cd interfaces/
# ls
00:18:DE:62:8F:54.conf
#                           
# 
# cat 00:18:DE:62:8F:54.conf
INT_WPA_DRV='wext'
USE_WLAN_NG=''
# 
# 
# cd ..
# ls 
interfaces  profiles  wpa_profiles
# cd profiles/
# ls
00:1A:70:65:23:4A.WPA.conf  autoconnect.conf  template.conf
# 
# cat 00:1A:70:65:23:4A.WPA.conf
TITLE="OregonHome"
        WPA_DRV="wext"
        WPA_TYPE=""
        WPA_AP_SCAN="1"
        ESSID="OregonHome"
        NWID=""
        KEY=*CENSORED*
        MODE="managed"
        SECURE="open"
        FREQ="2.437G"
        CHANNEL="6"
        AP_MAC="00:1A:70:65:23:4A"
        
STATIC_IP='yes'
IP_ADDRESS='192.168.1.15'
NETMASK='255.255.255.0'
DNS_SERVER1='10.61.2.1'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'
STATIC_IP='yes'
IP_ADDRESS='192.168.1.15'
NETMASK='255.255.255.0'
DNS_SERVER1='10.61.2.1'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'
STATIC_IP='yes'
IP_ADDRESS='192.168.1.15'
NETMASK='255.255.255.0'
DNS_SERVER1='10.61.2.1'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'
STATIC_IP='yes'
IP_ADDRESS='192.168.1.15'
NETMASK='255.255.255.0'
DNS_SERVER1='10.61.2.1'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'
STATIC_IP='yes'
IP_ADDRESS='192.168.1.15'
NETMASK='255.255.255.0'
DNS_SERVER1='10.61.2.1'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'
STATIC_IP='yes'
IP_ADDRESS='192.168.1.15'
NETMASK='255.255.255.0'
DNS_SERVER1='10.61.2.1'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'


# pwd
/etc/network-wizard/wireless/profiles
# 
# cat autoconnect.conf 
TITLE="autoconnect"
        IP=""
        GATEWAY=""
        ESSID="any"
        NWID=""
        KEY="off"
        MODE="Managed"
        SECURE="open"
        FREQ=""
        CHANNEL=""
        AP_MAC=""
# 
# cat template.conf 
TITLE="template"
        IP="192.168.0.3"
        GATEWAY=""
        ESSID="hotspot"
        NWID=""
        KEY=""
        MODE="Managed"
        SECURE="open"
        FREQ="2.437G"
        CHANNEL=""
        AP_MAC=""
# 
# 
# #NOW I WILL RUN THE NETWORK WIZARD
# 
# 
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:13:A9:5F:3F:EA  
          inet addr:169.254.2.209  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1602 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:336639 (328.7 KiB)
          Interrupt:16 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:18:DE:62:8F:54  
          inet addr:192.168.1.112  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:371 errors:0 dropped:0 overruns:0 frame:0
          TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:132743 (129.6 KiB)  TX bytes:18787 (18.3 KiB)

wmaster0  Link encap:UNSPEC  HWaddr 00-18-DE-62-8F-54-00-00-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# 
However the contents of none of the files were modified when I exited the wizard telling it to "save". What I had done with the network wizard was using dhcp for both interfaces, after which wlan0 now could get to the internet (until next boot).

Notice, the MAC of my interfaces are 00:13... and 00:18... However for some reason, down in the WPA directory, it is acting as if the interface has a MAC of 00:1A...

I suspect the old static IP stuff that is showing up in my ifconfig after boot comes from that strange-looking file, 00:1A:70:65:23:4A.WPA.conf. The addresses in there are the ones I assigned to wlan0 a couple days ago. I don't know what they are doing in a WPA configuration file anyway.

JMX
Posts: 23
Joined: Mon 29 Dec 2008, 06:06

#531 Post by JMX »

gyro wrote: The problem you have had with the Puppy Network Wizard + rc.network, is not a limitation of the IP software, but rather it seems to be a limitation of the wizard and rc.network. It assumes that both interfaces need to be configured, and/or brought up, at the same time.
Okay. That would explain the symptoms I was seeing when I was relying exclusively on the network wizard. This is not a big issue because it has a simple solution. I was kinda excited when my first custom linux script actually solved the problem. I come from a 98SE and DOS environment so I have a learning curve ahead of me with all of this new fangled terminology.

The NOP remaster of Puppy with Xfce and Thunar is awesome and is going to make the transition a real pleasure. I was favoring Slackware distributions so when I came across Puppy with its thorough wireless card support and Slack12 package compatibility I was leashed. So now it looks like I will be searching this forum frequently. It looks like most everything is already answered. I just got to search.

I now have complete control of my network cards in real time, wired and wireless, within just a couple of clicks and without rebooting. I could not do that on the other OS.

Thanks!

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

#532 Post by gyro »

PaulBx1 wrote:I tried to dig into why my config does not get saved over a boot.
Sorry, I don't know why the wizard + rc.network is not restoring your configuration across a boot.

But I can explain a couple of minor points:
PaulBx1 wrote:# ifconfig
eth0 Link encap:Ethernet HWaddr 00:13:A9:5F:3F:EA
inet addr:169.254.220.217 Bcast:169.254.255.255 Mask:255.255.0.0
The IP address "169.254.n.n" is generated by the dhcp client when it failed to get one from a dhcp server.
PaulBx1 wrote:# ls
interfaces profiles wpa_profiles
# cd profiles/
# ls
00:1A:70:65:23:4A.WPA.conf autoconnect.conf template.conf
The MAC address here is that of your wireless Access Point (router), not the MAC address of your interface.

Also looking in "/tmp/bootsysinit.log" will often show if anything is failing during boot, (hint from Dougal if my memory serves correctly)

gyro

PS: Looking at "cat 00:1A:70:65:23:4A.WPA.conf ", maybe it's time for a fresh start.

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#533 Post by edoc »

Sorry to pile-on but ...

When I use Menu-Setup-NetworkWizard, then choose ath0 for wireless, then click on Wireless, then select Draft-N as the previously saved connection and Load it I always get an error saying there was no connection.

When I press Test ath0 I then always get an OK and may proceed to Auto DHCP.

Because of this xautoconnect cannot be used.
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

OldTxPup

Got connection on boot to work

#534 Post by OldTxPup »

I recently discovered Puppy Linux and loaded it on a Gateway Solo 3350 laptop. I was happy to see that my D-Link DWL-G630 wireless card worked using a WPA2/AES connection with a hidden SSID. The module being used is the ath_pci module.

I ran into the problem of the connection not automatically establishing itself on boot up. So I decided to throw in some debug echo statements in rc.network and wga-profiles.sh to see what is happening. I manage to determine that it would timeout in validateWpaAuthentication.

By chance I decided to perform an 'ifconfig ath0 up' through the console window and happened to notice that my wireless card started its scan and then established a connection in a about 2 seconds. So I decide to throw in an 'ifconfig $INTERFACE down' followed immediately by an 'ifconfig $INTERFACE up' just prior to the validateWpaAuthentication. Sure enough on reboot the connection worked and the interface acquired an IP Address.

Having achieved success, I decided to see if I could localize how far back in the process that this trick would no longer work and possibly give a hint as to what might be the problem area. It turns out that it has to do with the iwlist scan. If I move the ifconfig down/up statements prior to the iwlist scan the trick no longer works. So I suspect that the iwlist scan leaves either the ath_pci driver or the wireless card in some state that does not allow the authentication to complete. Apparently the ifconfig down/up sequence clears out that state and allows the WPA Authentication process to go on and work as it should.

So my current working configuration has the ifconfig down/up statements just after the last iwlist scan on line 441 of /etc/rd.d/rc.network.

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

#535 Post by PaulBx1 »

I found the line that creates files like this:

Code: Select all

TITLE="Cody"
        WPA_DRV="wext"
        WPA_TYPE=""
        WPA_AP_SCAN="1"
        ESSID="BrownieNet"
        NWID=""
        KEY="CENSORED"
        MODE="managed"
        SECURE="open"
        FREQ="2.437G"
        CHANNEL="6"
        AP_MAC="00:1A:70:6B:AE:BE"
        
STATIC_IP='yes'
IP_ADDRESS='192.168.1.11'
NETMASK='255.255.255.0'
DNS_SERVER1='216.166.159.7'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'
STATIC_IP='yes'
IP_ADDRESS='192.168.1.11'
NETMASK='255.255.255.0'
DNS_SERVER1='216.166.159.7'
DNS_SERVER2='216.166.159.6'
GATEWAY='192.168.1.1'
It is this line in net-setup.sh:

Code: Select all

echo -e "${MODECOMMANDS}" >>"${PROFILES_DIR}/${PROFILE_AP_MAC}.${PROFILE_ENCRYPTION}.conf"
It seems this code can be executed more than once, for a given interface configured, if one goes into the static IP selection more than once (for example, when changing an address). However it is more ugly than disfunctional, since it appears the last entry is the one that is used.

One problem though; if you ever set up something with a static IP address, it looks like it can never be changed back to DHCP, because the variable assignment "STATIC_IP='yes'" never gets reset anywhere.

On another subject, I found why there are so many /etc/resolv.conf backup files. I reported it elsewhere and repeat it here:
The net-setup.sh script contains this line:

Code:
mv -f /etc/resolv.conf /etc/resolv.conf.$$


Unfortunately, over time that causes /etc to fill up with piles of resolv.conf files. A better way to do it would be this:

Code:
if [ -f /etc/resolv.conf.-2 ]; then mv -f /etc/resolv.conf.-2 /etc/resolv.conf.-3; fi
if [ -f /etc/resolv.conf.-1 ]; then mv -f /etc/resolv.conf.-1 /etc/resolv.conf.-2; fi
if [ -f /etc/resolv.conf ]; then mv -f /etc/resolv.conf /etc/resolv.conf.-1; fi


Three backups should be enough.
I will post this in the network wizard thread too.

<later>
I just noticed rc.network has this same bit of code. In other words, when booting, rc.network may create another backup resolv.conf file. This seems to be an error. rc.network should execute the files created by the network wizard, not generate more of them. The comment there said the routine setupStaticIP was a hacked version of the same routine in net-setup.sh, however it appears it was not hacked enough!

Oh, and one more item. If you search for the file net-setup.sh, you find the usual one in /usr/sbin, and another, older copy in /usr/local/net-setup/usr/sbin. And there is some other old stuff down there. It seems this should be cleaned out.

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

Re: Got connection on boot to work

#536 Post by Dougal »

OldTxPup wrote:So my current working configuration has the ifconfig down/up statements just after the last iwlist scan on line 441 of /etc/rd.d/rc.network.
Ok, I've added that. Nice catch.
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

#537 Post by Dougal »

PaulBx1 wrote:It is this line in net-setup.sh:

Code: Select all

echo -e "${MODECOMMANDS}" >>"${PROFILES_DIR}/${PROFILE_AP_MAC}.${PROFILE_ENCRYPTION}.conf"
It seems this code can be executed more than once, for a given interface configured, if one goes into the static IP selection more than once (for example, when changing an address). However it is more ugly than disfunctional, since it appears the last entry is the one that is used.

One problem though; if you ever set up something with a static IP address, it looks like it can never be changed back to DHCP, because the variable assignment "STATIC_IP='yes'" never gets reset anywhere.
Ok, I've added cleaning up the old info.
On another subject, I found why there are so many /etc/resolv.conf backup files.
This was reported already and cleanup code added in November, according to the changelog.

<later>
I just noticed rc.network has this same bit of code. In other words, when booting, rc.network may create another backup resolv.conf file. This seems to be an error. rc.network should execute the files created by the network wizard, not generate more of them. The comment there said the routine setupStaticIP was a hacked version of the same routine in net-setup.sh, however it appears it was not hacked enough!
No. If I'm not mistaken, the backing up of resolve.conf was always done in rc.network, since dhcpcd also re-generates it.
setupStaticIP must re-generate it since rc.network has no idea where you booted last time! So the existing resolve.conf could have been generated on a different computer and either for a static IP of by dhcpcd.
Oh, and one more item. If you search for the file net-setup.sh, you find the usual one in /usr/sbin, and another, older copy in /usr/local/net-setup/usr/sbin. And there is some other old stuff down there. It seems this should be cleaned out.
Barry added that in 4.12. It's the old wizard, before I updated it, in case people want to use it instead.
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

#538 Post by Dougal »

OK, finally another update (in parent post).

Changes:
rc.network:
- Add rerwin's "sleep 1" (I used his first, more general solution, in testInterface)
- implement suggestion from OldTxPup: ifconfig down/up after wireless scan
- don't bring down at shutdown interfaces with wake-on-lan enabled (requested by ferikenagy)
- when running the wireless scan, first do a "dry run" (some people reported that, with the wizard, sometimes not all networks appear in the scan dialog, so maybe giving it a "warmup" helps...)
- if wireless scan found nothing, try ejecting/inserting pcmcia card before scanning again (this is already done in the wizard)

Wizard:
- add the code for handling special characters in wireless encryption key
- when updating an existing profile, clean out old static IP info (problem reported by PaulBx1)
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

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

Re: Improved Network Wizard (and rc.network)

#539 Post by gyro »

Dougal wrote:Could a user run more than one instance of dhcpcd at once, connecting via more than one interface?
Theoretically, it might be possible, but extremely unlikely.
If more than one interface is active, then puppy is most likely a router, in which case it is sensible to use dhcp on the Internet side, but static on the local side.
There is also a problem with more than one dhcpcd, i.e. the lottery as to which dhcpcd rewrites /etc/resolv.conf last.
Dougal wrote:Do people ever use static ip addresses with wireless??
Yes, I do sometimes.
When we travel, our Internet connection is via a 3G mobile phone connected with a USB cable. On puppy this ends up being a "ppp0" interface. But we have 2 computers. Since it's convenient if both of us can access the Internet at the same time, I setup puppy as a router. I use the inbuilt wifi as the local network. Since puppy is the only router/gateway on the local network, I configure the wifi interface with a static IP address, and run dnsmasq on it to provide a dhcp service to the laptop, which is usually running windows XP.
(My wireless access point, is quite a small box to pack, and we usually setup camp on a powered site.)

gyro

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

#540 Post by PaulBx1 »

No. If I'm not mistaken, the backing up of resolve.conf was always done in rc.network, since dhcpcd also re-generates it. setupStaticIP must re-generate it since rc.network has no idea where you booted last time! So the existing resolve.conf could have been generated on a different computer and either for a static IP of by dhcpcd.
Hmmm, well, I guess I am missing the big picture about this. Seems like in other distros, this is just a static file, changed manually with an editor. Seems weird the way Puppy does it. Oh well, if you say so...

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.

Post Reply