How to use static IP addresses for my LAN? (SOLVED)

Problems and successes with specific brands/models of networking hardware.
Post Reply
Message
Author
User avatar
iansl2000
Posts: 34
Joined: Thu 23 Mar 2006, 00:18
Location: UK

How to use static IP addresses for my LAN? (SOLVED)

#1 Post by iansl2000 »

I've so impressed with puppy on my main PC that I'd like to use it on a another PC in the house.

At the moment I connect on the main PC (Wireless card chip Ralink RT2500) at start up with the following script (provided at least in part from forum members) in /etc/rc.d/rc.local

Code: Select all

echo "Trying to get IP address from DHCP server (60sec timeout)..."
rm /etc/dhcpc/dhcpcd-ra0.pid 2>/dev/null #if left over from last session, causes trouble.
rm /etc/dhcpc/dhcpcd-ra0.cache 2>/dev/null #ditto
rm /etc/dhcpc/dhcpcd-ra0.info 2>/dev/null #ditto
ifconfig ra0 down
ifconfig ra0 up
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwconfig ra0 essid "zoelucy"
iwpriv ra0 set WPAPSK="passwordplaintext"
iwconfig ra0 essid "zoelucy"
dhcpcd ra0
I've tried the same script on the second PC (Wireless card chip Ralink RT61)but with no luck. If I try Rutilt it sees the network but cannot get an ip address. So I thought I'd try a static ip address. Can anyone tell me what amendments I need to make to the above script to use a static ip address?
Up to now I've have been using PClinuxos on this second machine using a similar script and only get an ip address sometimes.

Many thanks in advance for any help.
Ian
Last edited by iansl2000 on Sun 22 Apr 2007, 09:37, edited 1 time in total.

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

Re: Use Static IP address

#2 Post by John Doe »

While you're waiting for the static IP info (I don't know how myself). You might try the network wizard, after the card is up. I've found setting static IPs is real easy that way.

You might be having the trouble you mentioned because of how you are calling dhcpcd (just a guess, let us know).

Replace this in your script and try this on each machine (maybe reset the router first):

#1:
dhcpcd -h hostName1 ra0

#2
dhcpcd -h hostName2 ra0

User avatar
iansl2000
Posts: 34
Joined: Thu 23 Mar 2006, 00:18
Location: UK

Use Static IP address

#3 Post by iansl2000 »

John Doe,
Thanks for the quick reply and suggesting the network wizard.

On my main machine, which has no trouble connecting, I went directly to the static ip button in the wizard and looked at the file that it created-then copied the output over the

Code: Select all

ifconfig ra0 up
line so that it read

Code: Select all

ifconfig ra0 192.168.1.76 netmask 255.255.255.0 broadcast 192.168.1.255 up
route add -net default gw 192.168.1.1
I commented out the

Code: Select all

dhcpcd ra0
line and viola I have a static ip address.

So the full script is now

Code: Select all

echo "Trying to get IP address from DHCP server (60sec timeout)..."
rm /etc/dhcpc/dhcpcd-ra0.pid 2>/dev/null #if left over from last session, causes trouble.
rm /etc/dhcpc/dhcpcd-ra0.cache 2>/dev/null #ditto
rm /etc/dhcpc/dhcpcd-ra0.info 2>/dev/null #ditto
ifconfig ra0 down
ifconfig ra0 192.168.1.76 netmask 255.255.255.0 broadcast 192.168.1.255 up
route add -net default gw 192.168.1.1
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwconfig ra0 essid "zoelucy"
iwpriv ra0 set WPAPSK="passwordplaintext"
iwconfig ra0 essid "zoelucy"
#dhcpcd -h puppypc ra0
By the way the

Code: Select all

dhcpcd -h puppypc ra0
that you suggested worked ok too.

I'll let you know how I get on with the secondary (suspect) machine tomorrow - its late now.
Thanks again
Ian

Post Reply