-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetwork_Management.alias
More file actions
executable file
·150 lines (137 loc) · 8.85 KB
/
Network_Management.alias
File metadata and controls
executable file
·150 lines (137 loc) · 8.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# ==============================================================================
# Network Management & Tools - Enhanced Collection
# ==============================================================================
#
# Comprehensive network management aliases for monitoring, troubleshooting, and administration
# Includes network information, service management, WiFi, monitoring, security, and diagnostics
#
# Sections:
# - Basic Network Information
# - Network Service Management
# - WiFi Management
# - Network Monitoring
# - Network Performance & Debugging
# - Port Management
# - Network Security
# - Network Services
# - VPN Management
# - Network Troubleshooting
# - Network Statistics & Logging
#
# ==============================================================================
# ==============================================================================
# BASIC NETWORK INFORMATION
# ==============================================================================
### Basic Network Information
alias myip='curl ifconfig.me' # Show public IP
alias localip='ip addr show' # Show local IP addresses
alias ips='ip -c a' # Show all IPs in color
alias dns-info='cat /etc/resolv.conf' # Show DNS info
alias gateway='ip route | grep default' # Show default gateway
alias mac='ip link show' # Show MAC addresses
alias ipv6='ip -6 addr show' # Show IPv6 addresses
alias hosts='cat /etc/hosts' # Show hosts file
# ==============================================================================
# NETWORK SERVICE MANAGEMENT
# ==============================================================================
alias net-restart='sudo systemctl restart NetworkManager' # Restart networking
alias dns='sudo systemctl restart systemd-resolved' # Restart DNS
alias dns-flush='sudo systemd-resolve --flush-caches' # Flush DNS cache
alias vpn-restart='sudo systemctl restart openvpn' # Restart OpenVPN
alias net-stop='sudo systemctl stop NetworkManager' # Stop networking
alias net-start='sudo systemctl start NetworkManager' # Start networking
alias cloudflare='sudo systemctl restart cloudflared' # Restart Cloudflare
# ==============================================================================
# WIFI MANAGEMENT
# ==============================================================================
alias wifi-list='nmcli device wifi list' # List WiFi networks
alias wifi-scan='sudo iwlist wlan0 scan | grep ESSID' # Scan WiFi networks
alias wifi-connect='nmcli device wifi connect' # Connect to WiFi
alias wifi-on='nmcli radio wifi on' # Enable WiFi
alias wifi-off='nmcli radio wifi off' # Disable WiFi
alias wifi-status='nmcli radio wifi' # WiFi status
alias wifi-show='nmcli device wifi show' # Show WiFi details
# ==============================================================================
# NETWORK MONITORING
# ==============================================================================
alias net-stat='netstat -tulpn' # Show all active connections
alias net-established='netstat -nat | grep ESTABLISHED' # Show established connections
alias net-listening='netstat -nat | grep LISTEN' # Show listening ports
alias net-udp='netstat -nu' # Show UDP connections
alias net-tcp='netstat -nt' # Show TCP connections
alias net-routes='netstat -rn' # Show routing table
# ==============================================================================
# NETWORK PERFORMANCE & DEBUGGING
# ==============================================================================
alias ping='ping -c 5' # Ping with 5 packets
alias fastping='ping -c 100 -s.2' # Quick network test
alias ping-google='ping -c 5 google.com' # Check internet connectivity
alias traceroute='traceroute -I' # ICMP traceroute
alias mtr-report='mtr --report' # MTR network diagnostic
alias bandwidth='speedtest-cli' # Internet speed test
alias bandwidth-simple='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -' # Simple speed test
alias net-load='iftop -i any' # Network load monitor
alias net-top='nethogs' # Process network traffic
# ==============================================================================
# PORT MANAGEMENT
# ==============================================================================
alias ports='sudo lsof -i -P -n' # Show all open ports
alias ports-listening='sudo lsof -i -P -n | grep LISTEN' # Show listening ports
alias port-scan='sudo nmap -sT -O localhost' # Scan local ports
alias port-open='sudo lsof -i' # Show open ports
alias tcp-open='sudo lsof -iTCP -sTCP:LISTEN -P -n' # Show open TCP ports
alias udp-open='sudo lsof -iUDP -P -n' # Show open UDP ports
# ==============================================================================
# NETWORK SECURITY
# ==============================================================================
alias firewall-status='sudo ufw status verbose' # Show firewall status
alias firewall-rules='sudo iptables -L -n -v' # Show firewall rules
alias firewall-open='sudo ufw allow' # Open port in firewall
alias firewall-close='sudo ufw deny' # Close port in firewall
alias net-scan='sudo nmap -sP 192.168.1.0/24' # Scan network devices
alias ssl-check='openssl s_client -connect' # Check SSL connection
alias watch-tcp='sudo tcpdump -i any' # Monitor TCP traffic
alias watch-http='sudo tcpdump -i any port 80' # Monitor HTTP traffic
# ==============================================================================
# NETWORK SERVICES
# ==============================================================================
alias dns-dig='dig +short' # DNS lookup
alias dns-trace='dig +trace' # Trace DNS path
alias dns-ptr='dig -x' # Reverse DNS lookup
alias whois-lookup='whois' # WHOIS lookup
alias http-serve='python3 -m http.server 8000' # Quick HTTP server
alias ftp-serve='python3 -m pyftpdlib' # Quick FTP server
alias ssl-cert='openssl x509 -text -noout -in' # Show SSL certificate
# ==============================================================================
# VPN MANAGEMENT
# ==============================================================================
alias vpn-status='nmcli connection show --active | grep vpn' # VPN status
alias vpn-list='nmcli connection | grep vpn' # List VPN connections
alias vpn-up='sudo openvpn --config' # Start OpenVPN
alias vpn-kill='sudo killall openvpn' # Kill VPN connections
alias vpn-check='curl ipinfo.io' # Check VPN IP
alias vpn-routes='ip route show' # Show VPN routes
# ==============================================================================
# NETWORK TROUBLESHOOTING
# ==============================================================================
alias flush-dns='sudo systemd-resolve --flush-caches' # Flush DNS cache
alias flush-iptables='sudo iptables -F' # Flush all iptables rules
alias release-ip='sudo dhclient -r' # Release DHCP IP
alias renew-ip='sudo dhclient' # Renew DHCP IP
alias clear-hosts='sudo truncate -s 0 /etc/hosts' # Clear hosts file
alias net-debug='sudo tcpdump -i any -n' # Debug network traffic
alias check-ports='nc -zv' # Check specific port
alias net-restart-full='sudo systemctl restart NetworkManager && sudo systemctl restart systemd-resolved' # Full network restart
# ==============================================================================
# NETWORK STATISTICS & LOGGING
# ==============================================================================
alias net-stats='vnstat' # Show network statistics
alias net-today='vnstat -i any -h' # Today's network usage
alias net-month='vnstat -i any -m' # Monthly network usage
alias net-top-talkers='sudo iftop -n' # Show network heavy users
alias net-connections='ss -s' # Connection statistics
alias net-errors='netstat -i' # Interface errors
alias watch-connections='watch -n1 netstat -tpanl' # Monitor connections
# ==============================================================================
# END OF NETWORK MANAGEMENT ALIASES
# ==============================================================================