home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 June
/
ccd0605.iso
/
Software
/
Shareware
/
Comunicatii
/
nat32
/
direcpc
< prev
next >
Wrap
Text File
|
2004-05-14
|
533b
|
29 lines
#!tcl
#
# DirecPC: extract gateway from TDI info and adjust the NAT32 routing table
#
if {$argc != 0} {
error "Usage: direcpc"
}
# fetch TDI routes
set routes [exec "tdi -r"]
# convert to list format
set rlist [split $routes \n]
# get default route
set i [lsearch $rlist *0.0.0.0*]
if {$i == -1} {
error "direcpc: no Windows default route exists"
}
set gwstr [lindex $rlist $i]
scan $gwstr "%s %s %s" ip mask gw
exec "route add $ip $mask $gw 15 0"
echo direcpc: default route set to $gw