Configurations Proposal Progress Report
Configurations Proposal Progress Report
Configurations Proposal Progress Report
CONFIGURATION
By FONYUY Boris Lami
WIICOM SARL
NETWORK CONFIGURATION
Table of Contents
1 Introduction..............................................................................................................................1
4 First Login...............................................................................................................................3
7 General Configurations............................................................................................................8
7.5 OSPF...............................................................................................................................11
7.6 MPLS..............................................................................................................................13
7.7 DHCP..............................................................................................................................13
i
NETWORK CONFIGURATION
7.8 NAT................................................................................................................................14
8 Yaounde Region....................................................................................................................14
8.1.1 PE-Internet...............................................................................................................14
8.1.2 PE-Ngoa-Ekelle-Tel................................................................................................15
8.1.3 PYaounde.................................................................................................................15
8.1.4 PE-Data-Center-1....................................................................................................15
8.1.5 PE-Mbankolo-Tel....................................................................................................16
8.1.6 PE-Soa-Tel...............................................................................................................16
8.1.7 PE-Petit-marche-Tel................................................................................................17
8.1.8 PE-Data-Center-Siege..............................................................................................17
8.1.9 PE-Siege..................................................................................................................17
8.1.10 PE-Internet-Siege.....................................................................................................18
8.1.11 CE-Monitoring-Telephonie.....................................................................................18
8.1.12 CE-Siege-Telephonie...............................................................................................18
9 Conclusion.............................................................................................................................21
ii
NETWORK CONFIGURATION
List of Figures
Figure 1: Telephony Network........................................................................................................19
Figure 2: Connectique Network.....................................................................................................20
Figure 3: Telephony and Connectique Network............................................................................21
iii
NETWORK CONFIGURATION
1 Introduction
This document presents various proposed configurations for the telephone and “connectique”
network for WIICOM SARL. Prior to effective configurations of each router, we will commence
by resetting the router in order to remove all previous configurations, remove unnecessary
default configurations, upgrade the OS of the router then proceed to proper configurations of the
telephone and “connectique” network.
iv
NETWORK CONFIGURATION
There are a variety of ways by which the configurations of a MikroTik router can be reset, here
we will present 4 of such methods. It should be noted that the first two methods don’t require
access to the router’s configuration interface whereas the last two require that the user should
have access to the router’s configuration interface. Feel free to use a combination of these
3.1 Method 1
o Connect the router to a power supply
o Use the touch pad screen to find and choose the option Reset configuration
o When prompted to ENTER THE PIN CODE, enter 1234 and validate then wait for the
router to reset and reboot
3.2 Method 2
o Plug device to power supply
o Use a little pin to inert in the port labeled RESET which is found between the Ethernet
ports and VGA port in Cloud Core MikroTik routers and maintain the button pressed
until LED starts flashing then release.
o The router configurations will reset and reboot
3.3 Method 3
o This method is used if you have access to the configuration interface of the router and
this is done by using the following command in the router’s terminal window. It should
be noted that this command ensures that the router is absolutely clean with no default
configurations.
When the router prompts for confirmation by saying “Dangerous! Reset anyway? [y/N]:”,
Enter y which means “Yes”
v
NETWORK CONFIGURATION
3.4 Method 4
o This method is similar to Method 3 but involves the use of the the GUI proposed by
MikroTik, go to the menu on the left and click on System.
o In the drop down menu that appears, select Reset Configuration.
o In the box that appears, click on Reset Configuration and when prompted for
confirmation to reset configuration and reboot accept by clicking on Yes
4 First Login
After resetting a MikroTik router, the default user with read and write permissions in the router
has the following credentials
Login: admin
Password:
vi
NETWORK CONFIGURATION
5.1.1 User with full access
Enter the following command in terminal to create a user with full privileges
It should be noted that there group types can be created based on the user define polices agreed
upon by WIICOM using the following command in terminal. The policies are separated by a
commas
vii
NETWORK CONFIGURATION
/tool mac-server set allowed-interface-list=none
Similarly, for the WinBox Mac Access, the following command is used to disabled this service
Change default service ports, this will immediately stop most of the random SSH brute force
login attempts:
Bandwidth server is used to test throughput between two MikroTik routers. Disable it in the
production environment.
Router might have DNS cache enabled, which decreases resolving time for DNS requests from
clients to remote servers. In case DNS cache is not required on your router or another router is
used for such purposes, disable it. In the case of WIICOM, there is a DNS server.
viii
NETWORK CONFIGURATION
Some RouterBOARDs have an LCD module for informational purposes, set pin or disable it.
It is good practice to disable all unused interfaces on your router, in order to decrease
unauthorized access to your router.
Suppose we are connected to the port ether-n for configurations, we can run the following script
to disable interfaces 1 to n−1 and n+1 to the N where N is the total number of interfaces
{
#Ensure that the interface to which you’re connected to do configurations in
#no in the array named interfacesToDisable. In this example, ether10 is
#connected to a PC for configurations.
:local interfacesToDisable { "ether1" ; "ether2" ; "ether3" ; "ether4" ; "ether5" ;
"ether6" ; "ether7" ; "ether8" ; "ether9" ; "ether11" ; "ether12"};
:foreach disableThisInterface in=$interfacesToDisable do={
:local idInterfaceToDisable
:set idInterfaceToDisable [/interface ethernet find name=disableThisInterface]
/interface ethernet set idInterfaceToDisable disabled=yes
}
}
RouterOS utilizes stronger crypto for SSH, most newer programs use it, to turn on SSH strong
crypto
Following services are disabled by default, nevertheless it is better to make sure that none of
them were enabled accidentally. This is to ensure that
ix
NETWORK CONFIGURATION
MikroTik socks proxy,
It is possible that when this document is being exploited, there will be a more recent stable
version, do ensure that you install the most stable RouterOS version. Subsequently, an auto
upgrade could be preview and this upgrade placed in a scheduler to be activated at a given time
of the night when the network is least saturated, this will depend on the agreed policy of
WIICOM. This will be discussed in a later document.
x
NETWORK CONFIGURATION
7 General Configurations
7.1 Naming a router
Setting a name for router permits for easy identification in the network. The following command
is used to set router name
It’s usually important to give meaning names for interfaces to easily identify the interface later
For example, to set 1.1.1.1/32 as a loopback address, we use the following commands in terminal
xi
NETWORK CONFIGURATION
Where ether1_new_name is the new name given to interface ether1. It’s advisable to maintain
the ether1 to avoid mistakes in physical connections and confusions of identifying the renamed
interface. Another approach to minimize confusion is using explicit names and physically
placing this label on the router interface. The following script renames the interfaces from their
previous names which are the keys to the new names which are the values in the array.
{
:local renameInterfaces { "ether1"="ether1_new_name_one" ;
"ether2"="ether2_new_name_two" ; "ether3"="ether3_new_name_three" ;
"ether4"="ether4_new_name_four" ; "ether5"="ether5_new_name_five" }
/interface ethernet
:foreach previousInterfaceName,newInterfaceName in=$renameInterfaces
do={ set $previousInterfaceName name=$newInterfaceName}
}
In other to configure an IPv4 address on an interface, of a MikroTik router, the most important
information is
xii
NETWORK CONFIGURATION
With this information gotten from the document for IPv4 addresses, we will create a nested 2D
array containing all this info. It should be noted that the bolded sections in the following
template should be replaced with real information.
{
:local configureRouterInterfaces {
“name_of_interface_one”={
“address”=”ipv4_address_one”;
“network”=”network_address_one”;
“broadcast”=”broadcast_address_one”;
“comment”=”useful_comment_one”
};
“name_of_interface_two”={
“address”=”ipv4_address_two”;
“network”=”network_address_two”;
“broadcast”=”broadcast_address_two”;
“comment”=”useful_comment_two”;
}
}
/ip address
:foreach interfaceName,interfaceConfig in=$configureRouterInterfaces do={
add interface=$interfaceName address=$interfaceConfig->”address”
network=$interfaceConfig->”network” broadcast=$interfaceConfig->”broadcast”
comment=$interfaceConfig->”comment” disabled=no}
}
7.5 OSPF
In other to configure OSPF routing, we will have the following in mind
xiii
NETWORK CONFIGURATION
o P routers will serve as ABR (Area Border Routers) this is to ensure that LSA (Link State
Advertisement) within an area shouldn’t cross to another area
o DR and BDR will be generated by the OSPF algorithm
o The naming of areas will be done with the help of the name of the region (NB: this region
is not administrative)
o 32bit Router IDs will be set for each router as per the agreed convention.
To add a set of networks to a given area, we can use the following script to create an area and
add networks to this area. It should be noted that these networks should comprise networks to
which the router being configure is connected to other routers of the same area on which OSPF
has be activated or will be activated. This script also fixes a router id for OSPF, in the absence of
a router id, one of the addresses on the router will be used as a router id
{
:local networksInOSPFArea { “1.1.1.1/32”, “192.168.10.0/30”,
“192.168.10.4/30”, “192.168.10.8/30”, “192.168.10.12/30”,
“192.168.10.16/30” }
:local nameOfArea yaounde_region
:local areaId “0.0.0.1”
:local nameOfInstance “name_of_instance”
:local routerId “1.1.1.1”
/routing ospf area add area name=$nameOfArea area-id=$areaId
#We will use the default instance but rename it and set router-id to loopback
#Other default parameters but for one will be modified for now
/routing ospf instance set 0 name=$nameOfInstance router-id=$routerId
/routing ospf network
xiv
NETWORK CONFIGURATION
:foreach networkForOSPF in=$networksInOSPFArea do={
add area=$nameOfArea network=$networkForOSPF}
}
The following command is used to verify the elected DR and BDR with the various advances
established by OSPF after the exchange of LSA via Hello Packets.
The following command is used to check whether LSA tables were generated properly.
By default, the authentication for exchange of LSA is not activated. This is dangerous as a packet
sniffer attack is easy and can lead to OSPF misconfiguration. To avoid such, MD5 authentication
should be configured on all OSPF interfaces. The following command can be used
The default options can be modified when need arises and other interfaces added with MD5
authentication.
In order to ensure that networks that are connected to an OSPF router but not necessarily part of
the initially added networks to the area but will have the router advertise the reachability to their
network. This is achieved via the following command. Supposing that only the router instance
with number 0 is running, we will use
xv
NETWORK CONFIGURATION
7.6 MPLS
Basic MPLS configuration is achieved on desired interfaces by running the following script with
mplsInterfaces containing an array of the various interfaces on which MPLS will be activated.
LDP (Label Distribution Protocol) is also enabled to ensure exchange of labels between LSRs
and LERs.
{
:local lsrAndTranportAddress “1.1.1.1”
:local mplsInterfaces {“ether1”, “ether2”, “ether3”}
#enabling LDP
/mpls ldp set enabled=yes lsr-id=$lsrAndTranportAddress transport-
address=$lsrAndTranportAddress
7.7 DHCP
The following command is used to define DHCP pool,
The following command is used to set the DHCP server on a given interface, with lease time 1h
Let’s specify the gateway, dns server and network address for the DHCP Server Network
xvi
NETWORK CONFIGURATION
/ip dhcp-server network
add address=30.4.0.0/20 dns-server=8.8.8.8,8.8.4.4 gateway=30.4.0.1
comment="CE1"
MikroTik has a way to quickly setup DHCP on an interface by entering the command and then
enter the required information judiciously.
7.8 NAT
All routers that are connected to the internet should have NAT activated using the following
command with ether3 being the interface facing the internet
8 Yaounde Region
8.1 Telephony Network
Presented below is a diagrammatic representation of the telephone network. After previously
elaborating a number of technologies that should be activated for use to have a functional MPLS
network, we will consider each router and outline the various technologies that should be
activated. The practicality will be demonstrated in simulation and a template made for P, PE and
CE routers generally then particular aspects for Data Center routers and Internet Routers.
Protective credentials can be saved for later with the main objective now being, having a
functional MPLS network. A dynamic security script to secure all routers based on all the
aforementioned security measures.
8.1.1 PE-Internet
o Set name of router
xvii
NETWORK CONFIGURATION
o Add ether1 to MPLS
8.1.2 PE-Ngoa-Ekelle-Tel
o Set name of router
o Place ether1, ether2, ether3, ether4 and ether5 in OSPF area named yaounde_region
8.1.3 PYaounde
o Set name of router
o In the future, it will be necessary to configure eBGP towards others P routers in other
regions.
8.1.4 PE-Data-Center-1
o Set name of router
xviii
NETWORK CONFIGURATION
o Create area name yaounde_region
8.1.5 PE-Mbankolo-Tel
o Set name of router
8.1.6 PE-Soa-Tel
o Set name of router
8.1.7 PE-Petit-marche-Tel
o Set name of router
xix
NETWORK CONFIGURATION
o Address each router interface
o Place ether1, ether2, ether3 and ether4 in OSPF area named yaounde_region
8.1.8 PE-Data-Center-Siege
o Set name of router
8.1.9 PE-Siege
o Set name of router
xx
NETWORK CONFIGURATION
8.1.10 PE-Internet-Siege
o Set name of router
8.1.11 CE-Monitoring-Telephonie
o Set name of router
8.1.12 CE-Siege-Telephonie
o Set name of router
xxi
NETWORK CONFIGURATION
xxii
NETWORK CONFIGURATION
xxiii
NETWORK CONFIGURATION
9 Conclusion
This document presents the various manipulations that are to be done on a MikroTik router prior
to proper configuration. We go ahead to elaborate the putting in place of an MPLS network and
some minimum security required for routers and activation of some technologies like DHCP and
NAT. The main objective of this document is to present a methodology that will be used in
elaborate reusable templates for various key routers in the network that’s P, PE and CE
amongst other key actions in the network that will require the use of scripts.
xxiv