How to setup IP address in Centos

How to setup IP address in  CentOS-6



## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.1.44
NETMASK=255.255.255.0


## Configure Default Gateway
#
# vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.1.1


## Restart Network Interface
#

/etc/init.d/network restart

## Configure DNS Server
#
# vi /etc/resolv.conf

nameserver 8.8.8.8      # Replace with your nameserver ip
nameserver 192.168.1.1  # Replace with your nameserver ip

How to create Day/Night package in Mikrotik queue

How to create Day/Night package in Mikrotik queue:

What to do ?
1. Create queue for Day (5MB) and Night (10MB)
2. Create script for Day (enable Day & disable Night queue) and Night (enable Night & disable Day queue)
3. Create schedule for Day (8.00 AM=08.00 o'clock) and Night (8.00 PM=20.00 o'clock)


1. Create queue for Day (5MB) and Night (10MB)

1.1 create queue for Day :
                              Queue Name : queue_Day
                              IP address for Queue: 192.168.1.100 (it's may varies according to you )
                              Bandwidth : upload =5MB & download=5MB

1.2 Create queue for Night :
                               Queue Name : queue_Night
                               IP address for Queue: 192.168.1.100 (it's may varies according to you )
                               Bandwidth : upload =10MB & download=10MB

2. Create script for Day and Night

2.1 Create Script for Day :
            Name : script_Day
            Source :  /queue simple enable queue_Day
                          /queue simple disable queue_Night



2.2. Create Script  for Night:
               Name : script_Day
               Source :  /queue simple enable queue_Night
                             /queue simple disable queue_Day



3. Create schedule for Day and Night
3.1. Create Schedule for Day:
                                Name: schedule_Day
                                Start Time:08:00:00
                                Interval :1d 00:00:00  or 24:00:00       ; after 1 Day
                                On event :script_Day                    ;name of the script that should be run 



3.2. Create Schedule for Night
                                Name: schedule_Night
                                Start Time:20:00:00
                                Interval :1d 00:00:00  or 24:00:00       ; after 1 Day
                                On event :script_Night                   ;name of the script that should be run 







Install and Configure Nagios On CentOS 6.7

Nagios is an open source software that can be used for network and infrastructure monitoring. Nagios will monitor servers, switches, applications and services. It alerts the System Administrator when something went wrong and also alerts back when the issues has been rectified.


With Nagios you can:
– Monitor your entire IT infrastructure.
– Identify problems before they occur.
– Know immediately when problems arise.
– Share availability data with stakeholders.hypothetical question
– Detect security breaches.
– Plan and budget for IT upgrades.
– Reduce downtime and business losses.
Prerequisites

# yum install gd gd-devel gcc glibc glibc-common

Facebook block in Mikrotik By layer 7 protocols


Facebook block in Mikrotik router by layer 7 protocols




1. IP>Firewall>Layer7 Protocols>add(+)
 
       1.1 Layer7 Protocols
                              Name       :   Facebookblock_L7P    
                              Regexp     :   ^.+(facebook).*$                 ; ^.+(facebook |youtube ).*$

        1.2  Apply>OK




2.IP>Firewall>Filter Rules>add(+)
     
       2.1 Filter Rules>General>
     
                                 Chain                     :forward
                                 Src. Address           :192.168.1.0/24      ; LAN IP block


       
       2.2 Filter Rules>advanced>
       
                                  Layer7 Protocol    :Facebookblock_L7P


       2.3 Filter Rules>action>

                                  action     : drop

       2.4 Apply>OK



VPN : virtual private network





VPN : virtual private network : The logical connectivity between two same or different private networks from remote place


Classification:
            1.Server to Client  tunnel
            2.Server to Server tunnel


                                                1.     Server to Client  tunnel:

                                                                   -------------o------------

                                                                2. Server to Server tunnel

              2.1    Layer 2 tunnel (Same local network)
                2.2    Layer 3 tunnel  (Different networks)



2.1    Layer 2 tunnel (Same local network)

-------------o------------

  2.2   Layer 3 tunnel  (Different networks)
-------------o------------

Mikrotik Site-to-Site GRE Tunnel Configuration

Mikrotik Site-to-Site GRE Tunnel Configuration




Mikrotik Router Site-to-Site GRE Tunnel Configuration :GRE (Generic Routing Encapsulation) is tunneling protocol.GRP is cisco propitiatory protocol,it is simile to IPIP and EOIP which originally built up as stateless tunnels.GRE create a virtual point-to-point protocol link.
GRE Configuration Video

Site1:
/interface gre add name=Gre_site1 remote-address=172.16.100.2 local-address=172.16.1.2


/ip address
  add address=192.168.100.1/30 interface=Gre_site1

/ip route
  add dst-address=10.10.10.0/24 gateway=192.168.100.2


Site2:


/interface gre add name=Gre_site2 remote-address=172.16.1.2 local-address=172.16.100.2

/ip address
  add address=192.168.100.2/30 interface=Gre_site2

/ip route
  add dst-address=192.168.100.0/24 gateway=192.168.100.2

Mikrotik Script for adding 253 queues by 10 seconds:




Mikrotik Script for adding 253  queues by 10 seconds:

:for x from=2 to=254 do={/queue simple add name="User-$x" d interface=all max-limit=3M/3M target-addresses="192.168.1.$x"}

where
      Upload speed=3M
      Download speed=3M
      Client IP-address=192.168.1.0/24
 

exporting queues list
##  queuee simple
#export file=name




How to configure username and password




       DHAKA(config)#username my_username  privilege 15 secret my_password

To reset a Cisco router to factory default

To reset a Cisco router to factory default (removing the startup configuration file), perform these steps:
1.To erase the configuration file, issue the erase nvram:command. Reload the router by issuing the reload command.
2.If this does not solve the problem, attempt to break into ROM Monitor (ROMmon) by issuing the break sequence (usually Ctrland break from the Hyperterminal) from a console connection.
Refer to: Cisco Standard Break Key Combinations. You should see this ROMmon prompt:




rommon 1>
3.Change the configure register value to ignore the startup configuration by issuing theconfreg command, as shown in this example:
rommon 2> confreg 0x2142
4.To reload the router, issue the reset command, as shown in this example:
rommon 3> reset
5.After the router boots, issue the enable command at the Router > prompt. The prompt changes to Router#, indicating that the router is now in privileged mode.
6.To enter config mode, issue the config terminal command. You should now see aRouter(config)# prompt.




7.To change the configure register to recognize the startup configuration, issue theconfig-register command, as shown in this example:
Router (config)# config-register 0x2102
To break out of configuration mode, press Cntl and Z. To save the blank configuration, issue the copy-running config-startup config command.