找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 2867|回复: 12

[其它X86系统] opnsense也支持ipv6防火墙反掩码(firewall dynamic ipv6 ),顺便记录上手时遇到的坑

[复制链接]
本帖最后由 fengchen 于 2023-12-8 22:02 编辑


20231208
opnsense上设置wg小记:
官方有个说明https://docs.opnsense.org/manual/how-tos/wireguard-client.html
注意如果wg只使用ipv4的话,Step 5(b)跳过不用设置
按这个说明会出现tp路由器不能访问的问题,应该是tp阻止了wg地址段ip的访问,
对比了openwrt的wg设置,最后添加snat后正常,设置如下:
firewall - nat - outbound:
Select - Hybrid outbound NAT rule generation
Add rule - interface: lan, tcp/ip: ipv4, source address: wg net, destination address: lan net, translation/target: lan address


=================================================
20230827
最近准备把出口路由换成opnsense防火墙,因为它更新更快些,而且有几个流量图形界面比较合我的意,openwrt下就是找不到合适的流量图形显示软件
再记录下遇到的坑
这私对硬盘读写较多,日志也很全面,所以用u盘的话就不太行(太慢),得上ssd才好
还有一个就是,添加开机启动脚本时不能像原生freebsd那样,那样死活不调用
opnsense有一个专门的目录用来放自启动脚本,参考https://docs.opnsense.org/development/backend/autorun.html
这样就好办了,在/usr/local/etc/rc.syshook.d/start/目录做一个脚本20-autostart,注意添加执行权限,内容如下
  1. root@OPNsense:~ # cat /usr/local/etc/rc.syshook.d/start/20-autostart
  2. #!/bin/sh

  3. sh /etc/rc.local
复制代码
这样/etc/rc.local就可以愉快的使用了

然后运行两天后,又发现wan不定时断线,后来干脆拨不上号了,重启后正常
查看log发现ppp发送包一直没有响应,再看系统日志发现有
  1. 2023-08-27T12:52:06        Notice        kernel        <6>re1: link state changed to UP        
  2. 2023-08-27T12:52:02        Notice        kernel        <6>re1: link state changed to DOWN        
  3. 2023-08-27T12:52:02        Notice        kernel        <6>re1: watchdog timeout        
  4. 2023-08-27T12:51:55        Notice        kernel        <6>re1: link state changed to UP        
  5. 2023-08-27T12:51:51        Notice        kernel        <6>re1: link state changed to DOWN        
  6. 2023-08-27T12:51:51        Notice        kernel        <6>re1: watchdog timeout        
  7. 2023-08-27T12:51:33        Notice        kernel        <6>re1: link state changed to UP        
  8. 2023-08-27T12:51:29        Notice        kernel        <6>re1: link state changed to DOWN        
  9. 2023-08-27T12:51:29        Notice        kernel        <6>re1: watchdog timeout        
  10. 2023-08-27T12:51:20        Notice        kernel        <6>re1: link state changed to UP        
  11. 2023-08-27T12:51:16        Notice        kernel        <6>re1: link state changed to DOWN        
  12. 2023-08-27T12:51:16        Notice        kernel        <6>re1: watchdog timeout
复制代码

网卡看门狗超时导致一直down/up,咱也不知道啥情况,放鸽一搜,TNND,驱动的问题,再细爬,opnsense官方有螃蟹驱动插件
先装上os-realtek-re看看效果吧
详见https://forum.opnsense.org/index.php?topic=26627.0


================================================================================================
1。https://opnsense.org/download/ 直接下载nano版本的镜像,用rufus写入u盘就可以启动


Select the image type:
dvd: ISO installer image with live system capabilities running in VGA mode. On amd64, UEFI boot is supported as well.
vga: USB installer image with live system capabilities running in VGA mode as GPT boot. On amd64, UEFI boot is supported as well.
serial: USB installer image with live system capabilities running in serial console (115200) mode as MBR boot.
nano: a preinstalled serial image for USB sticks, SD or CF cards as MBR boot. These images are 3G in size and automatically adapt to the installed media size after first boot.

这里有个比较坑的地方,如果下载的VGA或者DVD安装文件,默认启动的是livecd模式,要在控制台使用用户名installer密码opnsense登陆后安装
Default behaviour is to start the Live environment, to install log in with user installer and password opnsense

2。启动过程中不要动键盘,直到输入用户名登陆,用户名root密码opnsense,ifconfig|more可以查看lan口的ip和mac,就知道怎么插网线了


3。web菜单System: Wizard这个是初次设置向导,错过的话可以点这里
4。System: Firmware更新系统,mirror可以选择中国的那个,web界面点击后经常卡顿,可能是我的硬件性能没达到推荐要求
5。ipv6推荐设置(SLAAC):
Interfaces: [WAN] -  IPv6 Configuration Type:dhcpv6,  Use IPv4 connectivity:Y,  Prefix delegation size:60(根据ISP提供的,重要)
Interfaces: [LAN]- IPv6 Configuration Type:Track interface,  Manual configuration:Y
Services: DHCPv6: [LAN] -Enable:N, Services: Router Advertisements: [LAN] -  Router Advertisements:Unmanaged
Interfaces: Overview可以查看接口详细信息

6。端口转发:
Firewall: NAT: Port Forward - Interface:wan, TCP/IP Version:ipv4, Protocol:tcp, Destination:WAN address,  Destination port range: from,other,12345 to,other,23456
- Redirect target IP:single host or network,192.168.10.10,  Redirect target port: other,12345(这里自动对应范围了),  NAT reflection:enable(NAT回流,还要加上下面的设置)
NAT回流添加设置:Firewall: Settings: Advanced -  Reflection for port forwards:Y,  Automatic outbound NAT for Reflection:Y
7。ipv6防火墙规则rules:
Firewall: Aliases - Name:debian_ipv6, Type:dynamic ipv6 host, Content: ::1:2:3:4, Interface:lan,Firewall: Rules: WAN - Action:pass, Interface:wan, Direction:in,  TCP/IP Version:ipv6, Protocol:tcp, Destination:debian_ipv6,  Destination port range: from,other,12345 to,other,23456


8。总结,设置过程比较反人性化,大家家用还是openwrt吧
9。点了一下wan口pppoe disconnect再也拨不上号了,弄了半天发现配置给搞丢了










评分

参与人数 1恩山币 +1 收起 理由
w392*** + 1 不要怂、就是干!

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
huitiexuexi2,,,,
我的恩山、我的无线 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.
回复

使用道具 举报

感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

老规矩,先回后下!!!!!!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

opnsense也支持ipv6防火墙反掩码(firewall dynamic ipv6 ),
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

有中文 没切换中文界面?

点评

翻译的不咋样,顺便学习下英文  详情 回复 发表于 2023-8-27 16:32
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报


感谢分享。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
dhcn 发表于 2023-4-9 19:39
有中文 没切换中文界面?

翻译的不咋样,顺便学习下英文
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
opnsense上设置wg小记
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

关闭

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

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

GMT+8, 2024-4-28 19:33

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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