OpenWRT常用操作及命令(更新中……)

1、修改欢迎页内容
/ect/banner

2、添加启动项,启动脚本或命令
/etc/rc.local

3、开放服务端口(iptables)
iptables -I INPUT -p tcp –dport 80 -j ACCEPT // 对外开放80端口
iptables -I INPUT -p tcp –dport 22 -j ACCEPT // 对外开放22端口

4、修改HostName
/etc/config/system

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
root@SianRouter:/# cat /etc/config/system
#http://wiki.openwrt.org/doc/uci/system
config system
        option hostname 'SianRouter'        option timezone 'CST-8'
        #log config for busybox syslod
        option log_type 'file'
        option log_size '250'
        option log_rotate '1'
        option log_file '/data/usr/log/messages'
 
config timeserver 'ntp'
        option enable_server '0'
        list server '0.pool.ntp.org'
        list server '1.pool.ntp.org'
        list server '2.pool.ntp.org'
        list server '3.pool.ntp.org'
        list server '3.asia.pool.ntp.org'
        list server '0.asia.pool.ntp.org'
        list server '0.cn.pool.ntp.org'

5、防火墙配置
/etc/config/firewall

Leave a Reply