Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- stp
- 헤더
- GLBP
- 명령어
- eigrp
- 스위치
- tunneling
- Inter VLAN
- Etherchannel
- Chrony
- 라우터
- ripng
- OSPF
- ospfv3
- ipv6
- Vlan
- NAT
- eigrpv2
- DHCP
- OSI 7 layer
- ACL
- crontab
- rip
- Redistribute
- CKA
- 장비
- vrrp
Archives
- Today
- Total
Net Eng
check_network.sh 본문
#!/bin/bash
# 네트워크 점검 스크립트
# 1) ping 192.168.10.20
# 2) ping 8.8.8.8
# 3) ping www.google.com
. /root/bin/functions.sh
IP1=192.168.10.2
IP2=8.8.8.8
IP3=www.google.com
# 네트워크 점검 스크립트
# (1) ping 192.168.10.20
print_info "(1) # ping $IP1"
ping -c 1 -W 1 $IP1 >/dev/null 2>&1
if [ $? -eq 0 ]; then
print_good "[ OK ] Local Network Connection"
else
print_error "[ FAIL ] Local Network Connection"
cat << EOF
(ㄱ) # ip addr (# ifconfig)
(ㄴ) VMware > Edit > Virtual Network Editor > VMnet0
(ㄷ) VMware > Edit > Virtual Network Editor > VMnet8
* Network number
* Gateway IP address
(ㄹ) services.msc > VMware* 서비스 동작
EOF
fi
# (2) ping 8.8.8.8
print_info "(2) # ping $IP2"
ping -c 1 -W 1 $IP2 >/dev/null 2>&1
if [ $? -eq 0 ]; then
print_good "[ OK ] External Network Connection"
else
print_error "[ FAIL ] External Network Connection"
cat << EOF
(ㄱ) # ip route (# netstat -nr, #route -n)
EOF
fi
# 3) ping www.google.com
print_info "(3) # dig +noanswer +timeout $IP3"
# ping -c 1 -W 1 $IP3 >/dev/null 2>&1
dig +noanswer +timeout=1 $IP3 >/dev/null 2>&1
if [ $? -eq 0 ]; then
print_good "[ OK ] DNS Client Configuration"
else
print_error "[ FAIL ] DNS Client Configuration"
cat << EOF
(ㄱ) # cat /etc/resolve.conf
EOF
fi
'Language > Shell Script' 카테고리의 다른 글
ipconfig.sh (0) | 2024.06.08 |
---|---|
calculator.sh (0) | 2024.06.08 |
check_service.sh (0) | 2024.06.08 |
auto_telnet_ftp.sh (0) | 2024.06.08 |
check_file.sh (0) | 2024.06.08 |