无法访问互联网

逐项检查

第一步:IP 地址、子网掩码是否配置正确

// 检查网络配置文件
root@openwrt:~# uci show network

// 检查br-lan和eth0有没有正确配置
root@openwrt:~# ifconfig

// 检查桥接配置
root@openwrt:~# brctl show

// 临时配置一个IP给br-lan
root@openwrt:~# ifconfig eth0 192.168.1.2/24 up

第二步:网关是否配置正确

// 检查默认网关
root@openwrt:~# route

// 添加默认网关
root@openwrt:~# route add default gw 192.168.1.1

第三步:DNS 服务器是否配置正确

// 检查DNS服务器地址
root@openwrt:~# cat /etc/resolv.conf

// 指定8.8.8.8为默认DNS服务器(此8.8.8.8为Google的全球域名解析服务器,包括中国在内全世界通用)
root@openwrt:~# echo "nameserver 8.8.8.8" > /etc/resolv.conf

第四步:检查防火墙配置

// 查看防火墙当前状态
root@openwrt:~# iptables -L
root@openwrt:~# iptables -L -t mangle

// 查看防火墙当前配置
root@openwrt:~# uci show firewall
root@openwrt:~# cat /etc/config/firewall

// 临时停用防火墙
root@openwrt:~# /etc/init.d/firewall stop

// 重新启动时禁用防火墙
root@openwrt:~# /etc/init.d/firewall disable

results matching ""

    No results matching ""