View previous topic :: View next topic |
Author |
Message |
alex3ff n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 16 Apr 2006 Posts: 2
|
Posted: Sun Apr 16, 2006 10:20 am Post subject: newb: trying to run simple commands at boot time [solved] |
|
|
Ok. I'm pretty new to the whole linux thing, and I certianly don't know anything about the detailed inner workings of the system, so if this is an obvious question I am sorry
But, here's my situation:
I am trying to get my wireless card to work. I have installed madwifi, and I can ge tthe card to work, but hte problem is I must issue the following commands once I log in to get the card to start transmitting data.
Code: |
ifconfig ath0 192.168.0.9
route add default gw 192.168.0.1
|
Much like you would configure hte defaults for any networking device. My question is, is there a way I can run these commands automatically or set some sort of proper variables in /etc/conf.d/net or /etc/conf.d/wireless
Currently those two files look like this:
/etc/conf.d/net
Code: |
#config_eth0=( "192.168.0.3 netmask 255.255.255.0 brd 192.168.0.255" )
#routes_eth0=( "default gw 192.168.0.1" )
config_eth0=( "down" )
config_ath0=( "up" )
config_ath0=( "192.168.0.9 netmask 255.255.255.0 brd 192.168.0.255" )
routes_ath0=( "default gw 192.168.0.1" )
|
/etc/conf.d/wireless
Code: |
essid_ath0="NETGEAR"
config_ath0=( "ap 00:0f:b5:28:1f:14" )
config_ath0=( "192.168.0.9 netmask 255.255.255.0 brd 192.168.0.255" )
route_ath0=( "default gw 192.168.0.1" )
|
Now keep in mind again I don't know what I'm doing and was just trying a bunch of stuff
So basically I need to
a) bring down eth0 or not have it run/initialized/whateveryoucall at boot up because I won't be using it
b) run those two commands in some way to have my wireless card setup automatically
Any help or suggestions would be appreciated.
Thanks,
Alex
Last edited by alex3ff on Sun Apr 16, 2006 7:27 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
asiB4 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 16 Jan 2006 Posts: 370 Location: Inside the electric circus
|
Posted: Sun Apr 16, 2006 11:44 am Post subject: |
|
|
you're basically wanting to use your ath0 instead of eth0...maybe a networking guru will know the best way to do this...but I would think you would do the following...
Code: | #/etc/init.d/net.eth0 stop
#rc-update del net.eth0 default -------------->removes eth0 from the default runlevel
#rm /etc/init.d/net.eth0 ----------> removes eth0 symlink to net.lo
#ln -s /etc/init.d/net.lo /etc/init.d/net.ath0 ---------------->creates ath0 symlink to net.lo
#rc-update add net.ath0 default -------------->starts ath0 at the default runlevel
#/etc/init.d/net.ath0 start |
...I would just comment out anything for eth0 in /etc/conf.d/net so the info is still available in case things go haywire for your ath0, then you can just create another net.eth0 symlink to net.lo, on the otherhand if you want to keep eth0 don't remove the symlink in /etc/init.d/ and just #rc-update del net.eth0 default, not sure if this will create a conflict, having net.lo symlinked by multiple devices, though. _________________ Registered Linux User #332738
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
alex3ff n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 16 Apr 2006 Posts: 2
|
Posted: Sun Apr 16, 2006 7:27 pm Post subject: |
|
|
ahh good call, that worked perfectly!
thanks;) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
asiB4 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 16 Jan 2006 Posts: 370 Location: Inside the electric circus
|
Posted: Sun Apr 16, 2006 7:31 pm Post subject: |
|
|
that's cool, glad it worked out for you ![Cool 8)](images/smiles/icon_cool.gif) _________________ Registered Linux User #332738
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|