webForumDet fria alternativet

Tillåta shell/ftp/webb utifrån?

Linux & BSDur Mac OS, Unix, Linux & BSD

0 svar · 184 visningar · startad av Qimen

Medlem sedan juni 20015 009 inlägg
Frågan#1

Hur ska jag göra för att tillåta det i FreeBSD?
Har konfigurerat burken på detta sätt.
Jag har satt upp en ftpserver och den funkar perfekt inom nätverket. Mitt nätverkskort utåt heter rl0 och interna ed0.

ipf.rules skrev:

pass out quick on rl0 proto tcp from any to any keep state
pass out quick on rl0 proto udp from any to any keep state
pass out quick on rl0 proto icmp from any to any keep state
pass in quick on rl0 proto tcp from any to any port = 80 flags S keep state keep frags
#block out quick on rl0 all

#block in log quick on rl0 from 192.168.0.0/16 to any
#block in log quick on rl0 from 172.16.0.0/12 to any
#block in log quick on rl0 from 10.0.0.0/8 to any
#block in log quick on rl0 from 127.0.0.0/8 to any
#block in log quick on rl0 from 0.0.0.0/8 to any
#block in log quick on rl0 from 169.254.0.0/17 to any
#block in log quick on rl0 from 192.0.2.0/24 to any
#block in log quick on rl0 from 204.152.64.0/23 to any
#block in quick on rl0 from 224.0.0.0/3 to any

pass in quick on rl0 proto udp from 10.0.0.1/32 to any port = 68 keep state

#block return-rst in log quick on rl0 proto tcp from any to any
#block return-icmp-as-dest(port-unr) in log quick on rl0 proto udp from any to any
#block in log quick on ed0 all

#### Interface in

pass out quick on ed0 proto tcp from any to any keep state
pass out quick on ed0 proto udp from any to any keep state
pass out quick on ed0 proto icmp from any to any keep state
#block out quick on ed0 all

pass in quick on ed0 proto tcp from any to any keep state
pass in quick on ed0 proto udp from any to any keep state
pass in quick on ed0 proto icmp from any to any keep state
#block in quick on ed0 all

#### Loopback

pass in quick on lo0 all
pass out quick on lo0 all

För tillfället har jag kommenterat bort alla block för att få allt att funka först. Min ipnat.rules

ipnat.rules skrev:

map rl0 192.168.0.0/24 -> 0/32 portmap tcp/udp auto
rdr rl0 0.0.0.0/0 port 80 -> 192.168.0.1 port 80 tcp
map rl0 192.168.0.0/24 -> 0/32

För tillfället löste jag problemmet att helt enkelt porta port 80 till samma ip för webbservn men det borde väl finnas smartare sätt?
Hur löser jag detta på ett smart sätt? :)

130 ms totalt · 3 externa anrop · v20260731065814-full.25f56b17
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
128 ms — hämta tråd, inlägg och bilagor (db)