我在编写上一个Shell脚本时,有网友问我:怎么把脚本1723端口改成其它的,在本地win还能正常连接?1723端口容易被封

计算机网络技术中,端口(Port)指逻辑意义上用于区分服务的端口,如TCP/IP协议中的服务端口,端口号的范围从0到65535,比如用于浏览网页服务的80端口,用于FTP服务的21端口等,用于PPTP VPN连接的端口号是1723。为了对端口进行区分,将每个端口进行了编号。

我在这里用一个例子说明,例如有一台服务器计算机名:Fserver,IP地址是:192.168.1.200,这台服务器功能有文件服务器、Mysql数据库、Web服务器、PPTP VPN服务……,那么我们访问这台服务器的不同功能将是通过端口(Port)来区分的。

例如:

192.168.1.200:21 FTP服务端口(默认);

192.168.1.200:80 WEB服务端口(默认);

192.168.1.200:3306 Mysql数据库服务端口(默认);

192.168.1.200:1723 PPTP VPN服务端口(默认);

用通俗易懂的解释:你可以把IP理解成一幢大楼,而每个房间号可理解为端口(Port),从0到65535,每个房间住不同的居民,提供各种不同的服务……。

【端口默认定义说明】

针对该网友的提问,我查了查资料,在CentOS7操作系统中,有一文件定义了0~65536端口的默认定义,希望能对大家有所帮助!

操作方式:

vim /etc/services

tcp和udp区别和分别适用场景(IT运维TCPIP)(1)

vim /etc/services查看或修改端口截图

【/etc/services文件部分内容】

由于文章长度有限,只能放出部分……

ill 1611/tcp # Inter Library Loan ill 1611/udp # Inter Library Loan netbill-trans 1612/tcp # NetBill Transaction Server netbill-trans 1612/udp # NetBill Transaction Server netbill-keyrep 1613/tcp # NetBill Key Repository netbill-keyrep 1613/udp # NetBill Key Repository netbill-cred 1614/tcp # NetBill Credential Server netbill-cred 1614/udp # NetBill Credential Server netbill-auth 1615/tcp # NetBill Authorization Server netbill-auth 1615/udp # NetBill Authorization Server netbill-prod 1616/tcp # NetBill Product Server netbill-prod 1616/udp # NetBill Product Server nimrod-agent 1617/tcp # Nimrod Inter-Agent Communication nimrod-agent 1617/udp # Nimrod Inter-Agent Communication skytelnet 1618/tcp # skytelnet skytelnet 1618/udp # skytelnet xs-openstorage 1619/tcp # xs-openstorage xs-openstorage 1619/udp # xs-openstorage faxportwinport 1620/tcp # faxportwinport faxportwinport 1620/udp # faxportwinport softdataphone 1621/tcp # softdataphone softdataphone 1621/udp # softdataphone ontime 1622/tcp # ontime ontime 1622/udp # ontime jaleosnd 1623/tcp # jaleosnd jaleosnd 1623/udp # jaleosnd udp-sr-port 1624/tcp # udp-sr-port udp-sr-port 1624/udp # udp-sr-port svs-omagent 1625/tcp # svs-omagent svs-omagent 1625/udp # svs-omagent shockwave 1626/tcp # Shockwave shockwave 1626/udp # Shockwave t128-gateway 1627/tcp # T.128 Gateway t128-gateway 1627/udp # T.128 Gateway lontalk-norm 1628/tcp # LonTalk normal lontalk-norm 1628/udp # LonTalk normal lontalk-urgnt 1629/tcp # LonTalk urgent lontalk-urgnt 1629/udp # LonTalk urgent oraclenet8cman 1630/tcp # Oracle Net8 Cman oraclenet8cman 1630/udp # Oracle Net8 Cman visitview 1631/tcp # Visit view visitview 1631/udp # Visit view pammratc 1632/tcp # PAMMRATC pammratc 1632/udp # PAMMRATC pammrpc 1633/tcp # PAMMRPC pammrpc 1633/udp # PAMMRPC loaprobe 1634/tcp # Log On America Probe loaprobe 1634/udp # Log On America Probe edb-server1 1635/tcp # EDB Server 1 edb-server1 1635/udp # EDB Server 1 isdc 1636/tcp # ISP shared public data control isdc 1636/udp # ISP shared public data control islc 1637/tcp # ISP shared local data control islc 1637/udp # ISP shared local data control ismc 1638/tcp # ISP shared management control ismc 1638/udp # ISP shared management control cert-initiator 1639/tcp # cert-initiator cert-initiator 1639/udp # cert-initiator cert-responder 1640/tcp # cert-responder cert-responder 1640/udp # cert-responder invision 1641/tcp # InVision invision 1641/udp # InVision isis-am 1642/tcp # isis-am isis-am 1642/udp # isis-am isis-ambc 1643/tcp # isis-ambc isis-ambc 1643/udp # isis-ambc saiseh 1644/tcp # Satellite-data Acquisition System 4 saiseh 1644/udp # Satellite-data Acquisition System 4 rsap 1647/tcp # rsap rsap 1647/udp # rsap concurrent-lm 1648/tcp # concurrent-lm concurrent-lm 1648/udp # concurrent-lm nkd 1650/tcp # nkdn nkd 1650/udp # nkd shiva_confsrvr 1651/tcp shiva-confsrvr # shiva_confsrvr shiva_confsrvr 1651/udp shiva-confsrvr # shiva_confsrvr xnmp 1652/tcp # xnmp xnmp 1652/udp # xnmp alphatech-lm 1653/tcp # alphatech-lm alphatech-lm 1653/udp # alphatech-lm stargatealerts 1654/tcp # stargatealerts stargatealerts 1654/udp # stargatealerts dec-mbadmin 1655/tcp # dec-mbadmin dec-mbadmin 1655/udp # dec-mbadmin dec-mbadmin-h 1656/tcp # dec-mbadmin-h dec-mbadmin-h 1656/udp # dec-mbadmin-h fujitsu-mmpdc 1657/tcp # fujitsu-mmpdc fujitsu-mmpdc 1657/udp # fujitsu-mmpdc sixnetudr 1658/tcp # sixnetudr sixnetudr 1658/udp # sixnetudr sg-lm 1659/tcp # Silicon Grail License Manager sg-lm 1659/udp # Silicon Grail License Manager skip-mc-gikreq 1660/tcp # skip-mc-gikreq skip-mc-gikreq 1660/udp # skip-mc-gikreq netview-aix-1 1661/tcp # netview-aix-1 netview-aix-1 1661/udp # netview-aix-1 netview-aix-2 1662/tcp # netview-aix-2 netview-aix-2 1662/udp # netview-aix-2 netview-aix-3 1663/tcp # netview-aix-3 netview-aix-3 1663/udp # netview-aix-3 netview-aix-4 1664/tcp # netview-aix-4 netview-aix-4 1664/udp # netview-aix-4 netview-aix-5 1665/tcp # netview-aix-5 netview-aix-5 1665/udp # netview-aix-5 netview-aix-6 1666/tcp # netview-aix-6 netview-aix-6 1666/udp # netview-aix-6 netview-aix-7 1667/tcp # netview-aix-7 netview-aix-7 1667/udp # netview-aix-7 netview-aix-8 1668/tcp # netview-aix-8 netview-aix-8 1668/udp # netview-aix-8 netview-aix-9 1669/tcp # netview-aix-9 netview-aix-9 1669/udp # netview-aix-9 netview-aix-10 1670/tcp # netview-aix-10 netview-aix-10 1670/udp # netview-aix-10 netview-aix-11 1671/tcp # netview-aix-11 netview-aix-11 1671/udp # netview-aix-11 netview-aix-12 1672/tcp # netview-aix-12 netview-aix-12 1672/udp # netview-aix-12 proshare-mc-1 1673/tcp # Intel Proshare Multicast proshare-mc-1 1673/udp # Intel Proshare Multicast proshare-mc-2 1674/tcp # Intel Proshare Multicast proshare-mc-2 1674/udp # Intel Proshare Multicast pdp 1675/tcp # Pacific Data Products pdp 1675/udp # Pacific Data Products netcomm1 1676/tcp # netcomm1 netcomm2 1676/udp # netcomm2 groupwise 1677/tcp # groupwise groupwise 1677/udp # groupwise prolink 1678/tcp # prolink prolink 1678/udp # prolink darcorp-lm 1679/tcp # darcorp-lm darcorp-lm 1679/udp # darcorp-lm microcom-sbp 1680/tcp # microcom-sbp microcom-sbp 1680/udp # microcom-sbp sd-elmd 1681/tcp # sd-elmd sd-elmd 1681/udp # sd-elmd lanyon-lantern 1682/tcp # lanyon-lantern lanyon-lantern 1682/udp # lanyon-lantern ncpm-hip 1683/tcp # ncpm-hip ncpm-hip 1683/udp # ncpm-hip snaresecure 1684/tcp # SnareSecure snaresecure 1684/udp # SnareSecure n2nremote 1685/tcp # n2nremote n2nremote 1685/udp # n2nremote cvmon 1686/tcp # cvmon cvmon 1686/udp # cvmon nsjtp-ctrl 1687/tcp # nsjtp-ctrl nsjtp-ctrl 1687/udp # nsjtp-ctrl nsjtp-data 1688/tcp # nsjtp-data nsjtp-data 1688/udp # nsjtp-data firefox 1689/tcp # firefox firefox 1689/udp # firefox ng-umds 1690/tcp # ng-umds ng-umds 1690/udp # ng-umds empire-empuma 1691/tcp # empire-empuma empire-empuma 1691/udp # empire-empuma sstsys-lm 1692/tcp # sstsys-lm sstsys-lm 1692/udp # sstsys-lm rrirtr 1693/tcp # rrirtr rrirtr 1693/udp # rrirtr rrimwm 1694/tcp # rrimwm rrimwm 1694/udp # rrimwm rrilwm 1695/tcp # rrilwm rrilwm 1695/udp # rrilwm rrifmm 1696/tcp # rrifmm rrifmm 1696/udp # rrifmm rrisat 1697/tcp # rrisat rrisat 1697/udp # rrisat rsvp-encap-1 1698/tcp # RSVP-ENCAPSULATION-1 rsvp-encap-1 1698/udp # RSVP-ENCAPSULATION-1 rsvp-encap-2 1699/tcp # RSVP-ENCAPSULATION-2 rsvp-encap-2 1699/udp # RSVP-ENCAPSULATION-2 mps-raft 1700/tcp # mps-raft mps-raft 1700/udp # mps-raft deskshare 1702/tcp # deskshare deskshare 1702/udp # deskshare hb-engine 1703/tcp # hb-engine hb-engine 1703/udp # hb-engine bcs-broker 1704/tcp # bcs-broker bcs-broker 1704/udp # bcs-broker slingshot 1705/tcp # slingshot slingshot 1705/udp # slingshot jetform 1706/tcp # jetform jetform 1706/udp # jetform vdmplay 1707/tcp # vdmplay vdmplay 1707/udp # vdmplay gat-lmd 1708/tcp # gat-lmd gat-lmd 1708/udp # gat-lmd centra 1709/tcp # centra centra 1709/udp # centra impera 1710/tcp # impera impera 1710/udp # impera pptconference 1711/tcp # pptconference pptconference 1711/udp # pptconference registrar 1712/tcp # resource monitoring service registrar 1712/udp # resource monitoring service conferencetalk 1713/tcp # ConferenceTalk conferencetalk 1713/udp # ConferenceTalk sesi-lm 1714/tcp # sesi-lm sesi-lm 1714/udp # sesi-lm houdini-lm 1715/tcp # houdini-lm houdini-lm 1715/udp # houdini-lm xmsg 1716/tcp # xmsg xmsg 1716/udp # xmsg fj-hdnet 1717/tcp # fj-hdnet fj-hdnet 1717/udp # fj-hdnet caicci 1721/tcp # caicci caicci 1721/udp # caicci hks-lm 1722/tcp # HKS License Manager hks-lm 1722/udp # HKS License Manager pptp 1723/tcp # pptp pptp 1723/udp # pptp csbphonemaster 1724/tcp # csbphonemaster csbphonemaster 1724/udp # csbphonemaster iden-ralp 1725/tcp # iden-ralp iden-ralp 1725/udp # iden-ralp iberiagames 1726/tcp # IBERIAGAMES iberiagames 1726/udp # IBERIAGAMES winddx 1727/tcp # winddx winddx 1727/udp # winddx telindus 1728/tcp # TELINDUS telindus 1728/udp # TELINDUS citynl 1729/tcp # CityNL License Management citynl 1729/udp # CityNL License Management roketz 1730/tcp # roketz roketz 1730/udp # roketz msiccp 1731/tcp # MSICCP msiccp 1731/udp # MSICCP proxim 1732/tcp # proxim proxim 1732/udp # proxim siipat 1733/tcp # SIMS - SIIPAT Protocol for Alarm Transmission siipat 1733/udp # SIMS - SIIPAT Protocol for Alarm Transmission cambertx-lm 1734/tcp # Camber Corporation License Management cambertx-lm 1734/udp # Camber Corporation License Management privatechat 1735/tcp # PrivateChat privatechat 1735/udp # PrivateChat street-stream 1736/tcp # street-stream street-stream 1736/udp # street-stream ultimad 1737/tcp # ultimad ultimad 1737/udp # ultimad gamegen1 1738/tcp # GameGen1 gamegen1 1738/udp # GameGen1 webaccess 1739/tcp # webaccess webaccess 1739/udp # webaccess encore 1740/tcp # encore encore 1740/udp # encore cisco-net-mgmt 1741/tcp # cisco-net-mgmt cisco-net-mgmt 1741/udp # cisco-net-mgmt 3Com-nsd 1742/tcp # 3Com-nsd 3Com-nsd 1742/udp # 3Com-nsd cinegrfx-lm 1743/tcp # Cinema Graphics License Manager cinegrfx-lm 1743/udp # Cinema Graphics License Manager ncpm-ft 1744/tcp # ncpm-ft ncpm-ft 1744/udp # ncpm-ft remote-winsock 1745/tcp # remote-winsock remote-winsock 1745/udp # remote-winsock ftrapid-1 1746/tcp # ftrapid-1 ftrapid-1 1746/udp # ftrapid-1 ftrapid-2 1747/tcp # ftrapid-2 ftrapid-2 1747/udp # ftrapid-2 oracle-em1 1748/tcp # oracle-em1 oracle-em1 1748/udp # oracle-em1 aspen-services 1749/tcp # aspen-services aspen-services 1749/udp # aspen-services sslp 1750/tcp # Simple Socket Library's PortMaster sslp 1750/udp # Simple Socket Library's PortMaster swiftnet 1751/tcp # SwiftNet swiftnet 1751/udp # SwiftNet lofr-lm 1752/tcp # Leap of Faith Research License Manager lofr-lm 1752/udp # Leap of Faith Research License Manager predatar-comms 1753/tcp # Predatar Comms Service oracle-em2 1754/tcp # oracle-em2 oracle-em2 1754/udp # oracle-em2 ms-streaming 1755/tcp # ms-streaming ms-streaming 1755/udp # ms-streaming capfast-lmd 1756/tcp # capfast-lmd capfast-lmd 1756/udp # capfast-lmd cnhrp 1757/tcp # cnhrp cnhrp 1757/udp # cnhrp spss-lm 1759/tcp # SPSS License Manager www-ldap-gw 1760/tcp # www-ldap-gw www-ldap-gw 1760/udp # www-ldap-gw cft-0 1761/tcp # cft-0 cft-0 1761/udp # cft-0 cft-1 1762/tcp # cft-1 cft-1 1762/udp # cft-1 cft-2 1763/tcp # cft-2 cft-2 1763/udp # cft-2 cft-3 1764/tcp # cft-3 cft-3 1764/udp # cft-3 cft-4 1765/tcp # cft-4 cft-4 1765/udp # cft-4 cft-5 1766/tcp # cft-5 cft-5 1766/udp # cft-5 cft-6 1767/tcp # cft-6 cft-6 1767/udp # cft-6 cft-7 1768/tcp # cft-7 cft-7 1768/udp # cft-7 bmc-net-adm 1769/tcp # bmc-net-adm bmc-net-adm 1769/udp # bmc-net-adm bmc-net-svc 1770/tcp # bmc-net-svc bmc-net-svc 1770/udp # bmc-net-svc vaultbase 1771/tcp # vaultbase

,