list open ports cisco router
Hầu hết các bạn đều quen thuộc với lệnh netstat trên hệ thống Windows và Linux. Nó được sử dụng để liệt kê các port TCP và UDP cũng như các kết nối TCP hiện tại. Cisco cung cấp một câu lệnh tương tự: show control-plane host open-ports. Kết quả xuất ra của nó cũng tương tự lệnh netstat -n:
Code:
Router# show control-plane host open-ports
Active internet connections (servers and established)
Prot Local Address Foreign Address Service State
tcp *:23 *:0 Telnet LISTEN
tcp *:80 *:0 HTTP CORE LISTEN
udp *:67 *:0 DHCPD Receive LISTEN
udp *:2887 *:0 DDP LISTEN
Bạn có thể thấy danh sách các port đang được liệt kê đó là TCP/23 (telnet), TCP/80 (HTTP), UDP/67 (DHCP daemon), và UDP/2887 (WLCCP). Giống như netstat, kết nối TCP mới được thiết lập sẽ được liệt kê với State là "established." Dưới đây là kết quả hiển thị khi người quản trị kết nối bằng giao diện web tới router để cấu
Code:
Router# show control-plane host open-ports
Active internet connections (servers and established)
Prot Local Address Foreign Address Service State
tcp *:23 *:0 Telnet LISTEN
tcp *:80 *:0 HTTP CORE LISTEN
[COLOR="#FF0000"] tcp *:80 10.0.0.8:53743 HTTP CORE ESTABLIS[/COLOR]
udp *:67 *:0 DHCPD Receive LISTEN
udp *:2887 *:0 DDP LISTEN
Tắt chức năng cấu hình bằng giao diện web sẽ xóa TCP/80 khỏi danh sách open port
Code:
Router(config)# no ip http server
Router(config)# ^Z
Router# show control-plane host open-ports
Active internet connections (servers and established)
Prot Local Address Foreign Address Service State
tcp *:23 *:0 Telnet LISTEN
udp *:67 *:0 DHCPD Receive LISTEN
udp *:2887 *:0 DDP LISTEN
Tương tự, khi thực hiện giao thức hướng kết nối thì trên control plane sẽ bổ xung thêm các port vào danh sách. Ví dụ, BGP mở mở port TCP/179 và khởi tạo một kết nối với mỗi neighbor
Code:
Router(config)# router bgp 100
Router(config-router)# neighbor 10.0.0.2 remote-as 100
Router(config)# ^Z
Router# show control-plane host open-ports
Active internet connections (servers and established)
Prot Local Address Foreign Address Service State
tcp *:23 *:0 Telnet LISTEN
[COLOR="#FF0000"] tcp *:179 *:0 BGP LISTEN
tcp *:179 10.0.0.2:15158 BGP ESTABLIS[/COLOR]
udp *:67 *:0 DHCPD Receive LISTEN
udp *:2887 *:0 DDP LISTEN
Một lệnh tương tự show ip sockets trên các phiên bản IOS cũ, nhưng nó không giống với danh sách TCP socket. Tuy nhiên nó, chỉ liệt kê các giao thức khác UDP.
Code:
Router# show ip sockets
Proto Remote Port Local Port In Out Stat TTY OutputIF
17 --listen-- --any-- 2887 0 0 11 0
17 0.0.0.0 0 10.0.0.1 67 0 0 2211 0
[COLOR="#FF0000"]88 --listen-- --any-- 100 0 0 0 0[/COLOR]
Last edited by a moderator: