當前位置:首頁 » 雲伺服器 » 伺服器地址通埠不通

伺服器地址通埠不通

發布時間: 2023-03-05 21:33:08

Ⅰ 如何測試 某個埠通不通,如何測試

解決如何測試 某個埠通不通的步驟如下:

1.假設我們要看192.192.193.211這個IP的tcp 22埠是否打開,則運行telnet 192.192.193.211 22來查看,如果出現下列信息,則表示該埠已打開。

linux伺服器的80埠不通,防火牆已經放行,然後怎麼操作

1,關閉IPtables防火牆,關閉selinux
2,查看防火牆等網安設備的規則及日誌,看是否有攔截或過濾。
3,查檢伺服器的系統變數,有可能是由這些變數導致的,嘗試把這些變數刪除或注釋。
如下變數:
默認情況下 sysctl.conf 文件裡面是沒有配置變數的。
vim /etc/sysctl.conf
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.core.netdev_max_backlog = 32768
net.core.somaxconn = 262144
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.netfilter.nf_conntrack_max = 655360
kernel.ctrl-alt-del = 1

Ⅲ 網線連接伺服器但登錄埠登不上

你要檢查一下能不能ping得通,可能是telnet被關了。
首先,先ping一下遠程登陸的伺服器。
ping的通才能用。
如果ping不通,telnet服務就被關閉了,需要開啟服務。
還有情況是在「服務」里,無法找到「telnet」的,可能是電腦的telnet服務還沒有安裝。

Ⅳ 兩台linux伺服器埠不通怎麼解決

准備環境

啟動一個web伺服器,提供埠.

?

1
2

[wyq@localhost ~]$ python -m SimpleHTTPServer 8080
Serving HTTP on 0.0.0.0 port 8080 ...

用其它web伺服器提供埠也一樣,由於python比較方便,這里就用它

1、使用telnet判斷

telnet是windows標准服務,可以直接用;如果是linux機器,需要安裝telnet.

用法: telnet ip port

1)先用telnet連接不存在的埠

?

1
2
3

[root@localhost ~]# telnet 10.0.250.3 80
Trying 10.0.250.3...
telnet: connect to address 10.0.250.3: Connection refused #直接提示連接被拒絕

2)再連接存在的埠

?

1
2
3
4
5
6
7
8

[root@localhost ~]# telnet localhost 22
Trying ::1...
Connected to localhost. #看到Connected就連接成功了
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3
a
Protocol mismatch.
Connection closed by foreign host.

2、使用ssh判斷

ssh是linux的標准配置並且最常用,可以用來判斷埠嗎?

用法: ssh -v -p port username@ip

-v 調試模式(會列印日誌).

-p 指定埠

username可以隨意

1)連接不存在埠

?

1
2
3
4
5
6
7
8
9

[root@localhost ~]# ssh 10.0.250.3 -p 80
ssh: connect to host 10.0.250.3 port 80: Connection refused
[root@localhost ~]# ssh 10.0.250.3 -p 80 -v
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 10.0.250.3 [10.0.250.3] port 80.
debug1: connect to address 10.0.250.3 port 80: Connection refused
ssh: connect to host 10.0.250.3 port 80: Connection refused

2)連接存在的埠

?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

[root@localhost ~]# ssh ... -p
a
^]
^C
[root@localhost ~]# ssh ... -p -v
OpenSSH_.p, OpenSSL ..e-fips Feb
debug: Reading configuration data /etc/ssh/ssh_config
debug: Applying options for *
debug: Connecting to ... [...] port .
debug: Connection established.
debug: permanently_set_uid: /
debug: identity file /root/.ssh/identity type -
debug: identity file /root/.ssh/identity-cert type -
debug: identity file /root/.ssh/id_rsa type -
debug: identity file /root/.ssh/id_rsa-cert type -
debug: identity file /root/.ssh/id_dsa type -
debug: identity file /root/.ssh/id_dsa-cert type -
a
^C

不用-v選項也可以咯

3、使用wget判斷

wget是linux下的下載工具,需要先安裝.

用法: wget ip:port

1)連接不存在的埠

?

1
2
3

[root@localhost ~]# wget ...:
---- ::-- http://.../
Connecting to ...:... failed: Connection refused.

2)連接存在的埠

?

1
2
3
4

[root@localhost ~]# wget ...:
---- ::-- http://...:/
Connecting to ...:... connected.
HTTP request sent, awaiting response...

4、使用埠掃描工具

?

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

[root@localhost ~]# nmap ... -p
Starting Nmap . ( http://nmap.org ) at -- : CST
Nmap scan report for ...
Host is up (.s latency).
PORT STATE SERVICE
/tcp closed http
MAC Address: B:A::CF:FD:D (Unknown)
Nmap done: IP address ( host up) scanned in . seconds
[root@localhost ~]# nmap ... -p
Starting Nmap . ( http://nmap.org ) at -- : CST
Nmap scan report for ...
Host is up (.s latency).
PORT STATE SERVICE
/tcp open http-proxy
MAC Address: B:A::CF:FD:D (Unknown)
Nmap done: IP address ( host up) scanned in . seconds
[root@localhost ~]# nmap ...
Starting Nmap . ( http://nmap.org ) at -- : CST
Nmap scan report for ...
Host is up (.s latency).
Not shown: closed ports
PORT STATE SERVICE
/tcp open ssh
/tcp open rpcbind
/tcp open http-proxy
/tcp open unknown
MAC Address: B:A::CF:FD:D (Unknown)
Nmap done: IP address ( host up) scanned in . seconds

總結

提供埠服務,則使用了tcp協議,上面是以web伺服器為例。如果伺服器是更簡單的tcp伺服器,三個工具同樣適用.

三個工具的共同點是:1.以tcp協議為基礎;2.能訪問指定埠. 遵循這兩點可以找到很多工具.
一般在windows下使用telnet比較方便,linux下個人就比較喜歡用wget.

熱點內容
什麼配置的車標好 發布:2025-05-17 21:41:20 瀏覽:203
linux支持線程 發布:2025-05-17 21:26:14 瀏覽:184
元神隊伍配置都由什麼組成 發布:2025-05-17 21:20:18 瀏覽:477
閑魚和安卓哪個賺錢 發布:2025-05-17 21:15:56 瀏覽:584
c語言一個c源程序 發布:2025-05-17 21:11:44 瀏覽:315
如何加密手機的文件 發布:2025-05-17 21:11:43 瀏覽:917
ios開發文件上傳 發布:2025-05-17 21:10:40 瀏覽:984
g92編程 發布:2025-05-17 21:00:31 瀏覽:171
匯編語言第三版腳本之家 發布:2025-05-17 20:54:26 瀏覽:400
資源配置最佳狀態叫什麼 發布:2025-05-17 20:48:58 瀏覽:86