Computing.Net > Forums > Linux > Network config problems

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Network config problems

Reply to Message Icon

Name: Chris Woelkers
Date: October 22, 2003 at 13:38:36 Pacific
OS: Mandrake 9.1
CPU/Ram: P3 866Mhz/320MB
Comment:

After going through many hurdles to get my wireless card working I can finally access my LAN and the Internet when logged in as root after using a startup script to set the network settings. However, when I login to my normal user account after a restart I can't access anything. I can su to root, run the script, then su back to access the net, but this won't work when I switch to using Linux as my main system and have multiple users. I have tried to run the script as a standard user, but it won't work. Here's the script contents:
ifconfig eth0 192.168.0.101 mtu 576
iwconfig eth0 mode managed channel 6 rate 22M essid WAP1
iwconfig eth0 key 5a22-7b9c-62 essid WAP1

iwconfig eth0 mode managed channel 6 rate 22M essid WAP1
iwconfig eth0 key 5a22-7b9c-62 essid WAP1

route add default gw 192.168.0.1


The script will work fine when I run it as root, but when I try it as a user this is what it outputs:
bash: ifconfig: command not found
Error for wireless request "Set Mode" (8B06) :
SET failed on device eth0 ; Operation not permitted.
Error for wireless request "Set Encode" (8B2A) :
SET failed on device eth0 ; Operation not permitted.
Error for wireless request "Set Mode" (8B06) :
SET failed on device eth0 ; Operation not permitted.
Error for wireless request "Set Encode" (8B2A) :
SET failed on device eth0 ; Operation not permitted.
bash: route: command not found

Is there a way to let a user run this script without the errors? Or better yet automatically at startup or user login?



Sponsored Link
Ads by Google

Response Number 1
Name: shadox
Date: October 22, 2003 at 18:49:04 Pacific
Reply:

Have you tried to add the settings to
'/etc/sysconfig/network-scripts/' and/or modifying '/etc/rc.d/init.d/network' script? This should solve your problem.


0

Response Number 2
Name: Chris Woelkers
Date: October 22, 2003 at 20:03:17 Pacific
Reply:

All of the settings are in the ifcfg-eth0 file, here's what I got:
NAME=WiFi
WIRELESS=yes
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.101
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
MTU=576
ONBOOT=yes
MODE=Managed

CHANNEL=6
RATE=22M
KEY=5a22-7b9c-62
ESSID=WAP1
USERCTL=yes

As can be seen, all the settings are there, and are correct. They just don't all seem to stick between boot and login. And the device is being started at boot time.
The other thing is that my routing table doesn't save between reboot, which is why the route command is in my script.
Also, the driver/card, seems to pick up a different WAP than mine when it starts up, as is evident when looking at the iwconfig output before I use my script. Any ideas?


0

Response Number 3
Name: Chris Woelkers
Date: October 23, 2003 at 19:23:55 Pacific
Reply:

I have a possible solution to my problem, but it relies on the .rc or .login file as so named in unix. I can't find either of these files in Mandrake 9.1. What would be the names of these files in Mandrake?


0

Response Number 4
Name: 3Dave
Date: October 24, 2003 at 07:22:10 Pacific
Reply:

You should have an rc.local file (which is
a bit like autoexec.bat under windoze).
Look in /etc/init.d and /etc/rc.d

You could also write your own rc script and
add it to runlevel 3 and 5 (both
networking)

You could also suid the scripts so that if
a regular user executes it, it runs as
root:
# chmod +s /path/to/script.sh
although this method is not usually
recommended for security reasons, better
would be to use sudo instead.
# man sudo
for more info


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Network config problems

RedHat 8.0 network card problem www.computing.net/answers/linux/redhat-80-network-card-problem/14882.html

Network config www.computing.net/answers/linux/network-config/9388.html

network config problem www.computing.net/answers/linux/network-config-problem/21164.html