找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1665|回复: 9

求教 如何实现连接不同SSID,走不同的wan线路

[复制链接]
有电信,联通,移动三条宽带,分别建立了vlan(eth0.1 , eth0.2 , eth0.3) ,分别创建了3个WAN口(WAN1, WAN2, WAN3);又创建了三个SSID(ssid1, ssid2, ssid3),分别创建了3个LAN口(LAN1 192.168.1.1 , LAN2192.168.2.1 , LAN3 192.168.3.1 ).

希望实现连接ssid1就走电信,连接ssid2走联通,连接ssid3走移动。

尝试了以下方法,但没什么效果
iptables -I FORWARD -d 192.168.2.1 -i eth0.1 -j DROP
iptables -I FORWARD -d 192.168.3.1 -i eth0.1 -j DROP

iptables -I FORWARD -d 192.168.1.1 -i eth0.2 -j DROP
iptables -I FORWARD -d 192.168.3.1 -i eth0.2 -j DROP


iptables -I FORWARD -d 192.168.1.1 -i eth0.3 -j DROP
iptables -I FORWARD -d 192.168.2.1 -i eth0.3 -j DROP


不知道有没有什么好办法
我的恩山、我的无线 The best wifi forum is right here.
看不懂,也没有办法
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我有个想法,准备三台路由器然后....
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

不会,留名关注解决方案
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

在无线--接口配置--基本设置--网络--创建  那里看看可不可以。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

6口的软路由应该是可以实现的。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

应该规则没错呀不懂绑定
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
有没有大神指导一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

本帖最后由 kokang 于 2019-11-11 18:28 编辑

要设置的参数有点多

  1. uci set network.lan2=interface
  2. uci set network.lan2.type=bridge
  3. uci set network.lan2.proto=static
  4. uci set network.lan2.ipaddr=192.168.101.1
  5. uci set network.lan2.netmask=255.255.255.0

  6. uci set network.lan3=interface
  7. uci set network.lan3.type=bridge
  8. uci set network.lan3.proto=static
  9. uci set network.lan3.ipaddr=192.168.102.1
  10. uci set network.lan3.netmask=255.255.255.0
  11. uci commit network

  12. uci set network.wanb=interface
  13. uci set network.wanb.ifname=eth0.2
  14. uci set network.wanb.proto=dhcp
  15. uci set network.wanb.ipv6=auto
  16. uci set network.wanb.metric=20
  17. uci set network.wanb6=interface
  18. uci set network.wanb6.ifname=@wanb
  19. uci set network.wanb6.proto=dhcpv6

  20. uci set network.wanc=interface
  21. uci set network.wanc.ifname=eth0.3
  22. uci set network.wanc.proto=dhcp
  23. uci set network.wanc.ipv6=auto
  24. uci set network.wanc.metric=20
  25. uci set network.wanc6=interface
  26. uci set network.wanc6.ifname=@wanc
  27. uci set network.wanc6.proto=dhcpv6
  28. uci commit network

  29. uci set dhcp.lan2=dhcp
  30. uci set dhcp.lan2.interface=lan2
  31. uci set dhcp.lan2.start=100
  32. uci set dhcp.lan2.limit=254
  33. uci set dhcp.lan2.leasetime=24h
  34. uci set dhcp.lan2.dhcpv6=server
  35. uci set dhcp.lan2.ra=server
  36. uci set dhcp.lan2.ra_management=1
  37. uci add_list dhcp.lan2.dhcp_option=6,223.5.5.5,223.6.6.6

  38. uci set dhcp.lan3=dhcp
  39. uci set dhcp.lan3.interface=lan3
  40. uci set dhcp.lan3.start=100
  41. uci set dhcp.lan3.limit=254
  42. uci set dhcp.lan3.leasetime=24h
  43. uci set dhcp.lan3.dhcpv6=server
  44. uci set dhcp.lan3.ra=server
  45. uci set dhcp.lan3.ra_management=1
  46. uci add_list dhcp.lan3.dhcp_option=6,114.114.114.114,114.114.115.115
  47. uci commit dhcp

  48. uci delete wireless.default_radio0

  49. uci add wireless wifi-iface
  50. uci set wireless.@wifi-iface[-1].device=radio0
  51. uci set wireless.@wifi-iface[-1].network=lan
  52. uci set wireless.@wifi-iface[-1].mode=ap
  53. uci set wireless.@wifi-iface[-1].ssid=001
  54. uci set wireless.@wifi-iface[-1].encryption=psk2
  55. uci set wireless.@wifi-iface[-1].key=1234567890
  56. uci set wireless.@wifi-iface[-1].isolate=1
  57. uci set wireless.@wifi-iface[-1].disabled=0

  58. uci add wireless wifi-iface
  59. uci set wireless.@wifi-iface[-1].device=radio0
  60. uci set wireless.@wifi-iface[-1].network=lan2
  61. uci set wireless.@wifi-iface[-1].mode=ap
  62. uci set wireless.@wifi-iface[-1].ssid=002
  63. uci set wireless.@wifi-iface[-1].encryption=psk2
  64. uci set wireless.@wifi-iface[-1].key=1234567890
  65. uci set wireless.@wifi-iface[-1].isolate=1
  66. uci set wireless.@wifi-iface[-1].disabled=0

  67. uci add wireless wifi-iface
  68. uci set wireless.@wifi-iface[-1].device=radio0
  69. uci set wireless.@wifi-iface[-1].network=lan3
  70. uci set wireless.@wifi-iface[-1].mode=ap
  71. uci set wireless.@wifi-iface[-1].ssid=003
  72. uci set wireless.@wifi-iface[-1].encryption=psk2
  73. uci set wireless.@wifi-iface[-1].key=1234567890
  74. uci set wireless.@wifi-iface[-1].isolate=1
  75. uci set wireless.@wifi-iface[-1].disabled=0

  76. uci commit wireless

  77. uci add firewall zone
  78. uci set firewall.@zone[-1].name=lan2
  79. uci set firewall.@zone[-1].network=lan2
  80. uci set firewall.@zone[-1].input=ACCEPT
  81. uci set firewall.@zone[-1].output=ACCEPT
  82. uci set firewall.@zone[-1].forward=ACCEPT
  83. uci set firewall.@zone[-1].mtu_fix=1
  84. uci set firewall.@zone[-1]=zone
  85. uci add firewall zone
  86. uci set firewall.@zone[-1].name=wanb
  87. uci set firewall.@zone[-1].network='wanb' 'wanb6'
  88. uci set firewall.@zone[-1].input=REJECT
  89. uci set firewall.@zone[-1].output=ACCEPT
  90. uci set firewall.@zone[-1].forward=REJECT
  91. uci set firewall.@zone[-1].masq=1
  92. uci set firewall.@zone[-1].mtu_fix=1
  93. uci add firewall forwarding
  94. uci set firewall.@forwarding[-1]=forwarding
  95. uci set firewall.@forwarding[-1].src=lan2
  96. uci set firewall.@forwarding[-1].dest=wanb

  97. uci add firewall zone
  98. uci set firewall.@zone[-1].name=lan3
  99. uci set firewall.@zone[-1].network=lan3
  100. uci set firewall.@zone[-1].input=ACCEPT
  101. uci set firewall.@zone[-1].output=ACCEPT
  102. uci set firewall.@zone[-1].forward=ACCEPT
  103. uci set firewall.@zone[-1].mtu_fix=1
  104. uci set firewall.@zone[-1]=zone
  105. uci add firewall zone
  106. uci set firewall.@zone[-1].name=wanc
  107. uci set firewall.@zone[-1].network='wanc' 'wanc6'
  108. uci set firewall.@zone[-1].input=REJECT
  109. uci set firewall.@zone[-1].output=ACCEPT
  110. uci set firewall.@zone[-1].forward=REJECT
  111. uci set firewall.@zone[-1].masq=1
  112. uci set firewall.@zone[-1].mtu_fix=1
  113. uci add firewall forwarding
  114. uci set firewall.@forwarding[-1]=forwarding
  115. uci set firewall.@forwarding[-1].src=lan3
  116. uci set firewall.@forwarding[-1].dest=wanc
  117. uci commit firewall

  118. /etc/init.d/firewall restart
  119. /etc/init.d/dnsmasq restart
  120. /etc/init.d/network restart
  121. /sbin/wifi up
复制代码



点评

真*干货 谢谢大神 先测试一下再慢慢消化  发表于 2019-11-11 22:10
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-28 05:26

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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