Project

General

Profile

« Previous | Next » 

Revision fe038cb6

Added by Bill Marquette about 20 years ago

Grab default route as a gateway, interface might be dynamic

View differences:

usr/local/www/firewall_rules_edit.php
774 774
		<?php
775 775
			/* build a list of gateways */
776 776
			$gateways = array();
777
			exec("/sbin/route -n get default |/usr/bin/grep gateway", $defroute);
778
			preg_match("/(\d+\.\d+\.\d+\.\d+)/", $defroute[0], $matches);
779
                        $gateways[] = $matches[1];
777 780
			foreach($config['interfaces'] as $int) {
778 781
				if($int['gateway'] <> "")
779 782
					$gateways[]=$int['gateway'];

Also available in: Unified diff