中国十佳网站建设公司,企业网站制作官网,重庆文化墙制作,网页设计作业文件夹压缩包如何修改openwrt路由器的web访问端口号#xff1f;
在OpenWrt路由器上#xff0c;如何修改Web访问端口号#xff0c;通常涉及到修改HTTP服务器的配置文件。默认情况下#xff0c;OpenWrt使用的HTTP服务器是uHTTPd。
以下是修改Web访问端口号的步骤#xff1a;
一、通过…如何修改openwrt路由器的web访问端口号
在OpenWrt路由器上如何修改Web访问端口号通常涉及到修改HTTP服务器的配置文件。默认情况下OpenWrt使用的HTTP服务器是uHTTPd。
以下是修改Web访问端口号的步骤
一、通过SSH登录路由器
使用SSH客户端连接到路由器。如果你的路由器上没有安装SSH服务器你可能需要通过Web界面或其他方式启用SSH。
或者windows的cmd进行连接
二、编辑uHTTPd配置文件
执行命令vi /etc/config/uhttpd以编辑uHTTPd的配置文件。你可以使用vi文本编辑器
软路由界面
BusyBox v1.36.0 (2023-05-05 16:18:36 UTC) built-in shell (ash)_________/ /\ _ ___ ___ ___/ LE / \ | | | __| \| __|/ DE / \ | |__| _|| |) | _|/________/ LE \ |____|___|___/|___|\ \ DE /\ LE \ / -------------------------------------------\ DE \ / OpenWrt SNAPSHOT, r6047-c75138ada\________\/ -------------------------------------------rootBleachWrt:~# vi /etc/config/uhttpd找到并修改端口号在打开的配置文件中找到类似以下行的配置默认端口号为80
config uhttpd mainlist listen_http 0.0.0.0:80list listen_http [::]:80list listen_https 0.0.0.0:443list listen_https [::]:443option redirect_https 0option home /wwwoption rfc1918_filter 1option max_connections 100option cert /etc/uhttpd.crtoption key /etc/uhttpd.keyoption cgi_prefix /cgi-binlist lua_prefix /cgi-bin/luci/usr/lib/lua/luci/sgi/uhttpd.luaoption network_timeout 30option http_keepalive 20option tcp_keepalive 1option ubus_prefix /ubusoption script_timeout 3600list index_page cgi-bin/lucioption max_requests 50修改list list listen_http行中的端口号为你想要的新端口号。例如将端口号修改为8080
config uhttpd mainlist listen_http 0.0.0.0:80修改后
config uhttpd mainlist listen_http 0.0.0.0:8080list listen_http [::]:8080
如果使用vi编辑器按下esc然后输入:wq并按Enter保存并退出
三、重新启动uHTTPd服务
为了使更改生效需要重新启动uHTTPd服务。执行以下命令
/etc/init.d/uhttpd restart或者使用service命令
service uhttpd restart如果你使用了防火墙你可能还需要更新防火墙规则以允许新的端口上的流量。