[ previous ] [ next ] [ threads ]
 
 From:  Andreas Kiessling <andreas at matrix dot boerde dot de>
 To:  m0n0wall dash dev at lists dot m0n0 dot ch
 Subject:  default route on wan interface in other subnet
 Date:  Mon, 14 Feb 2005 09:10:33 +0100
hi folks

i tried to add a default route on the wan iface which is not in the same 
subnet ... it didn't work, so i checked the code and built a fix for 
this ... hope it will be part of further releases!

preface:

to add a default route which is out the subnet of the world iface you 
must add a host route to this gw just before you add the default route.

so i think this should be in etc/inc/interfaces.php

--snip
default:
	mwexec("/sbin/ifconfig " . escapeshellarg($wancfg['if']) . " " .	 
escapeshellarg($wancfg['ipaddr'] . "/" . $wancfg['subnet']));
			
	/* install default route */
	mwexec("/sbin/route delete default");

/* bsd route hack -- for gateway out of the same subnet :: Andreas 
Kiessling (14.02.2005)*/

mwexec("/sbin/route add ".escapeshellarg($wancfg['gateway'])." 
".escapeshellarg($wancfg['ipaddr']) );

/* hack END */

mwexec("/sbin/route add default " . escapeshellarg($wancfg['gateway']));

--snip


am i right ????



best regards andreas
-- 



-- spruch des monats >>>


daran:
"Du warst einmal das schnellste und erfolgreichste Spermium Deiner Gruppe!"