<commit_before>---
# - name: Set up SSH
#   do_it_yourself_rtx_config:
#     lines:
#       - login user username password
#       - sshd host key generate
#       - sshd service on

- name: Set login
  rtx_config:
    lines:
      - login timer 3600
  tags: [rtx, rtx-login]

- name: Set security
  rtx_config:
    lines:
      - security class 2 on off off
  tags: [rtx, rtx-security]

- name: Set console
  rtx_config:
    lines:
      - console character ascii
      - console lines infinity
      - console prompt [{{ rtx.hostname }}]
  tags: [rtx, rtx-console]

- name: Set ip
  rtx_config:
    lines:
      - ip route default gateway {{ default_gateway.ip }}
      - ip keepalive 1 icmp-echo 10 5 {{ default_gateway.ip }}
      - ip lan1 address {{ lan1.ip }}/{{ lan1.netmask }}
      - ip lan1 proxyarp on
      - ip lan2 address {{ lan2.ip }}/{{ lan2.netmask }}
  tags: [rtx, rtx-ip]

- name: Set ipv6
  rtx_config:
    lines:
      - ipv6 prefix 1 ra-prefix@lan2::/64
      - ipv6 lan1 address ra-prefix@lan2::1/64
      - ipv6 lan1 rtadv send 1 o_flag=on
  tags: [rtx, rtx-ipv6]

- name: Set syslog
  rtx_config:
    lines:
      - syslog host {{ fox.ip }}
      - syslog execute command on
  tags: [rtx, rtx-syslog]

- name: Set telnet
  rtx_config:
    lines:
      - telnetd host lan1
  tags: [rtx, rtx-telnet]

- name: Set dns
  rtx_config:
    lines:
      - dns server {{ fox.ip }} {{ hotel.ip }} {{ fox.ipv6 }} {{ hotel.ipv6 }}
      - dns domain {{ domain }}
      - dns syslog resolv on
      - dns private address spoof on
  tags: [rtx, rtx-dns]

- name: Set snmp
  rtx_config:
    lines:
      - snmpv2c host any
      - snmpv2c trap community trap
      - snmpv2c trap host {{ delta.ip }}
  tags: [rtx, rtx-snmp]

- name: Set schedule
  rtx_config:
    lines:
      - schedule at 100 */* 04:52:16 * ntpdate {{ ntpd.fqdn }} syslog
      - schedule at 101 */* 10:52:16 * ntpdate {{ ntpd.fqdn }} syslog
      - schedule at 102 */* 16:52:16 * ntpdate {{ ntpd.fqdn }} syslog
      - schedule at 103 */* 22:52:16 * ntpdate {{ ntpd.fqdn }} syslog
  tags: [rtx, rtx-schedule]

- name: Set httpd
  rtx_config:
    lines:
      - httpd host lan1
  tags: [rtx, rtx-httpd]

- name: Set sshd
  rtx_config:
    lines:
      - sshd host lan1
  tags: [rtx, rtx-sshd]

- name: Set sntpd
  rtx_config:
    lines:
      - sntpd service on
      - sntpd host lan1
  tags: [rtx, rtx-sntpd]

- name: Set ip interface secure filter
  rtx_config:
    lines:
      - ip lan1 secure filter in 100000 100001 100002 100003 100004 100005 100006 100007 100099
      # Default ip lan2 secure filter in :
      # ip lan2 secure filter in 101003 101020 101021 101022 101023 101024 101025 101030 101032 101080 101081 101082 101083
      - ip lan2 secure filter in 101003 101020 101021 101022 101023 101024 101025 101099
      - ip lan2 secure filter out 101013 101020 101021 101022 101023 101024 101025 101026 101027 101099 dynamic 101080 101081 101082 101083 101084 101085 101098 101099
      - ipv6 lan2 secure filter in 101 102 2001 2002 3001 3004 101010 101011 101012 102000
      - ipv6 lan2 secure filter out 103000 dynamic 100100 100101 100102 100103 100104 100105 100106
  tags: [rtx, rtx-port]

- name: Set the default filters
  rtx_config:
    lines:
      - ip filter 100000 reject * * udp,tcp 135 *
      - ip filter 100001 reject * * udp,tcp * 135
      - ip filter 100002 reject * * udp,tcp netbios_ns-netbios_dgm *
      - ip filter 100003 reject * * udp,tcp * netbios_ns-netbios_dgm
      - ip filter 100004 reject * * udp,tcp netbios_ssn *
      - ip filter 100005 reject * * udp,tcp * netbios_ssn
      - ip filter 100006 reject * * udp,tcp 445 *
      - ip filter 100007 reject * * udp,tcp * 445
      - ip filter 100099 pass * * * * *
      - ip filter 101000 reject 10.0.0.0/8 * * * *
      - ip filter 101001 reject 172.16.0.0/12 * * * *
      - ip filter 101002 reject 192.168.0.0/16 * * * *
      - ip filter 101003 reject 192.168.0.0/24 * * * *
      - ip filter 101010 reject * 10.0.0.0/8 * * *
      - ip filter 101011 reject * 172.16.0.0/12 * * *
      - ip filter 101012 reject * 192.168.0.0/16 * * *
      - ip filter 101013 reject * 192.168.0.0/24 * * *
      - ip filter 101020 reject * * udp,tcp 135 *
      - ip filter 101021 reject * * udp,tcp * 135
      - ip filter 101022 reject * * udp,tcp netbios_ns-netbios_ssn *
      - ip filter 101023 reject * * udp,tcp * netbios_ns-netbios_ssn
      - ip filter 101024 reject * * udp,tcp 445 *
      - ip filter 101025 reject * * udp,tcp * 445
      - ip filter 101026 restrict * * tcpfin * www,21,nntp
      - ip filter 101027 restrict * * tcprst * www,21,nntp
      - ip filter 101030 pass * 192.168.0.0/24 icmp * *
      - ip filter 101031 pass * 192.168.0.0/24 established * *
      - ip filter 101032 pass * 192.168.0.0/24 tcp * ident
      - ip filter 101033 pass * 192.168.0.0/24 tcp ftpdata *
      - ip filter 101034 pass * 192.168.0.0/24 tcp,udp * domain
      - ip filter 101035 pass * 192.168.0.0/24 udp domain *
      - ip filter 101036 pass * 192.168.0.0/24 udp * ntp
      - ip filter 101037 pass * 192.168.0.0/24 udp ntp *
      - ip filter 101080 pass * 192.168.0.1 esp * *
      - ip filter 101081 pass * 192.168.0.1 udp * 500
      # Protocol 4 is IP in IP
      - ip filter 101082 pass * 192.168.0.1 4 * *
      - ip filter 101083 pass * 192.168.0.1 udp * 4500
      - ip filter 101099 pass * * * * *
      - ip filter 500000 restrict * * * * *
      - ip filter dynamic 101080 * * ftp
      - ip filter dynamic 101081 * * domain
      - ip filter dynamic 101082 * * www
      - ip filter dynamic 101083 * * smtp
      - ip filter dynamic 101084 * * pop3
      - ip filter dynamic 101085 * * submission
      - ip filter dynamic 101098 * * tcp
      - ip filter dynamic 101099 * * udp
      - ipv6 filter 101010 pass * * icmp6 * *
      - ipv6 filter 101011 pass * * tcp * ident
      - ipv6 filter 101012 pass * * udp * 546
      - ipv6 filter 102000 reject * * * * *
      - ipv6 filter 103000 pass * * * * *
      - ipv6 filter dynamic 100100 * * ftp
      - ipv6 filter dynamic 100101 * * domain
      - ipv6 filter dynamic 100102 * * www
      - ipv6 filter dynamic 100103 * * smtp
      - ipv6 filter dynamic 100104 * * pop3
      - ipv6 filter dynamic 100105 * * tcp
      - ipv6 filter dynamic 100106 * * udp
  tags: [rtx, rtx-port]

- name: Open ports
  rtx_config:
    lines:
      - ip lan2 nat descriptor 1
      - nat descriptor type 1 masquerade
      - nat descriptor address outer 1 primary
      # guppy: Synology DSM
      - nat descriptor masquerade static 1 2001 {{ guppy.ip }} tcp 5000,5010
      - ipv6 filter 2001 pass * {{ guppy.ipv6 }} tcp * 5000,5001
      # guppy: HTTP
      - nat descriptor masquerade static 1 2002 {{ guppy.ip }} tcp 80
      - ipv6 filter 2002 pass * {{ guppy.ipv6 }} tcp * 80
      # fox: SSH
      - nat descriptor masquerade static 1 3001 {{ fox.ip }} tcp 22
      - ipv6 filter 3001 pass * {{ fox.ipv6 }} tcp * 22
      # fox: HTTP
      - ipv6 filter 3003 pass * {{ fox.ipv6 }} tcp * 80<commit_msg>Add to switch NAT for TCP/80 to RTX<commit_after>---
# - name: Set up SSH
#   do_it_yourself_rtx_config:
#     lines:
#       - login user username password
#       - sshd host key generate
#       - sshd service on

- name: Set login
  rtx_config:
    lines:
      - login timer 3600
  tags: [rtx, rtx-login]

- name: Set security
  rtx_config:
    lines:
      - security class 2 on off off
  tags: [rtx, rtx-security]

- name: Set console
  rtx_config:
    lines:
      - console character ascii
      - console lines infinity
      - console prompt [{{ rtx.hostname }}]
  tags: [rtx, rtx-console]

- name: Set ip
  rtx_config:
    lines:
      - ip route default gateway {{ default_gateway.ip }}
      - ip keepalive 1 icmp-echo 10 5 {{ default_gateway.ip }}
      - ip lan1 address {{ lan1.ip }}/{{ lan1.netmask }}
      - ip lan1 proxyarp on
      - ip lan2 address {{ lan2.ip }}/{{ lan2.netmask }}
  tags: [rtx, rtx-ip]

- name: Set ipv6
  rtx_config:
    lines:
      - ipv6 prefix 1 ra-prefix@lan2::/64
      - ipv6 lan1 address ra-prefix@lan2::1/64
      - ipv6 lan1 rtadv send 1 o_flag=on
  tags: [rtx, rtx-ipv6]

- name: Set syslog
  rtx_config:
    lines:
      - syslog host {{ fox.ip }}
      - syslog execute command on
  tags: [rtx, rtx-syslog]

- name: Set telnet
  rtx_config:
    lines:
      - telnetd host lan1
  tags: [rtx, rtx-telnet]

- name: Set dns
  rtx_config:
    lines:
      - dns server {{ fox.ip }} {{ hotel.ip }} {{ fox.ipv6 }} {{ hotel.ipv6 }}
      - dns domain {{ domain }}
      - dns syslog resolv on
      - dns private address spoof on
  tags: [rtx, rtx-dns]

- name: Set snmp
  rtx_config:
    lines:
      - snmpv2c host any
      - snmpv2c trap community trap
      - snmpv2c trap host {{ delta.ip }}
  tags: [rtx, rtx-snmp]

- name: Set schedule
  rtx_config:
    lines:
      - schedule at 100 */* 04:52:16 * ntpdate {{ ntpd.fqdn }} syslog
      - schedule at 101 */* 10:52:16 * ntpdate {{ ntpd.fqdn }} syslog
      - schedule at 102 */* 16:52:16 * ntpdate {{ ntpd.fqdn }} syslog
      - schedule at 103 */* 22:52:16 * ntpdate {{ ntpd.fqdn }} syslog
      - schedule at 110 */Sun,Tue,Thu,Sat 4:55:58 * nat descriptor masquerade static 1 2002 {{ guppy.ip }} tcp 80
      - schedule at 111 */Mon,Wed,Fri 4:55:58 * nat descriptor masquerade static 1 2002 {{ fox.ip }} tcp 80
  tags: [rtx, rtx-schedule]

- name: Set httpd
  rtx_config:
    lines:
      - httpd host lan1
  tags: [rtx, rtx-httpd]

- name: Set sshd
  rtx_config:
    lines:
      - sshd host lan1
  tags: [rtx, rtx-sshd]

- name: Set sntpd
  rtx_config:
    lines:
      - sntpd service on
      - sntpd host lan1
  tags: [rtx, rtx-sntpd]

- name: Set ip interface secure filter
  rtx_config:
    lines:
      - ip lan1 secure filter in 100000 100001 100002 100003 100004 100005 100006 100007 100099
      # Default ip lan2 secure filter in :
      # ip lan2 secure filter in 101003 101020 101021 101022 101023 101024 101025 101030 101032 101080 101081 101082 101083
      - ip lan2 secure filter in 101003 101020 101021 101022 101023 101024 101025 101099
      - ip lan2 secure filter out 101013 101020 101021 101022 101023 101024 101025 101026 101027 101099 dynamic 101080 101081 101082 101083 101084 101085 101098 101099
      - ipv6 lan2 secure filter in 101 102 2001 2002 3001 3004 101010 101011 101012 102000
      - ipv6 lan2 secure filter out 103000 dynamic 100100 100101 100102 100103 100104 100105 100106
  tags: [rtx, rtx-port]

- name: Set the default filters
  rtx_config:
    lines:
      - ip filter 100000 reject * * udp,tcp 135 *
      - ip filter 100001 reject * * udp,tcp * 135
      - ip filter 100002 reject * * udp,tcp netbios_ns-netbios_dgm *
      - ip filter 100003 reject * * udp,tcp * netbios_ns-netbios_dgm
      - ip filter 100004 reject * * udp,tcp netbios_ssn *
      - ip filter 100005 reject * * udp,tcp * netbios_ssn
      - ip filter 100006 reject * * udp,tcp 445 *
      - ip filter 100007 reject * * udp,tcp * 445
      - ip filter 100099 pass * * * * *
      - ip filter 101000 reject 10.0.0.0/8 * * * *
      - ip filter 101001 reject 172.16.0.0/12 * * * *
      - ip filter 101002 reject 192.168.0.0/16 * * * *
      - ip filter 101003 reject 192.168.0.0/24 * * * *
      - ip filter 101010 reject * 10.0.0.0/8 * * *
      - ip filter 101011 reject * 172.16.0.0/12 * * *
      - ip filter 101012 reject * 192.168.0.0/16 * * *
      - ip filter 101013 reject * 192.168.0.0/24 * * *
      - ip filter 101020 reject * * udp,tcp 135 *
      - ip filter 101021 reject * * udp,tcp * 135
      - ip filter 101022 reject * * udp,tcp netbios_ns-netbios_ssn *
      - ip filter 101023 reject * * udp,tcp * netbios_ns-netbios_ssn
      - ip filter 101024 reject * * udp,tcp 445 *
      - ip filter 101025 reject * * udp,tcp * 445
      - ip filter 101026 restrict * * tcpfin * www,21,nntp
      - ip filter 101027 restrict * * tcprst * www,21,nntp
      - ip filter 101030 pass * 192.168.0.0/24 icmp * *
      - ip filter 101031 pass * 192.168.0.0/24 established * *
      - ip filter 101032 pass * 192.168.0.0/24 tcp * ident
      - ip filter 101033 pass * 192.168.0.0/24 tcp ftpdata *
      - ip filter 101034 pass * 192.168.0.0/24 tcp,udp * domain
      - ip filter 101035 pass * 192.168.0.0/24 udp domain *
      - ip filter 101036 pass * 192.168.0.0/24 udp * ntp
      - ip filter 101037 pass * 192.168.0.0/24 udp ntp *
      - ip filter 101080 pass * 192.168.0.1 esp * *
      - ip filter 101081 pass * 192.168.0.1 udp * 500
      # Protocol 4 is IP in IP
      - ip filter 101082 pass * 192.168.0.1 4 * *
      - ip filter 101083 pass * 192.168.0.1 udp * 4500
      - ip filter 101099 pass * * * * *
      - ip filter 500000 restrict * * * * *
      - ip filter dynamic 101080 * * ftp
      - ip filter dynamic 101081 * * domain
      - ip filter dynamic 101082 * * www
      - ip filter dynamic 101083 * * smtp
      - ip filter dynamic 101084 * * pop3
      - ip filter dynamic 101085 * * submission
      - ip filter dynamic 101098 * * tcp
      - ip filter dynamic 101099 * * udp
      - ipv6 filter 101010 pass * * icmp6 * *
      - ipv6 filter 101011 pass * * tcp * ident
      - ipv6 filter 101012 pass * * udp * 546
      - ipv6 filter 102000 reject * * * * *
      - ipv6 filter 103000 pass * * * * *
      - ipv6 filter dynamic 100100 * * ftp
      - ipv6 filter dynamic 100101 * * domain
      - ipv6 filter dynamic 100102 * * www
      - ipv6 filter dynamic 100103 * * smtp
      - ipv6 filter dynamic 100104 * * pop3
      - ipv6 filter dynamic 100105 * * tcp
      - ipv6 filter dynamic 100106 * * udp
  tags: [rtx, rtx-port]

- name: Open ports
  rtx_config:
    lines:
      - ip lan2 nat descriptor 1
      - nat descriptor type 1 masquerade
      - nat descriptor address outer 1 primary
      # guppy: Synology DSM
      - nat descriptor masquerade static 1 2001 {{ guppy.ip }} tcp 5000,5010
      - ipv6 filter 2001 pass * {{ guppy.ipv6 }} tcp * 5000,5001
      # guppy: HTTP
      - ipv6 filter 2002 pass * {{ guppy.ipv6 }} tcp * 80
      # fox: SSH
      - nat descriptor masquerade static 1 3001 {{ fox.ip }} tcp 22
      - ipv6 filter 3001 pass * {{ fox.ipv6 }} tcp * 22
      # fox: HTTP
      - ipv6 filter 3003 pass * {{ fox.ipv6 }} tcp * 80
{'fraction_non_alphanumeric': 0.10272242492281786, 'fraction_numerical': 0.1600477126017401, 'mean_word_length': 2.104552385101285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 40, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '205641', 'n_tokens_mistral': 6793, 'n_tokens_neox': 5034, 'n_words': 1631}