[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Help nedded with network script (bash pptp)



Hello..
few month ago i found this nice script :


##############################
#pns.barak.net.il is my isp
#!/bin/bash
 dhclient eth0
 USERNAME=MyISPuserName
 IF=eth0
 /sbin/ifdown $IF
 /sbin/ifup $IF
 CABLEGW=`/sbin/route -n | grep ^0.0.0.0 |awk '{print $2}'`
#    /sbin/route del default
 /sbin/route add -host pns.barak.net.il gw $CABLEGW
 /sbin/route del default
 /usr/sbin/pptp pns.barak.net.il debug user $USERNAME mtu 1460 mru
1460 defaultroute usepeerdns noauth

############################


it works real nice when there are connections with extra interfaces or
there is on going connection:

##########################################
debian:/home/mha13# cs
Internet Software Consortium DHCP Client 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

ppp1: unknown hardware address type 512
ppp0: unknown hardware address type 512
sit0: unknown hardware address type 776
ppp1: unknown hardware address type 512
ppp0: unknown hardware address type 512
sit0: unknown hardware address type 776
Listening on LPF/eth0/00:16:d4:16:95:8c
Sending on   LPF/eth0/00:16:d4:16:95:8c
Sending on   Socket/fallback/fallback-net
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 10.209.192.1
bound to 172.28.62.217 -- renewal in 267455 seconds.
/sbin/ifdown: interface eth0 not configured
Ignoring unknown interface eth0=eth0.
Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric
M] [[dev] If]
     inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M]
                            [netmask N] [mss Mss] [window W] [irtt I]
                            [mod] [dyn] [reinstate] [[dev] If]
     inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject
     inet_route [-FC] flush      NOT supported
###################################

but if i use /sbin/route del default  it will connect.

Yours truly



Reply to: