Discover connected neighbors using CDP
show cdp neighborswebsite·Indexed 31 days ago
https://docs.garz.devA collection of code snippets, technical guides, and solutions covering Cisco device configuration (VLANs, OSPF, IPSec, NAT, ACLs), Linux administration (Fedora, Arch, Nginx, Certbot), Windows system modifications, and various developer tools like PlatformIO.
show cdp neighborsTo establish an IPSec VPN between two Cisco routers, you must configure a matching ISAKMP policy, a shared secret key, a transform set for encryption, and a crypto map bound to the external interface.
Key Requirements:
crypto map must be applied to the outside interface (e.g., gi0/0/0).Critical Caveats:
! --- Peer 1 Configuration ---
! Address: 223.130.23.2 | Local Net: 10.0.0.0/16
crypto isakmp policy 10
encryption aes 256
authentication pre-share
group 2
crypto isakmp key 1mysecurepassword! address 223.130.23.6
crypto ipsec transform-set my-vpn-set esp-aes 256 esp-sha-hmac
ip access-list extended my-vpn-acl
permit ip 10.0.0.0 255.255.0.0 10.1.0.0 255.255.255.0
crypto map my-vpn-map 10 ipsec-isakmp
set peer 223.130.23.6
set transform-set my-vpn-set
match address my-vpn-acl
interface gi0/0/0
crypto map my-vpn-map
ip route 10.1.0.0 255.255.0.0 223.130.23.6
! --- Peer 2 Configuration ---
! Address: 223.130.23.6 | Local Net: 10.1.0.0/16
crypto isakmp policy 10
encryption aes 256
authentication pre-share
group 2
crypto isakmp key 1mysecurepassword! address 223.130.23.2
crypto ipsec transform-set my-vpn-set esp-aes 256 esp-sha-hmac
ip access-list extended my-vpn-acl
permit ip 10.1.0.0 255.255.0.0 10.0.0.0 255.255.255.0
crypto map my-vpn-map 10 ipsec-isakmp
set peer 223.130.23.2
set transform-set my-vpn-set
match address my-vpn-acl
interface gi0/0/0
crypto map my-vpn-map
ip route 10.0.0.0 255.255.0.0 223.130.23.2curl -fsSL https://get.docker.com -o install-docker.sh
sh install-docker.sh
# Start and enable Docker service
sudo systemctl enable --now docker
# Add current user to docker group to avoid using sudo for every command
sudo usermod -aG docker $USERsudo su).# Show current swap spaces
swapon --show
# Allocate a 1G file
dd if=/dev/zero of=/var/swapfile bs=1M count=1K
# Set correct permissions and format as swap
chmod 600 /var/swapfile
mkswap /var/swapfile
# Activate the swap immediately
swapon /var/swapfile
# Make the swap persistent across reboots
echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstabHot Standby Router Protocol (HSRP) provides a virtual IP address that serves as a default gateway for clients, ensuring redundancy if the primary router fails.
Key configuration parameters include:
standby [group] ip [address]: Sets the virtual gateway IP.standby [group] priority [value]: Determines which router becomes active (higher is preferred; default is 100).standby [group] preempt: Allows a higher-priority router to take over the active role from a lower-priority router.standby [group] track [interface]: Lowers the priority (typically by 10) if a specific interface goes down, triggering a failover.! Primary Router (sw-1)
int vlan1
ip address 10.0.0.2 255.255.0.0
standby 1 preempt
standby 1 priority 105
standby 1 ip 10.0.0.1
standby 1 track gi1/1/1
! Standby Router (sw-2)
int vlan1
ip address 10.0.0.3 255.255.0.0
standby 1 preempt
standby 1 ip 10.0.0.1location block configuration. This setup ensures that the Host header is preserved and the connection is upgraded for WebSocket traffic.location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}Cisco devices use different prompt symbols to indicate the current privilege level and configuration mode:
>: Unprivileged exec mode#: Privileged exec mode (enable)configure terminal command.Use the ? command to list available configuration options or subcommands (e.g., interface ?).
enable
configure terminal
! List configuration options
?
! List subcommands of an option
interface ?--cert-name flag. When prompted by Certbot, press e to expand the certificate or u to update it.certbot --nginx --cert-name $name -d example.com,www.example.com,newsubdomain.example.cominterface range command to apply settings to multiple ports simultaneously.interface gi0/0/0
description No description here
ip address 192.168.0.254 255.255.255.0
ipv6 address 2001:db8:1234:aabb::1/64
ipv6 address fe80::1 link-local
no shutdown
! Using a range to configure multiple interfaces
interface range gi0/0/0 - 1 , gi0/1/0redistribute command to share routes learned from one routing protocol with another. This is essential when bridging different routing domains.router eigrp 100
redistribute ospf 1
router ospf 1
redistribute eigrp 100 subnetsinterface loopback 0
ip address 2.2.2.2 255.255.255.255
no shutdownmysql_secure_installation script to secure the server. Recommended settings include removing anonymous users, removing the test database, and reloading privilege tables.mysql_secure_installation