You are not logged in.
Pages: 1
Hi
Well, I guess this is a newbie question. I need to run these lines after entering runlevel 5, to be more exact, after all the daemons are run. How am supposed to do it? And if possible, I don't want to be asked for any password.
su
route del default
route add default gw 81.91.128.10
export http_proxy="http://127.0.0.1:8118"
Offline
I guess you can put the export line in /etc/profile.
About the route, why can't you just define it in /etc/rc.conf (there is an entry for defining your default route there) ?
Offline
/etc/rc.local?
"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."
SETH / Jane Roberts
Offline
Thanks for the replies. About the routing issue, I just did that but sounds like it doesn't work. The problem I got an ADSL connection which uses pppoe for authentication. Now since the ADSL daemon is run after the part which sets the route, it just doesn't work. Here's the part from my rc.conf:
#
# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
HOSTNAME="localhost"
#
# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available
# interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
# - prefix an entry in INTERFACES with a ! to disable it
# - no hyphens in your interface names - Bash doesn't like it
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
lo="lo 127.0.0.1"
eth0="dhcp"
INTERFACES=(lo eth0)
#
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
# - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 81.91.128.10"
ROUTES=(81.91.128.10)
Offline
the correct syntax of the gateway/ROUTES part above should be
gateway="default gw 81.91.128.10"
ROUTES=(gateway)
If that does not work you can customize the adsl daemon of write a new daemon in /etc/rc.d (it's not hard if you take another daemon in /etc/rc.d as a template)
Offline
So I have to make a daemon to do it for me. I really have no idea how I should do it. I took a look at the adsl and sounds like it's a bash script. I have just heard about them, so can you give me a hint how to write one?
In case you need the information. My ifconfig output is:
eth0 Link encap:Ethernet HWaddr 00:05:5D:C8:A5:AA
inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::205:5dff:fec8:a5aa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5638 errors:0 dropped:0 overruns:0 frame:0
TX packets:6099 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2530692 (2.4 Mb) TX bytes:688072 (671.9 Kb)
Interrupt:5 Base address:0xd000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:94 errors:0 dropped:0 overruns:0 frame:0
TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15861 (15.4 Kb) TX bytes:15861 (15.4 Kb)
ppp0 Link encap:Point-to-Point Protocol
inet addr:91.184.74.73 P-t-P:81.91.128.10 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:5547 errors:0 dropped:0 overruns:0 frame:0
TX packets:5719 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:2402574 (2.2 Mb) TX bytes:536629 (524.0 Kb)
Any help is appreciated indeed.
Offline
no problems
I threw something together (I'm a bit in a hurry atm).
save the file as route in your home directory and place it with
chown -R root:root ./route
install -D -m755 ./route /etc/rc.d/route
in the correct place with correct permissions (note you have to be root to do this)
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Setting default route"
/sbin/route add default gw 81.91.128.10
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon route
stat_done
fi
;;
stop)
stat_busy "Removing default route"
/sbin/route del default
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon adsl
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
now make sure the particular line in /etc/rc.conf reads
ROUTES=(!gateway)
Hope I've everything correct
[edit]
various fixes
Last edited by pressh (2007-11-07 17:28:40)
Offline
Pages: 1