Changeset 123


Ignore:
Timestamp:
Dec 11, 2008, 8:26:59 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Přesměrování DNS serveru na centrálu v genrátoru NATu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • system/generators/nat_routerboard.php

    r119 r123  
    11<?php
    2 chdir('/var/www/html/dev/centrala/www');
     2chdir('/a/www/centrala');
    33include_once('global.php');
    44
    55$InetInterface = 'ether3';
    6 $Router = '192.168.10.33';
     6$Router = '192.168.0.11';
    77
    88$Commands = array();
     
    2525$Commands[] = ' /ip firewall nat add chain=srcnat out-interface='.$InetInterface.' action=masquerade comment="Default NAT"';     
    2626// Redirect DNS port
    27 $Commands[] = ' /ip firewall nat add chain=dstnat dst-address=212.111.4.174 protocol=tcp dst-port=53 in-interface='.$InetInterface.' action=dst-nat to-address=192.168.0.1 comment="DNS redirection"';     
     27$Commands[] = ' /ip firewall nat add chain=dstnat dst-address=212.111.4.174 protocol=tcp dst-port=53 in-interface='.$InetInterface.' action=dst-nat to-address=192.168.0.1 to-ports=53 comment="DNS redirection UDP"';
     28$Commands[] = ' /ip firewall nat add chain=dstnat dst-address=212.111.4.174 protocol=udp dst-port=53 in-interface='.$InetInterface.' action=dst-nat to-address=192.168.0.1 to-ports=53 comment="DNS redirection UDP"';
    2829
    2930$Commands = addslashes(implode(';', $Commands));
    3031$Command = '/usr/bin/ssh -l admin-ssh -i /root/.ssh/id_dsa '.$Router.' "'.$Commands.'"';
    31 echo($Command."\n");
     32//echo($Command."\n");
    3233exec($Command, $Output);
    33 array_pop($Output);
    34 
     34//array_pop($Output);
     35//print_r($Output);
    3536
    3637/*
Note: See TracChangeset for help on using the changeset viewer.