标签 openwrt 下的文章

由于OpenWRT上的ssh可执行文件与普通计算机上的SSH不同,我们需要在OpenWRT上安装完整版的OpenSSH。
1、在OpenWRT上打开终端,输入以下命令:

opkg update
opkg install openssh-client openssh-server

2、然后将OpenSSH添加到PATH环境变量中。在OpenWRT上打开终端,输入以下命令:

echo 'export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/sbin"' >> /etc/profile
source /etc/profile

3、重新启动终端并测试SSH连接。在OpenWRT上打开终端,输入以下命令:

ssh -i /path/private_key user@ubuntu_ip_address

屏蔽网址

iptables -I FORWARD -d news.163.com -j DROP

禁止非法用户上网

iptables -I INPUT -m mac --mac-source 5e:30:58:d0:8a:c9 -j DROP
iptables -I FORWARD -m mac --mac-source 5e:30:58:d0:8a:c9 -j DROP