Ik wil vgl. mij iets heel simpels:
internet <---> firewall <----> lan <----> pop3-server
Ik wil van buitenaf verbinden met poort 110 van mijn pop3-server op het interne netwerk (192.168.12.145)
Op mijn FreeBSD draait een kernel met ipfilter. Dit werkt. Mijn stations kunnen gewoon internetten, ftp-en, mirc-en en noem maar op.
Dit is mijn ipf.rules:
In mijn ipnat.rules staat
Als ik nu probeer te telnetten naar het ip-adres van mijn firewall (buitenkant) op poort 110 gebeurt er nix.
Als ik met ipnat -l kijk, dan zie ik echter wel een verbinding . . .
Wat zie ik over het hoofd?
internet <---> firewall <----> lan <----> pop3-server
Ik wil van buitenaf verbinden met poort 110 van mijn pop3-server op het interne netwerk (192.168.12.145)
Op mijn FreeBSD draait een kernel met ipfilter. Dit werkt. Mijn stations kunnen gewoon internetten, ftp-en, mirc-en en noem maar op.
Dit is mijn ipf.rules:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| ################################################################# # Outside Interface ################################################################# #---------------------------------------------------------------- # Allow out all TCP, UDP, and ICMP traffic & keep state on it # so that it's allowed back in. #---------------------------------------------------------------- pass out quick on xl1 proto tcp from any to any keep state pass out quick on xl1 proto udp from any to any keep state pass out quick on xl1 proto icmp from any to any keep state block out quick on xl1 all #---------------------------------------------------------------- # Allow bootp traffic in from your ISP's DHCP server only. #---------------------------------------------------------------- # pass in quick on xl1 proto udp from X.X.X.X/32 to any port = 68 keep state #-- # onze eigen regeltjes en mappings #-- #---------------------------------------------------------------- # ftp #---------------------------------------------------------------- pass in quick proto tcp from any to any port = 21 flags S keep state #--- # pop3 #--- pass in quick proto tcp from any to any port = 110 flags S keep state #---------------------------------------------------------------- # Block and log all remaining traffic coming into the firewall # - Block TCP with a RST (to make it appear as if the service # isn't listening) # - Block UDP with an ICMP Port Unreachable (to make it appear # as if the service isn't listening) # - Block all remaining traffic the good 'ol fashioned way #-------------------------------------------------------------- block return-rst in log quick on xl1 proto tcp from any to any block return-icmp-as-dest(port-unr) in log quick on xl1 proto udp from any to any block in log quick on xl1 all ################################################################# # Inside Interface ################################################################# #---------------------------------------------------------------- # Allow out all TCP, UDP, and ICMP traffic & keep state #---------------------------------------------------------------- pass out quick on xl0 proto tcp from any to any keep state pass out quick on xl0 proto udp from any to any keep state pass out quick on xl0 proto icmp from any to any keep state block out quick on xl0 all #---------------------------------------------------------------- # Allow in all TCP, UDP, and ICMP traffic & keep state #---------------------------------------------------------------- pass in quick on xl0 proto tcp from any to any keep state pass in quick on xl0 proto udp from any to any keep state pass in quick on xl0 proto icmp from any to any keep state block in quick on xl0 all ################################################################# # Loopback Interface ################################################################# #---------------------------------------------------------------- # Allow everything to/from your loopback interface so you # can ping yourself (e.g. ping localhost) #---------------------------------------------------------------- pass in quick on lo0 all pass out quick on lo0 all |
In mijn ipnat.rules staat
code:
1
2
| map xl1 192.168.12.0/24 -> 0/32 rdr xl1 0.0.0.0/0 port 110 -> 192.168.12.145 port 110 |
Als ik nu probeer te telnetten naar het ip-adres van mijn firewall (buitenkant) op poort 110 gebeurt er nix.
Als ik met ipnat -l kijk, dan zie ik echter wel een verbinding . . .
Wat zie ik over het hoofd?