找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 9066|回复: 3

wan口上网了,lan口不能上网,怎么回事呢

[复制链接]
有台rg100a-aa 刷openwrt 版本号19160

网络配置如下,rg100a-aa连上另一个路由使用dhcp能正确获得ip
  1. config switch eth1
  2.           option reset 1
  3.           option enable_vlan 1

  4. config switch_vlan
  5.           option device eth1
  6.           option vlan 0
  7.           option ports "0 1 2 5*"

  8. config switch_vlan
  9.           option device eth1
  10.           option vlan 1
  11.           option ports "3 5*"



  12. config interface loopback
  13.         option ifname lo
  14.         option proto static
  15.         option ipaddr 127.0.0.1
  16.         option netmask 255.0.0.0

  17. config interface lan
  18.         option type bridge
  19.         option ifname eth1.0
  20.         option proto static
  21.         option netmask 255.255.255.0
  22.         option nat 1
  23.         option ipaddr 192.168.3.1


  24. config interface wan
  25.         option proto dhcp
  26.         option ifname eth1.1
复制代码
telnet登录路由器
  1. ping 126.com
复制代码
获得如下结果
  1. root@OpenWrt:~# ping 126.com
  2. PING 126.com (123.125.50.22): 56 data bytes
  3. 64 bytes from 123.125.50.22: seq=0 ttl=52 time=102.686 ms
  4. 64 bytes from 123.125.50.22: seq=1 ttl=52 time=33.897 ms
  5. 64 bytes from 123.125.50.22: seq=2 ttl=52 time=32.217 ms
  6. 64 bytes from 123.125.50.22: seq=3 ttl=52 time=31.266 ms
  7. 64 bytes from 123.125.50.22: seq=4 ttl=52 time=33.397 ms
  8. 64 bytes from 123.125.50.22: seq=5 ttl=52 time=31.513 ms
  9. 64 bytes from 123.125.50.22: seq=6 ttl=52 time=39.004 ms
  10. 64 bytes from 123.125.50.22: seq=7 ttl=52 time=31.229 ms
  11. 64 bytes from 123.125.50.22: seq=8 ttl=52 time=31.871 ms
复制代码
看来能正确上网
但是连在lan上的pc却无法上网,pc网卡是dhcp获得rg100a-aa分配的ip,pc能访问rg100a-aa,rg100a-aa能访问internet,但是pc无法访问internet
请问怎么解决这个问题呢
我的恩山、我的无线 The best wifi forum is right here.
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
没有解决 不是你说的问题。我在路由器运行以下命令就好了用iptables做nat
iptables -t nat -A POSTROUTING -o eth1.1 -j MASQUERADE
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

LS的,谢谢你.
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-5-6 03:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表