Friday, May 29, 2020

Memanage IP Public Menggunakan PHPIPAM



Kali ini saya akan share bagaimana caranya install phpipam.
phpipam adalah tool untuk me-manage ip public secara web-base. Aplikasi ini canggih sekali dan memudahkan dalam me-manage ip. Check This Out

# install apache

apt install ca-certificates apt-transport-https
apt-get install apache2

# install mysql-server
apt-get install mysql-server

# install php terbaru
wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
echo "deb https://packages.sury.org/php/ jessie main" | tee /etc/apt/sources.list.d/php.list

# update dependensi
apt update

# install php-mysql biar konek PHP<>MYSQL
apt-get install php php-mysql libapache2-mod-php

# cek dulu php yg terinstall versi berapa
root@filter1:/var/www/html/phpipam# php -v
PHP 7.4.6 (cli) (built: May 14 2020 10:54:20) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies
# ok disitu tertera versi 7.4.6 maka yang dianggap adalah versi 7.4 saja

# install modul yang diperlukan
apt-get install libgmp-dev php7.4-gmp php7.4-gd php7.4-curl php7.4-mbstring
apt-get install php-pear

# enable modul php mbstring
phpenmod -v 7.4 mbstring

# enable modul apache2
a2enmod rewrite

# restart service apache
/etc/init.d/apache2 restart

ok sudah jadi, kemudian ikuti tutorial sebagaimana link berikut :
https://phpipam.net/documents/installation/

# git clone phpipam
git clone --recursive https://github.com/phpipam/phpipam.git /var/www/html/phpipam
cd /var/ww/html/phpipam/
mv config.dist.php config.php

# kemudian edit config.php
# jangan lupa define('BASE', "/"); diganti define('BASE', "/phpipam/.");
# karena path nya http://ip-server/phpipam/
# jika sudah lakukan instalasi
# selesai

Wednesday, May 27, 2020

PortChannel LACP CISCO3048TP


WI-131(config-if)# int e1/35
WI-131(config-if)# switchport
WI-131(config-if)# channel-group 1 mode active
WI-131(config-if)# int e1/36
WI-131(config-if)# switchport
WI-131(config-if)# channel-group 1 mode active
WI-131(config-if)# int port-channel 1
WI-131(config-if)# switchport
WI-131(config-if)# switchport mode trunk
WI-131(config-if)# switchport trunk allowed vlan 2011
WI-131(config-if)# no sh
WI-131(config-if)# sh port-channel summary
Flags:  D - Down        P - Up in port-channel (members)
        I - Individual  H - Hot-standby (LACP only)
        s - Suspended   r - Module-removed
        S - Switched    R - Routed
        U - Up (port-channel)
        M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port-       Type     Protocol  Member Ports
      Channel
--------------------------------------------------------------------------------
1     Po1(SU)     Eth      LACP      Eth1/35(P)   Eth1/36(P)


ether03 = e1/35
ether04 = e1/36

Thursday, May 7, 2020

Lock IP Public PPPOE Indihome

:local IFACE
:set IFACE INDIHOME

:local WANIP [/ip address get [find where interface=$IFACE] address];
:set WANIP [:pick $WANIP 0 ([:len $WANIP]-3) ];

:if ($WANIP ~"^10[.]") do={
:log warning "Private ip address found !!!"
/interface pppoe-client enable $IFACE
:delay 1
} else={

:if ($WANIP ~"^172.") do={
:log warning "Private ip address found !!!"
/interface pppoe-client enable $IFACE
:delay 1
} else={
:if ($WANIP ~"^192.") do={
:log warning "Private ip address found !!!"
/interface pppoe-client enable $IFACE
:delay 1
} else={
:log warning "Public IP - $WANIP - Found, OK ! No action required"
}
}
}
:delay 10
/ip cloud force-update

Tuesday, May 5, 2020

auto update gre mikrotik

:global currentIP
# ubah di sini
:global iface "PPPOE"
/in pppoe-client monitor $iface once do={:set currentIP $"local-address" }
:if ($currentIP in 10.0.0.0/8) do={
:log error "re-dial...";
/in pppoe-client disable $iface
:delay 2
/in pppoe-client enable $iface
}
# ubah di sini
:global ifacegre "gre-dewo"
:global p2p [/ip address get [find interface=$ifacegre] network  ]
:global target [/in gre get $ifacegre remote-address ]
# cek berdasarkan running interface gre
#:if ($statusgre != true) do={
#/in gre export file=$ifacegre
#:delay 1
# cek berdasarkan ping target
:if ([/ping $p2p count=2] = 0 ) do={
/in gre export file=$ifacegre
:delay 1
/in gre set $ifacegre local-address=$currentIP
:log error "$ifacegre error, kirim file"
/file set contents="/in gre set $ifacegre remote-address=$currentIP" [find name~"$ifacegre"]
:delay 2
/tool fetch mode=ftp upload=yes src-path="$ifacegre.rsc" dst-path="$ifacegre.rsc" user=ftp password=ftp port=21 address="$target"
}