route add destination_network MASK subnet_mask gateway_ip metric_cost
Static Routing windows OS with CMD
route add destination_network MASK subnet_mask gateway_ip metric_cost
maouam Juni 28, 2023 Network, Tools No comments
1. Uninstall zerotier
- sudo apt remove zerotier-one -y
2. install again (copy paste script, sudo user)
# save /etc/debian-version
# (which will be something like kali-rolling)
DV_SAVE=$(cat /etc/debian_version)
# pretend we're Debian buster
echo testing | sudo tee /etc/debian_version >/dev/null
# follow ZeroTier install instructions from:
# https://www.zerotier.com/download/
# for example, if you don't care about checking gpg signatures:
curl -s https://install.zerotier.com | sudo bash
# restore /etc/debian-version
echo $DV_SAVE | sudo tee /etc/debian_version >/dev/null
3. DONE
maouam Juni 06, 2023 Network No comments
- Download pfSense
- Launch the installer
/opt/qemu/bin/qemu-system-x86_64 -hda install.img -hdb virtioa.qcow2 -nographic
- Following the installation process, if finish do not reboot, choose shell and command poweroff
- Rename file from virtioa.qcow2 to hda.qcow2
- Fix Permission
/opt/unetlab/wrappers/unl_wrapper -a fixpermissions
- DONE :)
maouam Juni 04, 2023 Network No comments
Set IP static, role wan
Fortigate # config system interface
Fortigate (interface) # edit port1
Fortigate (port1) # set mode static
Fortigate (port1) # set ip 10.17.0.10 255.255.255.0
Fortigate (port1) # set allowaccess ping https
Fortigate (port1) # set type physical
Fortigate (port1) # set role wan
Fortigate (port1) # set snmp-index 1
Fortigate (port1) # next
Fortigate (interface) # end
Set Gateway
Fortigate # config router static
Fortigate (static) # edit 1
Fortigate (1) # set gateway 10.17.0.1
Fortigate (1) # set device port1
Fortigate (1) # set comment "to WAN"
Fortigate (1) # next
Fortigate (static) #end
maouam Mei 02, 2023 Network, Server No comments
1. Enable IP Forwarding
- sysctl net.ipv4.ip_forward=1
2. Add Rule
- iptables -t nat -A PREROUTING -p tcp -d 192.168.23.1 --dport 5544 -j DNAT --to-destination 192.168.2.11:554
3. Ask IPtables to Masquerade
- iptables -t nat -A POSTROUTING ! -s 127.0.0.1 -j MASQUERADE
4. Check config
- iptables -t nat -L
5. Save config
- sudo iptables-save
6. Delete if needed
- sudo iptables -t nat -L --line-numbers
- iptables -t nat -D PREROUTING 1
maouam April 24, 2023 Mikrotik, Network No comments
1. Add Public IP to Public interface
- /ip address add address=202.25.212.12/28 interface=Public
2. Add rule internal server allow access from external network (internet)
- /ip firewall nat add chain=dstnat dst-address=202.25.212.12 action=dst-nat to-addresses=192.168.0.120
3. add rule internal server can talk with outer network (source ip address translated to 192.168.0.120)
- /ip firewall nat add chain=srcnat src-address=192.168.0.120 action=src-nat to-addresses=202.25.212.12
NOTE: if it doesn't work put the rule at the top
DONE
maouam Maret 23, 2023 Cisco, Network No comments
Config VRF dan OSPF pada Cisco Router
Config IP Address dan
Hostname di R1
Router(config)#
hostname R1
R1(config)#
int e0/0
R1(config-if)#
ip address 10.11.11.2 255.255.255.0
R1(config-if)#
no shutdown
Config IP Address dan
Hostname di R2
Router(config)#
hostname R2
R2(config)#
int e0/0
R2(config-if)#
ip address 10.11.11.2 255.255.255.0
R2(config-if)#
no shutdown
Config Hostname, VRF dan
IP address di R-ISP-PE1
Router(config)#
hostname R-ISP-PE1
R-ISP-PE1(config)#
ip vrf PT.A
R-ISP-PE1(config-vrf)#
rd 10.11.11.1:1
R-ISP-PE1(config)#
ip vrf PT.B
R-ISP-PE1(config-vrf)#
rd 10.11.11.1:2
R-ISP-PE1(config)#
int e0/1
R-ISP-PE1(config-if)#
ip vrf forwarding PT.A
R-ISP-PE1(config-if)#
ip address 10.11.11.1 255.255.255.0
R-ISP-PE1(config-if)#
no shutdown
R-ISP-PE1(config)#
int e0/2
R-ISP-PE1(config-if)#
ip vrf forwarding PT.B
R-ISP-PE1(config-if)#
ip address 10.11.11.1 255.255.255.0
R-ISP-PE1(config-if)#
no shutdown
Lakukan pengujian ping di
R1, R2, dan R-ISP-PE1
R1#
ping 10.11.11.1
R2#
ping 10.11.11.1
R-ISP-PE1#
ping vrf PT.A 10.11.11.2
R-ISP-PE1#
ping vrf PT.B 10.11.11.2
Config juga di bagian
sebelah kanan untuk R3, R4 dan R-ISP-PE2
Config IP Address dan
Hostname di R3
Router(config)#
hostname R3
R3(config)#
int e0/0
R3(config-if)#
ip address 10.11.12.2 255.255.255.0
R3(config-if)#
no shutdown
R3(config)#
lo1
R3(config-if)#
ip address 10.5.1.1 255.255.255.255
R3(config)#
lo2
R3(config-if)#
ip address 10.5.2.1 255.255.255.255
R3(config)#
lo3
R3(config-if)#
ip address 10.5.3.1 255.255.255.255
Config IP Address dan
Hostname di R4
Router(config)#
hostname R4
R4(config)#
int e0/0
R4(config-if)#
ip address 10.11.12.2 255.255.255.0
R4(config-if)#
no shutdown
R4(config)#
lo1
R4(config-if)#
ip address 10.6.1.1 255.255.255.255
R4(config)#
lo2
R4(config-if)#
ip address 10.6.2.1 255.255.255.255
R4(config)#
lo3
R4(config-if)#
ip address 10.6.3.1 255.255.255.255
Config Hostname, VRF dan
IP address di R-ISP-PE2
Router(config)#
hostname R-ISP-PE2
R-ISP-PE2(config)#
ip vrf PT.A
R-ISP-PE2(config-vrf)#
rd 10.11.12.1:1
R-ISP-PE2(config)#
ip vrf PT.B
R-ISP-PE2(config-vrf)#
rd 10.11.12.1:2
R-ISP-PE2(config)#
int e0/1
R-ISP-PE2(config-if)#
ip vrf forwarding PT.A
R-ISP-PE2(config-if)#
ip address 10.11.12.1 255.255.255.0
R-ISP-PE2(config-if)#
no shutdown
R-ISP-PE2(config)#
int e0/2
R-ISP-PE2(config-if)#
ip vrf forwarding PT.B
R-ISP-PE(config-if)#
ip address 10.11.12.1 255.255.255.0
R-ISP-PE2(config-if)#
no shutdown
Lakukan pengujian ping di
R3, R4, dan R-ISP-PE2
R1#
ping 10.11.12.1
R2#
ping 10.11.12.1
R-ISP-PE2#
ping vrf PT.A 10.11.12.2
R-ISP-PE2#
ping vrf PT.B 10.11.12.2
Config Sub Interface, VRF
dan IP address di R-ISP-PE1 yg mengarah ke R-ISP-PE2
R-ISP-PE1(config)#
int e0/0.1
R-ISP-PE1(config-subif)#
encapsulation dot1q 10
R-ISP-PE1(config-subif)#
ip vrf forwarding PT.A
R-ISP-PE1(config-subif)#
ip address 11.11.11.1 255.255.255.0
R-ISP-PE1(config-subif)#
int e0/0.2
R-ISP-PE1(config-subif)#
encapsulation dot1q 20
R-ISP-PE1(config-subif)#
ip vrf forwarding PT.B
R-ISP-PE1(config-subif)#
ip address 11.11.11.1 255.255.255.0
R-ISP-PE1(config-subif)#
int e0/0
R-ISP-PE1(config-if)#
no shutdown
Config Sub Interface, VRF
dan IP address di R-ISP-PE2 yg mengarah ke R-ISP-PE1
R-ISP-PE2(config)#
int e0/0.1
R-ISP-PE2(config-subif)#
encapsulation dot1q 10
R-ISP-PE2(config-subif)#
ip vrf forwarding PT.A
R-ISP-PE2(config-subif)#
ip address 11.11.11.2 255.255.255.0
R-ISP-PE2(config-subif)#
int e0/0.2
R-ISP-PE2(config-subif)#
encapsulation dot1q 20
R-ISP-PE2(config-subif)#
ip vrf forwarding PT.B
R-ISP-PE2(config-subif)#
ip address 11.11.11.2 255.255.255.0
R-ISP-PE2(config-subif)#
int e0/0
R-ISP-PE2(config-if)#
no shutdown
Config OSPF di R-ISP-PE1
R-ISP-PE1(config)#
router ospf 1 vrf PT.A
R-ISP-PE1(config-router)#
router-id 0.0.1.1
R-ISP-PE1(config-router)#
log-adjacency-changes
R-ISP-PE1(config-router)#
network 0.0.0.0 0.0.0.0 area 0
R-ISP-PE1(config-router)#
router ospf 1 vrf PT.B
R-ISP-PE1(config-router)#
router-id 0.0.1.2
R-ISP-PE1(config-router)#
log-adjacency-changes
R-ISP-PE1(config-router)#
network 0.0.0.0 0.0.0.0 area 0
Config OSPF di R-ISP-PE2
R-ISP-PE2(config)#
router ospf 1 vrf PT.A
R-ISP-PE2(config-router)#
router-id 0.0.2.1
R-ISP-PE2(config-router)#
log-adjacency-changes
R-ISP-PE2(config-router)#
network 0.0.0.0 0.0.0.0 area 0
R-ISP-PE2(config-router)#
router ospf 1 vrf PT.B
R-ISP-PE2(config-router)#
router-id 0.0.2.2
R-ISP-PE2(config-router)#
log-adjacency-changes
R-ISP-PE2(config-router)#
network 0.0.0.0 0.0.0.0 area 0
Config OSPF di R1
R1(config)#
router ospf 1
R1(config-router)#
network 0.0.0.0 0.0.0.0 area 0
Config OSPF di R2
R2(config)#
router ospf 1
R2(config-router)#
network 0.0.0.0 0.0.0.0 area 0
Config OSPF di R3
R3(config)#
router ospf 1
R3(config-router)#
network 0.0.0.0 0.0.0.0 area 0
Config OSPF di R4
R4(config)#
router ospf 1
R4(config-router)#
network 0.0.0.0 0.0.0.0 area 0
Cek Routing dan ping
maouam Maret 21, 2023 Cisco, Network No comments
maouam Maret 19, 2023 Cisco, Network No comments
maouam Juli 27, 2022 Network, Server No comments
config ipsec site to site strongswan
======================
/etc/ipsec.secrets
# This file holds shared secrets or RSA private keys for authentication.
# RSA private key for this host, authenticating it to any other host
# which knows the public part.
publicip-site1 publicip-site2 : PSK "secret"
===============
/etc/ipsec.conf
config setup
charondebug="all"
uniqueids=yes
conn site1-to-site2
type=tunnel
auto=start
keyexchange=ikev2
authby=secret
left=public-ip-site1
leftsubnet=192.168.0.0/29
right=public-ip-site2
rightsubnet=192.168.1.0/29
ike=aes256-sha256-modp1024
esp=aes256
aggressive=no
keyingtries=%forever
ikelifetime=28800s
lifetime=3600s
dpddelay=30s
dpdtimeout=120s
dpdaction=restart
maouam Januari 04, 2020 Cisco, Network No comments
maouam Februari 12, 2018 Cisco, Network No comments