入户猫被设置成了桥接模式,只用于当作一个猫使用,后面接 Unifi 的 USG 猫被设置后只能有一个固定 IP 地址 192.168.100.1 用于管理
Unifi 部分被设置成了一个 10.0.0.1 的地址
如何在 Unifi 部分设置让连入 Unifi 的电脑可以访问 192.168.100.1 呢?
1
GreenVine 2019 年 5 月 20 日
把连光猫的 interface 加上 Masquerade 就可以了
|
2
GreenVine 2019 年 5 月 20 日 ```
set service nat rule 5001 description 'Fibre Modem Masquerade' set service nat rule 5001 log disable set service nat rule 5001 outbound-interface [ethernet-interface] set service nat rule 5001 protocol all set service nat rule 5001 type masquerade ``` 其中把[ethernet-interface]换成你实际接光猫的口,比如 eth1, eth2...等等 |
3
rzti483NAJ66l669 2019 年 5 月 20 日
路由表
|
6
Danswerme 2019 年 5 月 20 日 假设路由器连接入户光猫用来拨号的物理接口=eth0,给 eth0 添加一个 192.168.100.2 的 ip 地址,然后防火墙里添加 nat 规则,10.0.0.0/24 去往 192.168.100.1 的动作全部 nat 为 192.168.100.2
ubnt 没用过,routeros 是这样的: ``` /ip address add address ``` |
7
Danswerme 2019 年 5 月 20 日
假设路由器连接入户光猫用来拨号的物理接口=eth0,给 eth0 添加一个 192.168.100.2 的 ip 地址,然后防火墙里添加 nat 规则,10.0.0.0/24 去往 192.168.100.1 的动作全部 nat 为 192.168.100.2
ubnt 没用过,routeros 是这样的: ``` /ip address add address=192.168.100.2 interface=eth0 /ip firewall nat add chain=srcnat src-address=10.0.0.0/24 dst-address=192.168.100.1 action=src-nat to-addresses=192.168.100.2 ``` |
8
Danswerme 2019 年 5 月 20 日
上面失误,添加 ip 地址的命令少输入了子网掩码,正确命令应该是:
``` /ip address add address=192.168.100.2/24 interface=eth0 ``` |
9
bubuyu 2019 年 5 月 20 日 与 lz 同样的情况,试了一下,综合#2、#7、#8,在#2 的基础上在加上下面一条就可以了(给 WAN1 口配置上一个 IP 地址)。
set interfaces ethernet eth0 address 192.168.1.2/24 |
10
bubuyu 2019 年 5 月 20 日
补充,我的光猫网段跟 lz 不一样,lz 的话,应该这样:
set interfaces ethernet eth0 address 192.168.100.2/24 |
11
TigerS OP |
15
charley008 2024 年 8 月 7 日
@bubuyu 我试了还是不行。一半 usg 的 wan 口是 eht1 ?
|
16
charley008 2024 年 8 月 7 日
成功了。是我搞错 wan 口的 eth 。。。。。
|