Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jaywax
jaywax / flux.ksh
Last active March 15, 2023 02:42
Ksh script to play with pf's anchor
#!/bin/ksh
######################################################################################################################################
#
# Author : jaywax.2.bourbon@gmail.com - jaywax
# Date : 11/12/2018
# Version : V2.1
# Goal : Used by domogik installation to play with pf anchor.
# $1 : anchor : tab_enfants_all_wif | tel_enfants_all_wif | pc_jeux_wif | obiwan_web_wif | tab_college_all_wif | freebox_4k_all_bad
# $2 : action : on | off
######################################################################################################################################
@jaywax
jaywax / pf.conf
Created December 11, 2018 14:43
The part of pf.conf talking about anchor
anchor "tab_enfants_all_wif" in on $wif_if from <TAB_ENFANTS_WIF> to <INTERNET> tag TO_INTERNET {
anchor tcp proto tcp to port { http, https, $boombeach_jeux_port, $unknown_jeux_ports, $yokai_jeux_ports } {
block log quick
}
anchor udp proto udp to port { $pixel_gun3d_jeux_ports } {
block log quick
}
}
anchor "tel_enfants_all_wif" in on $wif_if from <TEL_ENFANTS_WIF> to <INTERNET> tag TO_INTERNET {
anchor tcp proto tcp to port { http, https } {
root@chzmdomdmg01d:/var/log/domogik# cat core_admin.log
2017-10-10 13:22:01,987 domogik-admin INFO Looking for launched instances of 'admin'
2017-10-10 13:22:02,025 domogik-admin INFO No existing process.
2017-10-10 13:22:02,026 domogik-admin DEBUG Setting locale to system locale: ('fr_FR', 'UTF-8')
2017-10-10 13:22:02,030 domogik-admin INFO Starting the plugin in background...
2017-10-10 13:22:03,387 domogik-admin INFO Daemonize plugin admin
2017-10-10 13:22:03,388 domogik-admin INFO ----------------------------------
2017-10-10 13:22:03,388 domogik-admin INFO Starting client 'admin' (new manager instance)
2017-10-10 13:22:03,388 domogik-admin INFO Python version is sys.version_info(major=2, minor=7, micro=9, releaselevel='final', serial=0)
2017-10-10 13:22:03,395 domogik-admin DEBUG Send client status : starting
netstat -ntplu|grep -i python
tcp 0 0 127.0.0.1:50001 0.0.0.0:* LISTEN 10306/python
tcp 0 0 10.10.8.11:40405 0.0.0.0:* LISTEN 10369/python
tcp 0 0 10.10.8.11:40410 0.0.0.0:* LISTEN 10231/python
tcp 0 0 10.10.8.11:40411 0.0.0.0:* LISTEN 10240/python
tcp 0 0 10.10.8.11:40412 0.0.0.0:* LISTEN 10240/python
udp 0 0 10.10.8.11:46973 0.0.0.0:* 10324/python
udp 0 0 10.10.8.11:56285 0.0.0.0:* 10270/python