Find and Replace word in config

In Cisco or Juniper, I can find and replace a word in config.
How to achieve the same with other brand?

CISCO
https://xrdocs.io/cloud-scale-networking/tutorials/xr-global-config-replace

FORTINET

HP

JUNIPER
# edit interfaces ge-0/0/3 unit 0 family ethernet-switching vlan
# replace pattern SALES with SUPPORT

RUCKUS

Automatically backup config to scp or tftp when “write mem”

In Cisco, I can automatically backup config using scp or tftp to other location every time I issue “wr me”

How to achieve the same in other brand?

CISCO:
archive
path scp://root:eve@10.0.10.70/$h
write-memory

 

FORTIGATE:

 

HP:

 

JUNIPER:
https://forum.ivorde.com/junos-system-configuration-archival-is-not-working-over-scp-t19351.html

 

RUCKUS:

 

Killing stuck process

Arista:
# bash
$ ps –ef | grep -i Stp
$ sudo kill PID

CheckPoint:
ps -auxww  Report all active processes in the kernel we can see zombi process with this command  (z)
You must first identify the parent process of these zombies;
ps -l -p <pid of zombie>
pidof fwd (splat)
pgrep -l sshd   Find the PIDs of processes by (part of) name
ps axjf              See in tree format also i can see parent pid )
pmap PID       Memory map of process (good for hunting memory leaks)

Displaying the top 10 CPU-consuming processes (% of total usage)
ps aux | head -1; ps aux | sort -rn +2 | head -10
Displaying the processes in order of real memory use
ps vx | head -1 ; ps vx | grep -v PID | sort -rn +6 | head -10

Displaying the processes using whatchdog (CPWD) for  (CDP,FWM,FWD)
cpwd_admin list
more explanation on  this post
******************************************************
Kill a Firewall process
kill -9 (pid of process)
fw kill [-t sig] proc_name
Example:
fw kill -t 9 fwm
Also process can be kill with top command and just press -k follow by process PID

Cisco:
# show processes cpu sorted
# clear sockets PID

F5
# ps ax | grep -i sshd
# kill -9 PID

Fortinet:
-check version
# fnsysctl cat /proc/version
Linux version 2.4.37 (root@build) #1 Mon Dec  4 20:51:05 UTC 2017
-check running daemon
# fnsysctl ls /var/run
alertmail.pid       authd.pid           bgpd.pid
cmdbsvr.pid         cw_acd.pid          daemon.pid
dhcpd.pid           dnsproxy.pid        eap_proxy.pid
fclicense.pid       fcnacd.pid          fgfmd.pid
fnbamd.pid          foauthd.pid         forticldd.pid
forticron.pid       fsvrd.pid           httpclid.pid
httpd.pid           iked.pid            imi.pid
init.pid            ipsengine.pid       ipsmonitor.pid
isisd.pid           kmiglogd.pid        merged_daemons.pid
miglogd000.pid      miglogd001.pid      nsm.pid
ntpd.pid            ospf6d.pid          ospfd.pid
pdmd.pid            pim6d.pid           pimd.pid
pyfcgid.pid         ripd.pid            ripngd.pid
snmpd.pid           sshd.pid            stpd.pid
telnetd.pid         updated.pid         uploadd.pid
wpad.pid            zebos_launcher.pid
-check running PID
# fnsysctl ps
PID       UID     GID     STATE   CMD
1         0       0       S       /bin/initXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2         0       0       S       [keventd]
3         0       0       S       [ksoftirqd_CPU0]
4         0       0       S       [kswapd]
5         0       0       S       [bdflush]
6         0       0       S       [kupdated]
7         0       0       S       [memoryd]
8         0       0       S       [khubd]
12        0       0       S       [usb-storage-0]
13        0       0       S       [scsi_eh_0]
31        0       0       S       [mvl_link]
32        0       0       S       /bin/cmdbsvr
38        0       0       S       /bin/zebos_launcher
39        0       0       S       /bin/nsm -L 2
40        0       0       S       /bin/ripd -L 2
41        0       0       S       /bin/ripngd -L 2
42        0       0       S       /bin/ospfd -L 3
43        0       0       S       /bin/ospf6d -L 2
44        0       0       S       /bin/bgpd -L 3
45        0       0       S       /bin/isisd -L 2
46        0       0       S       /bin/pimd -L 2
47        0       0       S       /bin/pim6d -L 2
48        0       0       S       /bin/pdmd -L 2
49        0       0       S       /bin/imi -L 2
50        0       0       S       /bin/uploadd
51        0       0       S       /bin/miglogd
52        0       0       S       /bin/kmiglogd
53        0       0       S       /bin/httpsd
55        0       0       S       /bin/getty
56        0       0       S       /bin/ipsmonitor
59        0       0       S       /bin/merged_daemons
60        0       0       S       /bin/fnbamd
61        0       0       S       /bin/fclicense
62        0       0       S       /bin/ipshelper
63        0       0       S       /bin/forticron
64        0       0       S       /bin/forticldd
65        0       0       S       /bin/authd
66        0       0       S       /bin/foauthd
67        0       0       S       /bin/httpclid
68        0       0       S       /bin/iked
69        0       0       S       /bin/updated
70        0       0       S       /bin/snmpd
71        0       0       S       /bin/dhcpd
72        0       0       S       /bin/miglogd 1
73        0       0       S       /bin/ntpd
74        0       0       S       /bin/sshd
75        0       0       S       /bin/telnetd
78        0       0       S       /bin/alertmail
79        0       0       S       /bin/dnsproxy
80        0       0       S       /bin/eap_proxy
81        0       0       S       /bin/fgfmd
82        0       0       S       /bin/cw_acd
83        0       0       S       /bin/wpad_ac
84        0       0       S       /bin/stpd
85        0       0       S       /bin/fsvrd
87        0       0       S       /bin/fcnacd
92        0       0       S       /bin/httpsd
93        0       0       S       /bin/httpsd
94        0       0       S       /bin/httpsd
510       0       0       S       /bin/pyfcgid
512       0       0       S       /bin/pyfcgid
513       0       0       S       /bin/pyfcgid
514       0       0       S       /bin/pyfcgid
553       0       0       S       /bin/sshd
554       0       0       S       /bin/newcli
556       0       0       R       ps

-you can use diag to check 100 the most 100 top resources with 25s delay, but the list not as comprehensive as “fnsysctl ps” above
# diag sys top 25 100
Run Time:  0 days, 8 hours and 15 minutes
0U, 0N, 0S, 100I; 499T, 253F
         pyfcgid      510      S       0.0     5.1
         pyfcgid      512      S       0.0     5.0
         pyfcgid      513      S       0.0     5.0
         pyfcgid      514      S       0.0     5.0
         cmdbsvr       32      S       0.0     5.0
          httpsd       94      S       0.0     4.7
          httpsd       93      S       0.0     4.7
          httpsd       53      S       0.0     4.1
          cw_acd       82      S       0.0     4.0
          httpsd       92      S       0.0     3.9
       forticron       63      S       0.0     3.3
         miglogd       51      S       0.0     3.3
          newcli      560      R       0.0     3.1
          newcli      554      S       0.0     3.1
           fgfmd       81      S       0.0     3.0
       ipshelper       62      S <     0.0     2.5
          fcnacd       87      S       0.0     2.4
           authd       65      S       0.0     2.3
            iked       68      S       0.0     2.2
       eap_proxy       80      S       0.0     2.2

-for example we want to check dhcp PID
# fnsysctl more /var/run/dhcpd.pid
71
-to kill dhcpd
# diag sys kill 9 71
or
# fnsysctl kill -9 71
-to disable dhcpd service
# config sys dhcp server
# edit 1
# set status dis
-to enable back
# set status ena

HP:

Juniper:
> show system processes extensive
last pid: 16727; load averages: 22.24, 22.19, 22.15 up 0+17:39:34 01:26:10
265 processes: 28 running, 215 sleeping, 1 zombie, 21 waiting
Mem: 970M Active, 128M Inact, 147M Wired, 230M Cache, 112M Buf, 386M Free
> start shell
% top
   last pid: 37244; load averages: 0.04, 0.03, 0.00 up 16+16:18:49 09:19:44 52 processes:    1 running, 51 sleeping, , 1 zombie, 21 waiting
   CPU states: 2.5% user, 0.0% nice, 0.6% system, 0.3% interrupt, 96.6% idle Mem: 429M     Active, 69M Inact, 59M Wired, 165M Cache, 110M Buf, 258M Free
If the PID is identified from CLI, or the top command
% ps aux | grep –Wz
Pid=16396
Pid=13256
-to kill target PID
# kill -9 16396

Mikrotik:

PaloAlto:
Sangfor:

SonicWall:

Sophos:

Firewall/Router Attack – BlackNurse

SOURCE: blacknurse.dk

This BlackNurse attack will causing high CPU on target device

REQUIREMENT:

-Kali linux

Attack (flood better)
# hping3 -1 -C 3 -K 3 -i u20

# hping3 -1 -C 3 -K 3 –flood

RESULTS:
-Mikrotik v6.37.1 CPU utilization before attack 4%, after attack 44%
-Fortigate 5.2 CPU utilization before attack idle 99%, after attack idle 70%

This attack only from 1 source. Could be more damage if I am using more attack sources

LIST OF REPORTED AFFECTED PRODUCTS :
-Cisco ASA 5505, 5506, 5515, 5525 , 5540 (default settings)
-Cisco 6500 routers with SUP2T and Netflow v9 on the inbound interface – 100% CPU load
-Cisco ASA 5550 (Legacy) and 5515-X (latest generation)
-Cisco Router 897 – Can be mitigated – The current code from https://www.cymru.com/Documents/secure-ios-template.html will make evil worse.
-Fortinet v5.4.1 – One CPU consumed
-Fortigate units 60c and 100D (even with drop ICMP on) – RESPONSE FROM FORTINET
-Some unverified Palo Alto – SEE ANSWER FROM PALO ALTO
-Palo Alto 5050 Firewalls with firmware 7.1.4-h2
-SonicWall – Misconfiguration can be changed and mitigated (Enable Anti-DDOS)
-Zyxel NWA3560-N (Wireless attack from LAN Side)

-Zyxel Zywall USG50

NOT AFFECTED:
-AVM Fritz!Box 7360 (common ADSl router in Germany)
-Check Point Security Gateways – Checkpoint response!
-Cisco ISR4321 Router IOS XE – Version 15.5(3)S2, RELEASE SOFTWARE (fc2)
-GigaVUE HC-Serie (Gigamon)
-Iptables
-Juniper SRX
-Mikrotik CCR1036-12G-4S firmware: 3.27 (250 Mbit/sek) and no problem && RouterOS 5.4 on Mikrotik RB750
-OpenBSD 6.0 and current
-pfSense
-Ubiquiti Networks – EdgeRouter Lite CPU 60-70% load but still going
-Windows Firewalls

Fortigate OS 4.x < 5.0.7 – SSH Backdoor

SOURCE: https://www.exploit-db.com/exploits/39224/

This remote exploit which allows remote attackers to obtain administrative access via an SSH session

Affected device:
-FortiAnalyzer before 5.0.12 and 5.2.x before 5.2.5
-FortiSwitch 3.3.x before 3.3.3; FortiCache 3.0.x before 3.0.8
-FortiOS 4.1.x before 4.1.11, 4.2.x before 4.2.16, 4.3.x before 4.3.17 and 5.0.x before 5.0.8

# mv 39224.py fgt_ssh_backdoor.py
# chmod 744 fgt_ssh_backdoor.py
# ./fgt_ssh_backdoor.py targetip

How to disable SIP ALG

SOURCE:
http://www.voip-info.org/wiki/view/Routers+SIP+ALG

Many of today’s commercial routers implement SIP ALG (Application-level gateway), coming with this feature enabled by default. While ALG could help in solving NAT related problems, the fact is that many routers’ ALG implementations are wrong and break SIP.

CheckPoint
login to Smart Dashboard
click Smart Defence tab
expand Application Intelligence
expand VoIP
disable all features on H.323

Cisco
(config)# no ip nat service sip tcp port 5060
(config)# no ip nat service sip udp port 5060

ASA
(config)# policy-map global_policy
(config)# no inspect sip

Cyberoam
> cyberoam system_modules sip unload

D-Link
Open a browser and enter the router’s IP address in the address bar. Go to “Firewall Settings” under the “Advanced” item.
Uncheck the box to disable SPI – usually, directly below this item are options for “NAT Endpoint Filtering” that must be changed to “Endpoint Independent” for both TCP and UDP.
Next, find the “Application Level Gateway (ALG) Configuration” area and uncheck the box for SIP.
Save these settings and reboot the device if requested

FortiGate
disable SIP ALG
# config system settings
# set sip-helper disable
# set sip-nat-trace disable
# end
verify
# show full-configuration system settings
delete sip
# config system session-helper
(session-helper) # show
config system session-helper
edit 1
set name pptp
set protocol 6
set port 1723
next
edit 2
set name h323
set protocol 6
set port 1720
next
edit 3
set name ras
set protocol 17
set port 1719
next
edit 4
set name tns
set protocol 6
set port 1521
next
edit 5
set name tftp
set protocol 17
set port 69
next
edit 6
set name rtsp
set protocol 6
set port 554
next
edit 7
set name rtsp
set protocol 6
set port 7070
next
edit 8
set name rtsp
set protocol 6
set port 8554
next
edit 9
set name ftp
set protocol 6
set port 21
next
edit 10
set name mms
set protocol 6
set port 1863
next
edit 11
set name pmap
set protocol 6
set port 111
next
edit 12
set name pmap
set protocol 17
set port 111
next
edit 13
set name sip
set protocol 17
set port 5060
next
edit 14
set name dns-udp
set protocol 17
set port 53
next
edit 15
set name rsh
set protocol 6
set port 514
next
edit 16
set name rsh
set protocol 6
set port 512
next
edit 17
set name dcerpc
set protocol 6
set port 135
next
edit 18
set name dcerpc
set protocol 17
set port 135
next
edit 19
set name mgcp
set protocol 17
set port 2427
next
edit 20
set name mgcp
set protocol 17
set port 2727
next
end
(session-helper) # delete 13
(session-helper) # end

Juniper
https://kb.juniper.net/InfoCenter/index?page=content&id=KB7078&actp=search
# set security alg sip disable
# commit and quit

Mikrotik
> ip firewall service-port set sip disabled=yes

Netgear
From Wan Setup Menu, NAT Filtering, uncheck the box next to “Disable SIP ALG”

PaloAlto
https://live.paloaltonetworks.com/t5/Configuration-Articles/How-to-Disable-SIP-ALG/ta-p/60637
# set shared alg-override application sip alg-disabled yes

Peplink
go to http://<router.LAN.IP>/cgi-bin/MANGA/support.cgi
Click the “Disable” button under “SIP ALG Support”

SonicWall
in GUI, go to VOIP>Settings>General Settings
tick Enable consistent NAT
untick Enable SIP Transformations

SpeedTouch
telnet router
> connection unbind application=SIP port=5060
> saveall

Zyxel
telnet router
Menu option “24. System Maintenance”.
Menu option “8. Command Interpreter Mode”.
ip nat service sip active 0

Blocking Browsec Chrome Extension

Browsec is VPN extension similar to ZenMate

CheckPoint:
Image.png

Cisco ASA:

Cyberoam:

Fortigate:

Juniper:

Mikrotik:

/ip firewall address-list
add address=12.12.12.0/24 list=LAN
/ip firewall layer7-protocol
add name=browsec regexp=”^.+(postls.com).*\$”
/ip firewall filter

add action=drop chain=forward layer7-protocol=browsec src-address-list=LAN

PaloAlto:

SonicWall:

Blocking Telegram

Telegram is like WhatsApp that can be downloaded here

https://telegram.org

CheckPoint:
Image.png

Cisco ASA:

interface Ethernet0
 nameif outside
 security-level 0
 ip address dhcp
!
interface Ethernet1
 nameif inside
 security-level 100
 ip address 12.12.12.1 255.255.255.0
clock timezone gmt 7
dns domain-lookup outside
dns domain-lookup inside
dns server-group DefaultDNS
 name-server 8.8.8.8
 name-server 8.8.4.4
object network PAT
 subnet 12.12.12.0 255.255.255.0
object network telegram1
 subnet 91.108.4.0 255.255.252.0
object network telegram2
 subnet 91.108.56.0 255.255.252.0
object network telegram3
 subnet 149.154.160.0 255.255.252.0
object network telegram4
 subnet 149.154.164.0 255.255.252.0
object network telegram5
 subnet 149.154.168.0 255.255.252.0
object network telegram6
 subnet 149.154.172.0 255.255.252.0
object-group network objgrp-telegram
 network-object object telegram1
 network-object object telegram2
 network-object object telegram3
 network-object object telegram4
 network-object object telegram5
 network-object object telegram6
access-list LAN extended permit ip any any
access-list acl-telegram extended deny ip any object-group objgrp-telegram
access-list ping extended permit icmp any interface outside
access-list ping extended permit icmp any interface inside
access-list outside_access_out extended deny ip any object-group objgrp-telegram
access-list outside_access_out extended permit ip any any
object network PAT
 nat (inside,outside) dynamic interface
access-group outside_access_out out interface outside
access-group LAN in interface inside
route outside 0.0.0.0 0.0.0.0 10.0.10.1 1
user-identity default-domain LOCAL
http server enable
http 10.0.10.0 255.255.255.0 outside
http 12.12.12.0 255.255.255.0 inside
ntp server 180.211.88.211
policy-map global_policy
 class inspection_default
  inspect dns preset_dns_map
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect ip-options
  inspect netbios
  inspect rsh
  inspect rtsp
  inspect skinny
  inspect esmtp
  inspect sqlnet
  inspect sunrpc
  inspect tftp
  inspect sip
  inspect xdmcp
  inspect icmp
  inspect icmp error

 

FortiGate:
config system interface
    edit “port1”
        set vdom “root”
        set mode dhcp
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 1
    next
    edit “port2”
        set vdom “root”
        set ip 12.12.12.1 255.255.255.0
        set allowaccess ping https ssh fgfm
        set type physical
        set snmp-index 2
    next
end
config firewall policy
    edit 1
        set name “PAT”
        set uuid 170d4c60-0d49-51e6-102b-cc84e02a9dfb
        set srcintf “port2”
        set dstintf “port1”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
        set nat enable
    next
    edit 2
        set name “telegram”
        set uuid 0b2d9320-0d5b-51e6-ce90-307685813f39
        set srcintf “port2”
        set dstintf “port1”
        set srcaddr “all”
        set dstaddr “telegramgroup”
        set schedule “always”
        set service “HTTP” “HTTPS”
        set logtraffic all
    next
end
config firewall address
    edit “telegram”
        set uuid 532c2ac0-0d5a-51e6-754f-62c1c2f11af6
        set subnet 91.108.4.0 255.255.252.0
    next
    edit “telegram2”
        set uuid a0149520-0d5a-51e6-b083-9fda96570787
        set subnet 91.108.56.0 255.255.252.0
    next
    edit “telegram3”
        set uuid a0149520-0d5a-51e6-b083-9fda96570787
        set subnet 149.154.160.0 255.255.252.0
    next
    edit “telegram4”
        set uuid a0149520-0d5a-51e6-b083-9fda96570787
        set subnet 149.154.164.0 255.255.252.0
    next
    edit “telegram5”
        set uuid a0149520-0d5a-51e6-b083-9fda96570787
        set subnet 149.154.168.0 255.255.252.0
    next
    edit “telegram6”
        set uuid a0149520-0d5a-51e6-b083-9fda96570787
        set subnet 149.154.172.0 255.255.252.0
    next
end
config firewall addrgrp
    edit “telegramgroup”
        set uuid 72081cc0-0d5e-51e6-f4e3-e05511d7c552
        set member “telegram” “telegram2” “telegram3” “telegram4” “telegram5” “telegram6”
    next

end

Juniper:

# show
version 12.1X46-D10.2;
system {
    host-name SRX1;
    root-authentication {
        encrypted-password “$1$htJmWkYL$Dij6D2dwMvBOvSm64mJVt0”; ## SECRET-DATA
    }
    name-server {
        8.8.8.8;
        8.8.4.4;
    }
    services {
        ssh;
        web-management {
            http {
                interface ge-0/0/0.0;
            }
        }
    }
    syslog {
        file messages {
            any any;
        }
    }
    license {
        autoupdate {
        }
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                filter {
                    input BLOCK-TELEGRAM;
                }
                dhcp;
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 12.12.12.1/24;
            }
        }
    }
}
routing-options {
    static {
        route 0.0.0.0/0 next-hop 10.0.10.1;
    }
}
policy-options {
    prefix-list ADDRESSLIST-TELEGRAM {
        91.108.4.0/22;
        91.108.56.0/22;
        149.154.160.0/22;
        149.154.164.0/22;
        149.154.168.0/22;
        149.154.172.0/22;
    }
}
security {
    screen {
        ids-option untrust-screen {
            icmp {
                ping-death;
            }
            ip {
                source-route-option;
                tear-drop;
            }
            tcp {
                syn-flood {
                    alarm-threshold 1024;
                    attack-threshold 200;
                    source-threshold 1024;
                    destination-threshold 2048;
                    queue-size 2000; ## Warning: ‘queue-size’ is deprecated
                    timeout 20;
                }
                land;
            }
        }
    }
    nat {
        source {
            rule-set PAT {
                from zone trust;
                to zone untrust;
                rule PAT {
                    match {
                        source-address 0.0.0.0/0;
                        destination-address 0.0.0.0/0;
                    }
                    then {
                        source-nat {
                            interface;
                        }
                    }
                }
            }
        }
    }
    policies {
        from-zone trust to-zone trust {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone trust to-zone untrust {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone untrust to-zone trust {
            policy default-deny {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    deny;
                }
            }
        }
    }
    zones {
        security-zone trust {
            tcp-rst;
            interfaces {
                ge-0/0/1.0;
            }
        }
        security-zone untrust {
            screen untrust-screen;
            interfaces {
                ge-0/0/0.0 {
                    host-inbound-traffic {
                        system-services {
                            dhcp;
                        }
                    }
                }
            }
        }
    }
}
firewall {
    filter BLOCK-TELEGRAM {
        term LIST-TELEGRAM {
            from {
                source-prefix-list {
                    ADDRESSLIST-TELEGRAM;
                }
            }
            then {
                discard;
            }
        }
        term ALLOW-REST {
            then accept;
        }
    }
}

 

Mikrotik:
/ip firewall address-list
add address=12.12.12.0/24 list=LAN
add address=149.154.160.0/22 list=telegram
add address=149.154.164.0 /22 list=telegram
add address=149.154.168.0 /22 list=telegram
add address=149.154.172.0 /22 list=telegram
add address=91.108.4.0/22 list=telegram
add address=91.108.56.0/22 list=telegram
/ip firewall filter
add action=drop chain=forward dst-address-list=telegram src-address-list=LAN

PaloAlto:

SonicWall:

OSPF Labs

Cisco-Cisco

19-Apr 05.23.44
R1#sh run
hostname R1
interface Loopback0
 ip address 1.0.0.1 255.255.255.255
interface FastEthernet0/0
 no ip address
 shutdown
 duplex full
interface Ethernet1/0
 ip address 10.0.10.61 255.255.255.0
 ip nat outside
 duplex full
interface Ethernet1/1
 ip address 12.12.12.1 255.255.255.252
 ip nat inside
 duplex full
interface Ethernet1/2
 ip address 31.31.31.2 255.255.255.252
 ip nat inside
 duplex full
interface Ethernet1/3
 no ip address
 duplex full
router ospf 1
 redistribute static subnets
 network 1.0.0.0 0.0.0.0 area 0
 network 12.12.12.0 0.0.0.3 area 0
 network 31.31.31.0 0.0.0.3 area 0
 default-information originate
ip nat inside source list LAN interface Ethernet1/0 overload
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.0.10.1
ip access-list standard LAN
 permit 12.12.12.0 0.0.0.3
 permit 23.23.23.0 0.0.0.3
 permit 31.31.31.0 0.0.0.3
 permit 1.0.0.0 0.0.0.7
R2#sh run
hostname R2
interface Loopback0
 ip address 1.0.0.2 255.255.255.255
interface FastEthernet0/0
 no ip address
 shutdown
 duplex full
interface Ethernet1/0
 no ip address
 duplex full
interface Ethernet1/1
 ip address 12.12.12.2 255.255.255.252
 duplex full
interface Ethernet1/2
 ip address 23.23.23.1 255.255.255.252
 duplex full
interface Ethernet1/3
 no ip address
 shutdown
 duplex full
router ospf 1
 network 1.0.0.0 0.0.0.0 area 0
 network 12.12.12.0 0.0.0.3 area 0
 network 23.23.23.0 0.0.0.3 area 0
ip forward-protocol nd
R3#sh run
hostname R3
interface Loopback0
 ip address 1.0.0.3 255.255.255.255
interface FastEthernet0/0
 no ip address
 shutdown
 duplex full
interface Ethernet1/0
 no ip address
 duplex full
interface Ethernet1/1
 ip address 23.23.23.2 255.255.255.252
 duplex full
interface Ethernet1/2
 ip address 31.31.31.1 255.255.255.252
 duplex full
interface Ethernet1/3
 no ip address
 shutdown
 duplex full
router ospf 1
 network 1.0.0.0 0.0.0.0 area 0
 network 23.23.23.0 0.0.0.3 area 0
 network 31.31.31.0 0.0.0.3 area 0

ip forward-protocol nd

FortiGate-FortiGate
20-Apr 00.51.19
FGT1
config system interface
    edit “port1”
        set vdom “root”
        set ip 10.0.10.61 255.255.255.0
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 1
    next
    edit “port2”
        set vdom “root”
        set ip 12.12.12.1 255.255.255.252
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 2
    next
    edit “port3”
        set vdom “root”
        set ip 31.31.31.2 255.255.255.252
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 3
    next
    edit “port4”
        set vdom “root”
        set type physical
        set snmp-index 4
    next
    edit “ssl.root”
        set vdom “root”
        set type tunnel
        set alias “SSL VPN interface”
        set snmp-index 5
    next
    edit “loopback”
        set vdom “root”
        set ip 1.0.0.1 255.255.255.255
        set type loopback
        set snmp-index 6
    next
end
config firewall policy
    edit 1
        set uuid ef6c951c-0627-51e6-739a-6ddf25cfc795
        set srcintf “port2”
        set dstintf “port3”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
    next
    edit 2
        set uuid 6e9d6c2c-0708-51e6-17f6-3c373c555f2b
        set srcintf “port3”
        set dstintf “port2”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
    next
    edit 3
        set uuid 0d34fb4c-070a-51e6-439a-725742a0b680
        set srcintf “port2” “port3”
        set dstintf “port1”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
        set nat enable
    next
end
config router static
    edit 1
        set gateway 10.0.10.1
        set device “port1”
    next
end
config router ospf
    set default-information-originate enable
    set router-id 1.0.0.1
    config area
        edit 0.0.0.0
        next
    end
    config ospf-interface
        edit “loopback”
            set interface “loopback”
            set ip 1.0.0.1
        next
    end
    config network
        edit 1
            set prefix 12.12.12.0 255.255.255.252
        next
        edit 2
            set prefix 31.31.31.0 255.255.255.252
        next
        edit 3
            set prefix 1.0.0.1 255.255.255.255
        next
    end
    config redistribute “connected”
    end
    config redistribute “static”
        set status enable
    end
    config redistribute “rip”
    end
    config redistribute “bgp”
    end
    config redistribute “isis”
    end

end

FGT2
config system interface
    edit “port1”
        set vdom “root”
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 1
    next
    edit “port2”
        set vdom “root”
        set ip 12.12.12.2 255.255.255.252
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 2
    next
    edit “port3”
        set vdom “root”
        set ip 23.23.23.1 255.255.255.252
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 3
    next
    edit “port4”
        set vdom “root”
        set type physical
        set snmp-index 4
    next
    edit “ssl.root”
        set vdom “root”
        set type tunnel
        set alias “SSL VPN interface”
        set snmp-index 5
    next
    edit “loopback”
        set vdom “root”
        set ip 1.0.0.2 255.255.255.255
        set type loopback
        set snmp-index 6
    next
end
config router ospf
    set router-id 1.0.0.2
    config area
        edit 0.0.0.0
        next
    end
    config ospf-interface
        edit “loopback”
            set interface “loopback”
            set ip 1.0.0.2
        next
    end
    config network
        edit 1
            set prefix 12.12.12.0 255.255.255.252
        next
        edit 2
            set    prefix 23.23.23.0 255.255.255.252
        next
        edit 3
             set prefix 1.0.0.2 255.255.255.255
        next
    end
    config redistribute “connected”
    end
    config redistribute “static”
    end
     config redistribute “rip”
    end
    config redistribute “bgp”
    end
    config redistribute “isis”
    end
end
config firewall policy
    edit 1
        set uuid 5a630c00-071f-51e6-e8ae-2344f9e5a0e6
        set srcintf “port2”
        set dstintf “port3”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
        set nat enable
    next
    edit 2
        set uuid 5db36f80-071f-51e6-623f-42be7d156fd5
        set srcintf “port3”
        set dstintf “port2”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
    next

end

FGT3
config system interface
    edit “port1”
        set vdom “root”
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 1
    next
    edit “port2”
        set vdom “root”
        set ip 23.23.23.2 255.255.255.252
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 2
    next
    edit “port3”
        set vdom “root”
        set ip 31.31.31.1 255.255.255.252
        set allowaccess ping https ssh http fgfm
        set type physical
        set snmp-index 3
    next
    edit “port4”
        set vdom “root”
        set type physical
        set snmp-index 4
    next
    edit “ssl.root”
        set vdom “root”
        set type tunnel
        set alias “SSL VPN interface”
        set snmp-index 5
    next
    edit “loopback”
        set vdom “root”
        set ip 1.0.0.3 255.255.255.255
        set type loopback
        set snmp-index 6
    next
end
config router ospf
    set router-id 1.0.0.3
    config area
        edit 0.0.0.0
        next
    end
    config ospf-interface
        edit “loopback”
            set interface “loopback”
            set ip 1.0.0.3
        next
    end
    config network
        edit 1
            set prefix 23.23.23.0 255.255.255.252
        next
        edit 2
            set prefix 31.31.31.0 255.255.255.252
        next
        edit 3
            set prefix 1.0.0.3 255.255.255.255
        next
    end
    config redistribute “connected”
    end
    config redistribute “static”
    end
    config redistribute “rip”
    end
    config redistribute “bgp”
    end
    config redistribute “isis”
    end
end
config firewall policy
    edit 1
        set uuid 41d5f3a0-071f-51e6-df0e-727622495609
        set srcintf “port2”
        set dstintf “port3”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
        set nat enable
    next
    edit 2
        set uuid 46ddcb20-071f-51e6-0dc2-22dfea80d1d2
        set srcintf “port3”
        set dstintf “port2”
        set srcaddr “all”
        set dstaddr “all”
        set action accept
        set schedule “always”
        set service “ALL”
    next
end
NOTE:
-to refresh ospf db
# exe router clear ospf process
-to show route db

# get router info routing-table all

Juniper-Juniper
22-Apr 16.13.05.jpg

 

NOTE:

-With current config, I have problem ping to Internet from R1. I don’t know yet that is because in Unetlab or because I reduce the RAM in each router to 1GB

R1

# show
system {
    host-name R1;
    root-authentication {
        encrypted-password “$1$7VWGeJRn$iG.WRousX9Fi5BKcaZGV7/”; ## SECRET-DATA
    }
    services {
        ssh;
        web-management {
            http {
                interface ge-0/0/0.0;
            }
        }
    }
    syslog {
        file messages {
            any any;
        }
    }
    license {
        autoupdate {
        }
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.0.10.61/24;
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 12.12.12.1/30;
            }
        }
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 31.31.31.2/30;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.0.0.1/32;
            }
        }
    }
}
routing-options {
    static {
        route 0.0.0.0/0 {
            next-hop 10.0.10.1;
            no-install;
        }
    }
}
protocols {
    ospf {
        export ospf-default;
        area 0.0.0.0 {
            interface ge-0/0/1.0;
            interface ge-0/0/2.0;
            interface lo0.0;
        }
    }
}
policy-options {
    policy-statement ospf-default {
        from {
            protocol static;
          route-filter 0.0.0.0/0 exact;
        }
        then accept;
    }
}
security {
    screen {
        ids-option untrust-screen {
            icmp {
                ping-death;
            }
            ip {
                source-route-option;
                tear-drop;
            }
            tcp {
                syn-flood {
                    alarm-threshold 1024;
                    attack-threshold 200;
                    source-threshold 1024;
                    destination-threshold 2048;
                    queue-size 2000; ## Warning: ‘queue-size’ is deprecated
                    timeout 20;
                }
                land;
            }
        }
    }
    nat {
        source {
            rule-set trust-to-untrust {
                from zone trust;
                to zone untrust;
                rule source-nat-rule {
                    match {
                        source-address 0.0.0.0/0;
                    }
                    then {
                        source-nat {
                            interface;
                        }
                    }
                }
            }
        }
    }
    policies {
        from-zone trust to-zone trust {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone trust to-zone untrust {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone untrust to-zone trust {
            policy default-deny {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    deny;
                }
            }
        }
    }
    zones {
        security-zone trust {
            tcp-rst;
            host-inbound-traffic {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                ge-0/0/1.0;
                ge-0/0/2.0;
                lo0.0;
            }
        }
        security-zone untrust {
            screen untrust-screen;
            interfaces {
                ge-0/0/0.0;
            }
        }
    }
}
# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
12.12.12.2       ge-0/0/1.0             Full      1.0.0.2          128    32
31.31.31.1       ge-0/0/2.0             Full      1.0.0.3          128    39
# run show route
inet.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0.0.0.0/0          *[Static/5] 01:24:39
                    > to 10.0.10.1 via ge-0/0/0.0
1.0.0.1/32         *[Direct/0] 00:55:05
                    > via lo0.0
1.0.0.2/32         *[OSPF/10] 00:54:19, metric 1
                    > to 12.12.12.2 via ge-0/0/1.0
1.0.0.3/32         *[OSPF/10] 00:54:57, metric 1
                    > to 31.31.31.1 via ge-0/0/2.0
10.0.10.0/24       *[Direct/0] 01:09:05
                    > via ge-0/0/0.0
10.0.10.61/32      *[Local/0] 01:09:05
                      Local via ge-0/0/0.0
12.12.12.0/30      *[Direct/0] 01:09:05
                    > via ge-0/0/1.0
12.12.12.1/32      *[Local/0] 01:09:05
                      Local via ge-0/0/1.0
23.23.23.0/30      *[OSPF/10] 00:54:19, metric 2
                    > to 12.12.12.2 via ge-0/0/1.0
                      to 31.31.31.1 via ge-0/0/2.0
31.31.31.0/30      *[Direct/0] 01:09:05
                    > via ge-0/0/2.0
31.31.31.2/32      *[Local/0] 01:09:05
                      Local via ge-0/0/2.0
224.0.0.5/32       *[OSPF/10] 00:55:07, metric 1

                      MultiRecv

R2

# show
system {
    host-name R2;
    root-authentication {
        encrypted-password “$1$ucm0iauC$pA0/LpyHYtln36Hmw12Gj0”; ## SECRET-DATA
    }
    services {
        ssh;
        web-management {
            http {
                interface ge-0/0/0.0;
            }
        }
    }
    syslog {
        file messages {
            any any;
        }
    }
    license {
        autoupdate {
        }
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 12.12.12.2/30;
            }
        }
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 23.23.23.1/30;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.0.0.2/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.0 {
            interface ge-0/0/1.0;
            interface ge-0/0/2.0;
            interface lo0.0;
        }
    }
}
security {
    zones {
        security-zone trust {
            host-inbound-traffic {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                ge-0/0/1.0;
                ge-0/0/2.0;
                lo0.0;
            }
        }
    }

}

R3

# show
system {
    host-name R3;
    root-authentication {
        encrypted-password “$1$jYOE9h1/$8E0Rfv77QNRFiAEItVkTZ.”; ## SECRET-DATA
    }
    services {
        ssh;
        web-management {
            http {
                interface ge-0/0/0.0;
            }
        }
    }
    syslog {
        file messages {
            any any;
        }
    }
    license {
        autoupdate {
        }
    }
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet;
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                address 23.23.23.2/30;
            }
        }
    }
    ge-0/0/2 {
        unit 0 {
            family inet {
                address 31.31.31.1/30;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.0.0.3/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.0 {
            interface ge-0/0/1.0;
            interface ge-0/0/2.0;
            interface lo0.0;
        }
    }
}
security {
    screen {
        ids-option untrust-screen {
            icmp {
                ping-death;
            }
            ip {
                source-route-option;
                tear-drop;
            }
            tcp {
                syn-flood {
                    alarm-threshold 1024;
                    attack-threshold 200;
                    source-threshold 1024;
                    destination-threshold 2048;
                    queue-size 2000; ## Warning: ‘queue-size’ is deprecated
                    timeout 20;
                }
                land;
            }
        }
    }
    policies {
        from-zone trust to-zone trust {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone trust to-zone untrust {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone untrust to-zone trust {
            policy default-deny {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    deny;
                }
            }
        }
    }
    zones {
        security-zone trust {
            tcp-rst;
            host-inbound-traffic {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                ge-0/0/1.0;
                ge-0/0/2.0;
                lo0.0;
            }
        }
        security-zone untrust {
            screen untrust-screen;
        }
    }
}
Mikrotik-Mikrotik
19-Apr 10.06.22
R1] > export
/interface bridge
add name=loopback
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing ospf instance
set [ find default=yes ] distribute-default=always-as-type-1 \
    redistribute-static=as-type-1 router-id=1.0.0.1
/ip address
add address=10.0.10.61/24 interface=ether1 network=10.0.10.0
add address=12.12.12.1/30 interface=ether2 network=12.12.12.0
add address=31.31.31.2/30 interface=ether3 network=31.31.31.0
add address=1.0.0.1 interface=loopback network=1.0.0.1
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
/ip route
add distance=1 gateway=10.0.10.1
/routing ospf network
add area=backbone network=1.0.0.1/32
add area=backbone network=12.12.12.0/30
add area=backbone network=31.31.31.0/30
/system identity

set name=R1

[admin@R2] > export
/interface bridge
add name=loopback
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing ospf instance
set [ find default=yes ] router-id=1.0.0.2
/ip address
add address=12.12.12.2/30 interface=ether2 network=12.12.12.0
add address=1.0.0.2 interface=loopback network=1.0.0.2
add address=23.23.23.1/30 interface=ether3 network=23.23.23.0
/routing ospf network
add area=backbone network=1.0.0.2/32
add area=backbone network=12.12.12.0/30
add area=backbone network=23.23.23.0/30
/system identity

set name=R2

[admin@R3] > export
/interface bridge
add name=loopback
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing ospf instance
set [ find default=yes ] router-id=1.0.0.3
/ip address
add address=23.23.23.2/30 interface=ether2 network=23.23.23.0
add address=31.31.31.1/30 interface=ether3 network=31.31.31.0
/routing ospf network
add area=backbone network=1.0.0.3/32
add area=backbone network=31.31.31.0/30
add area=backbone network=23.23.23.0/30
/system identity

set name=R3

Cisco-FortiGate-Juniper-Mikrotik
 20-Apr 22.27.42.jpg