Learning Mikrotik 4th: Setting IP, NAT and DNS

Pages

Tuesday, July 5, 2011

Learning Mikrotik 4th: Setting IP, NAT and DNS

Learning Mikrotik 4th: Setting IP, NAT and DNS


Learning Mikrotik | Mikrotik Configuration of the PC router for Internet gateways

To providing IP Address, Ip address we give to the local gateway and bridge interface. Giving ip on the bridge interface is not absolute, giving it only untukmemudahkan ip remote access from outside.

/ip address print
/ip address add address=172.168.0.3/40 interface=serverbridge disabled=no
/ip address print
/ip address add address=192.168.0.254/16 interface=eth2-lokal disabled=no
/ip address print

Next we set our default gateway


/ip route add gateway=172.168.0.3
/ip route print
 
  
Then we test ping to the gateway


/ping 222.124.23.41
 
 
Configuring NAT (Network Address Translation)
NAT serves to forward packets from the local ip to public ip (router gateway function)


/ip firewall nat add chain=srcnat action=src-nat to-addresses=172.168.0.3 
to-ports=0-65535 out-interface=serverbridge disabled=no
 
/ip firewall nat add chain=dstnat action=dst-nat to-addresses=172.168.0.6 
to-addresses=172.168.0.6 to-addresses=172.168.0.6 to-ports=2011 dst-port=80 
in-interface=eth2-local disabled=no

Setting DNS


/ip dns set primary-dns=172.168.0.6 allow-remoterequests=yes
/ip dns set secondary-dns=202.134.1.10 allow-remoterequests=yes
/ip dns print


Then do a test ping to a domain name

No comments:

Post a Comment