Setup Mikrotik as Gateway server

MikroTik RouterOS ™ is the base Linux operating system intended as a
network routers. Designed to provide convenience to users. Administration could
done through the Windows application (Winbox). In addition the installation can be done on
Standard computer PC. PC that will be mikrotik router did not need a resource
large enough to use standard, for example, only the gateway.
For the purposes of a large load (complex networks, complex routing, etc.) are advised to consider the selection of adequate resource PCs.
Facilities on the proxy are as follows :
- Protokoll routing RIP, OSPF, BGP.
- Statefull firewall
- HotSpot for Plug-and-Play access
- remote winbox GUI admin
More can be found at www.mikrotik.com
However mikrotik is not free software, means we have to buy licensi against
any facility provided. Free trial only for 24 hours. We can buy mikrotik software on CD is installed on hard disks or disk on module (DOM). If we buy the DOM does not need to install the DOM but stay stuck on our PC IDE slot.
The following steps are basic setup is configured proxy for the network
simple as a gateway server.
1. The first step is to install RouterOS on your PC or pairs of DOM.

2. Log In Mikrotik Routers through the console
MikroTik v2.9.7
Login: admin
Password:
Until this step we are able to enter the engine Mikrotik. The default user is admin
and without a password, just type admin and press the enter key.

3. To change the security default password
[admin@Mikrotik] > password
old password: *****
new password: *****
retype new password: *****
[admin@ Mikrotik]] >

4. Changing the name Mikrotik Router, in this step the server name will be changed to "Waton"
[admin@Mikrotik] > system identity set name=Waton
[admin@Waton] >

5. Viewing interface on Router Mikrotik
[admin@Mikrotik] > interface print
Flags: X - disabled, D - dynamic, R - running
# NAME TYPE RX-RATE TX-RATE MTU
0 R ether1 ether 0 0 1500
1 R ether2 ether 0 0 1500
[admin@Mikrotik] >

6. Gives the IP address on the interface Mikrotik. Suppose ether1 we will use to
connection to the Internet with IP 192.168.0.1 and ether2 will be utilized for local network us with the IP 172.16.0.1
[admin@Waton] > ip address add address=192.168.0.1
netmask=255.255.255.0 interfac
e=ether1
[admin@Waton] > ip address add address=172.16.0.1
netmask=255.255.255.0 interfac
e=ether2

7. Seeing the IP address configuration we have given
[admin@Waton] >ip address print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK BROADCAST INTERFACE
0 192.168.0.1/24 192.168.0.0 192.168.0.63 ether1
1 172.16.0.1/24 172.16.0.0 172.16.0.255 ether2
[admin@Waton] >

8. Providing default gateway, the gateway is assumed to connect to the Internet is
192.168.0.254
[admin@Waton] > /ip route add gateway=192.168.0.254

9. Viewing the routing table on the Mikrotik Routers
[admin@Waton] > ip route print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf
# DST-ADDRESS PREFSRC G GATEWAY DISTANCE INTERFACE
0 ADC 172.16.0.0/24 172.16.0.1 ether2
1 ADC 192.168.0.0/26 192.168.0.1 ether1
2 A S 0.0.0.0/0 r 192.168.0.254 ether1
[admin@Waton] >

10. Ping the Gateway tests to ensure the configuration is correct
[admin@Waton] > ping 192.168.0.254
192.168.0.254 64 byte ping: ttl=64 time<1 ttl="64" max =" 0/0.0/0">

11. Setup DNS Mikrotik Routers
[admin@Waton] > ip dns set primary-dns=192.168.0.10 allow-remoterequests=
no
[admin@Waton] > ip dns set secondary-dns=192.168.0.11 allow-remoterequests=
no

12. Viewing the configuration control
[admin@Waton] > ip dns print
primary-dns: 192.168.0.10
secondary-dns: 192.168.0.11
allow-remote-requests: no
cache-size: 2048KiB
cache-max-ttl: 1w
cache-used: 16KiB
[admin@Waton] >

13. Tests for domain access, for example by pinging a domain name
[admin@Waton] > ping yahoo.com
216.109.112.135 64 byte ping: ttl=48 time=250 ms
10 packets transmitted, 10 packets received, 0% packet loss
round-trip min/avg/max = 571/571.0/571 ms
[admin@Waton] >
If you've managed to reply that DNS settings are correct.

14. Setup masquerade, if Mikrotik will we use it as a gateway server in order
client computer on the network can connect to the internet we need to masquerading.
[admin@Waton] > ip firewall nat add action=masquerade outinterface=
ether1
chain: srcnat
[admin@Waton] >

15. Viewing masquerade configuration
[admin@Waton] ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=srcnat out-interface=ether1 action=masquerade
[admin@Waton] >

After this step can be carried out checks for connections from local network. And if it means we have successfully managed to install Mikrotik Router as a Gateway server. Once connected to the network can Mikrotik Winbox dimanage use which can be downloaded from Mikrotik.com or from our proxy server. Ip address server instance
our proxy 192.168.0.1, via the browser and open http://192.168.0.1 and download from there Winbox.

If we want the client to get IP address automatically then we need to setup
dhcp server on the Mikrotik. Here are the steps :

1. Create an IP address pool
/ip pool add name=dhcp-pool ranges=172.16.0.10-172.16.0.20

2. Add a DHCP Network and gatewaynya that will be distributed to the client
In this example networknya is 172.16.0.0/24 and gatewaynya 172.16.0.1
/ip dhcp-server network add address=172.16.0.0/24 gateway=172.16.0.1

3. Add a DHCP server (in this case applied to the interface dhcp ether2)
/ip dhcp-server add interface=ether2 address-pool=dhcp-pool

4. See the status of the DHCP server
[admin@Waton] > ip dhcp-server print
Flags: X - disabled, I - invalid
# NAME INTERFACE RELAY ADDRESS-POOL LEASE-TIME ADD-ARP
0 X dhcp1 ether2

X states that the DHCP server is not enabled it is necessary first dienablekan
used in step 5.

5. Do not Forget first created a dhcp server enable
/ip dhcp-server enable 0

then check back to dhcp-server such as step 4, if an X has no meaning
already active.

6. Tests of client

0 comments:

Post a Comment