Forum » Operacijski sistemi » Kratek uvod v FreeBSD
Kratek uvod v FreeBSD
slovencl ::
V navodilih za ipfw piše: "Each new rule has to have a rule number to go with it", ampak zakaj MrBrdo v svojih navodilih ni uporabil niti ene številke pravila? A je treba posat številke al ne?
Kaj pomeni v pravilu če je poleg ip-ja še številka za "/", npr. 192.168.0.0/16, kaj je ta 16, številka porta?
Kaj pomeni v pravilu če je poleg ip-ja še številka za "/", npr. 192.168.0.0/16, kaj je ta 16, številka porta?
slovencl ::
V handbooku sem bral, da če imaš lan moraš imeti pravilo:
$cmd 00005 allow all from any to any via xl0 (xl0 je lan NIC interface)
# No restrictions on Inside LAN Interface for private network
Zdej mi pa ni jasno zakaj je to treba, saj pakete po lokalnem omrežju razporeja switch in ne FreeBsd?
Ni mi jasno tudi čemu služi to pravilo. Kaj je to lo0?
$cmd 00010 allow all from any to any via lo0
# No restrictions on Loopback Interface
$cmd 00005 allow all from any to any via xl0 (xl0 je lan NIC interface)
# No restrictions on Inside LAN Interface for private network
Zdej mi pa ni jasno zakaj je to treba, saj pakete po lokalnem omrežju razporeja switch in ne FreeBsd?
Ni mi jasno tudi čemu služi to pravilo. Kaj je to lo0?
$cmd 00010 allow all from any to any via lo0
# No restrictions on Loopback Interface
Zgodovina sprememb…
- spremenil: slovencl ()
Kami ::
Switch? Ne.
1. Če maš ta server kot gateway, potem ta server skrbi, switch je samo za delenjenje internetne povezave.
2. lo0 je localhost
1. Če maš ta server kot gateway, potem ta server skrbi, switch je samo za delenjenje internetne povezave.
2. lo0 je localhost
slovencl ::
Ok, prvo vprašanje sem ml zabluzil
Kaj pa potem sploh dela ta localhost (v wikipediji sem že gledal kaj je localhost)? A je nujen da zadeva funkcionira?
Zanima me še, ali je možno da se povežem na ta komp, kjer imam naložen freebsd, in opravljam z njim z nekega kompa v lokalnem omrežju (winxp), da pišem v konzolo, rebootam itd, da mi ni treba ves čas hodit tja in pisat? Kako?
Kaj pa potem sploh dela ta localhost (v wikipediji sem že gledal kaj je localhost)? A je nujen da zadeva funkcionira?
Zanima me še, ali je možno da se povežem na ta komp, kjer imam naložen freebsd, in opravljam z njim z nekega kompa v lokalnem omrežju (winxp), da pišem v konzolo, rebootam itd, da mi ni treba ves čas hodit tja in pisat? Kako?
Zgodovina sprememb…
- spremenil: slovencl ()
trs ::
@slovencl
lo0 je loopback device, ki je navidezna mrezna kartica za komuniciranje med procesi lokalno (torej na isti masini). To moras imet vklopljeno sicer marsikateri program ti ne bo delal. Za lokalno omrezje pa tisti ruli nimajo veze, dovolit moras samo da se racunalniki lahko connectajo na serverjev IP. Torej nekaj v stilu (trenutno nimam cajta pogleda IPFW rulov, ker se mi rahlo mudi ...)
ipfw add 100 allow ip from 192.168.0/24 to me in recv rl0
ipfw add 101 allow ip from me to 192.168.0/24 out recv rl0
S tem da nadomest 192.168.0/24 z ustreznim networkom za tvoje interno omrezje ter rl0 z mrezno kartico ki je na internem omrezju, ne pa na ADSLju.
Iz WinXP boxa lahko dostopas s SSHjem, za to moras vklopit SSH daemon s tole vrstico v /etc/rc.conf:
sshd_enable="YES"
Rabis se SSH client za WinXP. Na voljo jih imas vec, jaz pa uporabljam putty: http://www.chiark.greenend.org.uk/~sgta...
Pazi da pri povezavi izberes SSH, ne pa telnet. Po defaultu se ne mores logirat kot root, zato ti priporocam da si naredis userja in uporabis "su" ukaz da se das v root userja.
lp,
trs
lo0 je loopback device, ki je navidezna mrezna kartica za komuniciranje med procesi lokalno (torej na isti masini). To moras imet vklopljeno sicer marsikateri program ti ne bo delal. Za lokalno omrezje pa tisti ruli nimajo veze, dovolit moras samo da se racunalniki lahko connectajo na serverjev IP. Torej nekaj v stilu (trenutno nimam cajta pogleda IPFW rulov, ker se mi rahlo mudi ...)
ipfw add 100 allow ip from 192.168.0/24 to me in recv rl0
ipfw add 101 allow ip from me to 192.168.0/24 out recv rl0
S tem da nadomest 192.168.0/24 z ustreznim networkom za tvoje interno omrezje ter rl0 z mrezno kartico ki je na internem omrezju, ne pa na ADSLju.
Iz WinXP boxa lahko dostopas s SSHjem, za to moras vklopit SSH daemon s tole vrstico v /etc/rc.conf:
sshd_enable="YES"
Rabis se SSH client za WinXP. Na voljo jih imas vec, jaz pa uporabljam putty: http://www.chiark.greenend.org.uk/~sgta...
Pazi da pri povezavi izberes SSH, ne pa telnet. Po defaultu se ne mores logirat kot root, zato ti priporocam da si naredis userja in uporabis "su" ukaz da se das v root userja.
lp,
trs
slovencl ::
Ok, zdej ssh mi deluje (btw, uporabnika, ki ga je potrebno ustravriti mora biti v skupini "wheel", sicer ob ukazu su ne deluje).
Firewall sem naredil nekako tako kot piše v handbooku (koda spodaj), in internet v LAN-u mi deluje, vendar se mi zdi da ne tako kot bi moral.
Če pingam ven z freebsd kompa mi napiše: permision denied, z ostalih kompov v mreži pa lahko pingam ven. Tudi če ukaz $cmd 00250 allow icmp from any to any out via $pif keep-state vržem ven, še vedno lahko pingam s kompov v mreži.
Če pingam freebsd komp od zunaj, ta nebi smel odgovarjat, ker imam $cmd 00310 deny log icmp from any to any in via $pif, ampak ta odgovarja na ping. Če prav razumem, bi moral log napisati ven na konzoli, pa nič ne naredi. Kje lahko preberem loge - v /etc/syslog.conf?
Ni mi najbolj jasno tudi kaj dela check-state in keep-state, to naj bi bilo za nekakšna dinamična pravila. Kje pa je kaj dinamičnega, saj se nič ne spreminja?
Kako je z $cmd ipdiver natd, a je potrebno pri ppp_nat to nadomestit s čim drugim?
/etc/ipfw.rules
cmd="ipfw -q add"
pif="rl1" #public interface
lif="rl0" #LAN interface
ipfw -q -f flush
$cmd 00001 check-state #xxxxxxx
$cmd 00002 allow all from any to any via $lif keep-state #xxxxxxxx
$cmd 00003 allow all from any to any via lo0
# dovoli ven dostop do DNS serverjev
$cmd 00110 allow tcp from any to 193.189.160.11 53 out via $pif setup keep-state
$cmd 00111 allow udp from any to 193.189.160.11 53 out via $pif keep-state
$cmd 00112 allow tcp from any to 193.189.160.12 53 out via $pif setup keep-state
$cmd 00113 allow udp from any to 193.189.160.12 53 out via $pif keep-state
# dovoli ven internet (www) - port 80
$cmd 00200 allow tcp from any to any 80 out via $pif setup keep-state
# dovoli ven https cez TLS SSL - port 443
$cmd 00220 allow tcp from any to any 443 out via $pif setup keep-state
# dovoli ven posiljanje in sprejemanje e-mejla - port 25=e-mail, port 110=pop3
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# dovoli ven pinganje
$cmd 00250 allow icmp from any to any out via $pif keep-state
# dovoli ven Time - port 37
$cmd 00260 allow tcp from any to any 37 out via $pif setup keep-state
# dovoli ven nntp news - port 119
$cmd 00270 allow tcp from any to any 119 out via $pif setup keep-state
# dovoli ven varen ftp, telnet in SCP - port 22
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
# dovoli ven whois - port 43
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# zavrne ven vse ostalo in zapise kaj je kdo hotel
$cmd 00299 deny log all from any to any out via $pif
# zvrne not ves promet ki ni v mejah obicajnih ip naslovov
$cmd 00300 deny all from 192.168.0.0/16 to any in via $pif
$cmd 00301 deny all from 172.16.0.0/12 to any in via $pif
$cmd 00302 deny all from 10.0.0.0/3 to any in via $pif
$cmd 00303 deny all from 127.0.0.0/8 to any in via $pif
$cmd 00304 deny all from 0.0.0.0/8 to any in via $pif
$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif
$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif
$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif
# zavrne not ping
$cmd 00310 deny log icmp from any to any in via $pif
# zavrne not ident - port 113
$cmd 00315 deny log tcp from any to any 113 in via $pif
# zvrne not Netbios Services
$cmd 00320 deny tcp from any to any 137 in via $pif
$cmd 00321 deny tcp from any to any 138 in via $pif
$cmd 00322 deny tcp from any to any 139 in via $pif
$cmd 00323 deny tcp from any to any 81 in via $pif
# zavrne not vse zakasnele pakete ??
$cmd 00300 deny all from any to any frag in via $pif
# zavrne not ACK... ??
$cmd 00332 deny all from any to any established in via $pif
# zavrne not vse ostalo in zapise kaj je kdo hotel
$cmd 00499 deny log all from any to any in via $pif
# zavrne vse ostalo
$cmd 00999 deny all from any to any
Firewall sem naredil nekako tako kot piše v handbooku (koda spodaj), in internet v LAN-u mi deluje, vendar se mi zdi da ne tako kot bi moral.
Če pingam ven z freebsd kompa mi napiše: permision denied, z ostalih kompov v mreži pa lahko pingam ven. Tudi če ukaz $cmd 00250 allow icmp from any to any out via $pif keep-state vržem ven, še vedno lahko pingam s kompov v mreži.
Če pingam freebsd komp od zunaj, ta nebi smel odgovarjat, ker imam $cmd 00310 deny log icmp from any to any in via $pif, ampak ta odgovarja na ping. Če prav razumem, bi moral log napisati ven na konzoli, pa nič ne naredi. Kje lahko preberem loge - v /etc/syslog.conf?
Ni mi najbolj jasno tudi kaj dela check-state in keep-state, to naj bi bilo za nekakšna dinamična pravila. Kje pa je kaj dinamičnega, saj se nič ne spreminja?
Kako je z $cmd ipdiver natd, a je potrebno pri ppp_nat to nadomestit s čim drugim?
/etc/ipfw.rules
cmd="ipfw -q add"
pif="rl1" #public interface
lif="rl0" #LAN interface
ipfw -q -f flush
$cmd 00001 check-state #xxxxxxx
$cmd 00002 allow all from any to any via $lif keep-state #xxxxxxxx
$cmd 00003 allow all from any to any via lo0
# dovoli ven dostop do DNS serverjev
$cmd 00110 allow tcp from any to 193.189.160.11 53 out via $pif setup keep-state
$cmd 00111 allow udp from any to 193.189.160.11 53 out via $pif keep-state
$cmd 00112 allow tcp from any to 193.189.160.12 53 out via $pif setup keep-state
$cmd 00113 allow udp from any to 193.189.160.12 53 out via $pif keep-state
# dovoli ven internet (www) - port 80
$cmd 00200 allow tcp from any to any 80 out via $pif setup keep-state
# dovoli ven https cez TLS SSL - port 443
$cmd 00220 allow tcp from any to any 443 out via $pif setup keep-state
# dovoli ven posiljanje in sprejemanje e-mejla - port 25=e-mail, port 110=pop3
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# dovoli ven pinganje
$cmd 00250 allow icmp from any to any out via $pif keep-state
# dovoli ven Time - port 37
$cmd 00260 allow tcp from any to any 37 out via $pif setup keep-state
# dovoli ven nntp news - port 119
$cmd 00270 allow tcp from any to any 119 out via $pif setup keep-state
# dovoli ven varen ftp, telnet in SCP - port 22
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
# dovoli ven whois - port 43
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# zavrne ven vse ostalo in zapise kaj je kdo hotel
$cmd 00299 deny log all from any to any out via $pif
# zvrne not ves promet ki ni v mejah obicajnih ip naslovov
$cmd 00300 deny all from 192.168.0.0/16 to any in via $pif
$cmd 00301 deny all from 172.16.0.0/12 to any in via $pif
$cmd 00302 deny all from 10.0.0.0/3 to any in via $pif
$cmd 00303 deny all from 127.0.0.0/8 to any in via $pif
$cmd 00304 deny all from 0.0.0.0/8 to any in via $pif
$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif
$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif
$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif
# zavrne not ping
$cmd 00310 deny log icmp from any to any in via $pif
# zavrne not ident - port 113
$cmd 00315 deny log tcp from any to any 113 in via $pif
# zvrne not Netbios Services
$cmd 00320 deny tcp from any to any 137 in via $pif
$cmd 00321 deny tcp from any to any 138 in via $pif
$cmd 00322 deny tcp from any to any 139 in via $pif
$cmd 00323 deny tcp from any to any 81 in via $pif
# zavrne not vse zakasnele pakete ??
$cmd 00300 deny all from any to any frag in via $pif
# zavrne not ACK... ??
$cmd 00332 deny all from any to any established in via $pif
# zavrne not vse ostalo in zapise kaj je kdo hotel
$cmd 00499 deny log all from any to any in via $pif
# zavrne vse ostalo
$cmd 00999 deny all from any to any
Zgodovina sprememb…
- spremenil: slovencl ()
trs ::
@slovencl
Poskusi nadomestit public interface rl1 z tun0. rl1 sluzi samo za posiljanje PPP over Ethernet paketov, tun0 pa je pravi interface skozi katerega potujejo IP paketki. Torej tvoj public interface je tun0.
Rule bom pogledal zvecer ko bom imel vec cajta ...
lp,
trs
Poskusi nadomestit public interface rl1 z tun0. rl1 sluzi samo za posiljanje PPP over Ethernet paketov, tun0 pa je pravi interface skozi katerega potujejo IP paketki. Torej tvoj public interface je tun0.
Rule bom pogledal zvecer ko bom imel vec cajta ...
lp,
trs
trs ::
@slovencl
Aja, pa se tole, keep-state je za takoimenovani stateful firewall. Ce imas staticne rule, potem moras dovolit promet ven in promet not, ne mores pa ga filtrirat glede na connection. Stateful firewall si zapomne da si se sconnectal ven in dovoli vse paketke v zvezi s tem connectionom, kar je cool stvar.
Divert ruleov za ppp_nat pa ne rabis, ker za to poskrbi ze sam PPP.
Pa se nekaj o PPPoE:
Iz ADSL modema ti dobis PPPoE (PPP over Ethernet) paketke na rl1. To je IP protokol, ki je enkapsuliran v PPP protokol, ki so enkapsulirani v ethernet protokol. PPP daemon jih "razpakira" in poslje dalje samo IP paketke preko tun0, sproti pa dela se NAT. Tako da firewall moras postavit na tun0, ne na rl1.
lp,
trs
Aja, pa se tole, keep-state je za takoimenovani stateful firewall. Ce imas staticne rule, potem moras dovolit promet ven in promet not, ne mores pa ga filtrirat glede na connection. Stateful firewall si zapomne da si se sconnectal ven in dovoli vse paketke v zvezi s tem connectionom, kar je cool stvar.
Divert ruleov za ppp_nat pa ne rabis, ker za to poskrbi ze sam PPP.
Pa se nekaj o PPPoE:
Iz ADSL modema ti dobis PPPoE (PPP over Ethernet) paketke na rl1. To je IP protokol, ki je enkapsuliran v PPP protokol, ki so enkapsulirani v ethernet protokol. PPP daemon jih "razpakira" in poslje dalje samo IP paketke preko tun0, sproti pa dela se NAT. Tako da firewall moras postavit na tun0, ne na rl1.
lp,
trs
slovencl ::
Zdej sem spremenil na "tun0" in boljše deluje, ampak še vedno ne kot sem si zamislil - če onemogočim pinganje navzven (zbrišem allow icmp from any to any out via $pif) in hočem pingat s freebsd kompa ven, mi napiše "permision denied" in mi v /var/log/security tudi napiše da ni dovolil pinganja (če pinganje dovolim, potem s freebsd kompa lahko pingam ven), če pa grem na en komp v domačem omrežju pa lahko pingam navzven, zakaj to? A ne bi moral s tem omejiti pingnje s celotnega domačega omrežja?
A je možno narediti, da ima freebsd več načinov delovanja, med katerimi preklaplja sam glede na uro - npr. ponoči omogoči mulo (preusmeri promet z določenega porta), podnevi pa ne?
A je možno narediti, da ima freebsd več načinov delovanja, med katerimi preklaplja sam glede na uro - npr. ponoči omogoči mulo (preusmeri promet z določenega porta), podnevi pa ne?
ZlobneZ ::
Zdravo!
sedaj imam eno staro racunalo, ki mi je do sedaj sluzilo kot "server" (http, ftp, ...) in neke vrste prehod (ena mrezna na net, druga pa na PC) .. sedaj pa bi rad naredil tako da bi mi sluzil kot neke vrste router, oz. da bi notri dal 4 mrezne (ena za net, tri pa za lokalno mrezo, ter bi potem "server" razporejal paketke sem pa tja) ..
je to izvedljivo? in ce je kk bi to naredil? je na enak nacin kot imam do sedaj (2 mrezni, ena na net, druga na PC), razen da se drugima dvema dolocim IP, ali je potrebno se kaj drugega spremeniti /dodati, v konfiguracijski fajl, preden recompajlam kernel?
aha, pa se eno vprasanje, kk je pa s tem da bi sedaj vse skupaj bilo na net prikljuceno preko ADSL linije, saj je bilo do sedaj preko kabla. Je kaksna razlika?
hvala za odgovore,
m.
sedaj imam eno staro racunalo, ki mi je do sedaj sluzilo kot "server" (http, ftp, ...) in neke vrste prehod (ena mrezna na net, druga pa na PC) .. sedaj pa bi rad naredil tako da bi mi sluzil kot neke vrste router, oz. da bi notri dal 4 mrezne (ena za net, tri pa za lokalno mrezo, ter bi potem "server" razporejal paketke sem pa tja) ..
je to izvedljivo? in ce je kk bi to naredil? je na enak nacin kot imam do sedaj (2 mrezni, ena na net, druga na PC), razen da se drugima dvema dolocim IP, ali je potrebno se kaj drugega spremeniti /dodati, v konfiguracijski fajl, preden recompajlam kernel?
aha, pa se eno vprasanje, kk je pa s tem da bi sedaj vse skupaj bilo na net prikljuceno preko ADSL linije, saj je bilo do sedaj preko kabla. Je kaksna razlika?
hvala za odgovore,
m.
slovencl ::
Nastavil sem pravila za dummynet (koda spodaj) ampak sploh ne deluje. Ne glede na to pod katerim ip-jem se povežem imam poln dostop, tudi če se povežem iz 192.168.0.205, kjer sem promet omejil na nič, internet še vedno deluje.
Kam moram postviti ta pravila, ali je vseeno kje so?
cmd="ipfw -q add"
pif="tun0" #public interface
lif="rl0" #LAN interface
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00001 check-state
$cmd 00003 allow all from 192.168.0.202 to any via $lif keep-state
$cmd 00004 allow all from 192.168.0.203 to any via $lif keep-state
$cmd 00005 allow all from 192.168.0.204 to any via $lif keep-state
$cmd 00006 allow all from 192.168.0.205 to any via $lif keep-state
$cmd 00010 allow all from any to any via lo0
#-------------------------------------------------------------------------
# DUMMYNET
#-------------------------------------------------------------------------
$cmd 00021 pipe 1 ip from 192.168.0.202 to any out
$cmd 00022 pipe 2 ip from any to 192.168.0.202 in
ipfw pipe 1 config mask src-ip 0x000000ff bw 20Kbit/s queue 10Kbytes
ipfw pipe 2 config mask dst-ip 0x000000ff bw 20Kbit/s queue 10Kbytes
$cmd 00025 pipe 3 ip from 192.168.0.203 to any out
$cmd 00026 pipe 4 ip from any to 192.168.0.203 in
ipfw pipe 3 config mask src-ip 0x000000ff bw 200Kbit/s queue 10Kbytes
ipfw pipe 4 config mask dst-ip 0x000000ff bw 40Kbit/s queue 10Kbytes
$cmd 00029 pipe 5 ip from 192.168.0.204 to any out
$cmd 00030 pipe 6 ip from any to 192.168.0.204 in
ipfw pipe 5 config mask src-ip 0x000000ff bw 1500Kbit/s queue 10Kbytes
ipfw pipe 6 config mask dst-ip 0x000000ff bw 300Kbit/s queue 10Kbytes
$cmd 00033 pipe 7 ip from 192.168.0.205 to any out
$cmd 00034 pipe 8 ip from any to 192.168.0.205 in
ipfw pipe 7 config mask src-ip 0x000000ff bw 0Kbit/s queue 10Kbytes
ipfw pipe 8 config mask dst-ip 0x000000ff bw 0Kbit/s queue 10Kbytes
Kam moram postviti ta pravila, ali je vseeno kje so?
cmd="ipfw -q add"
pif="tun0" #public interface
lif="rl0" #LAN interface
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00001 check-state
$cmd 00003 allow all from 192.168.0.202 to any via $lif keep-state
$cmd 00004 allow all from 192.168.0.203 to any via $lif keep-state
$cmd 00005 allow all from 192.168.0.204 to any via $lif keep-state
$cmd 00006 allow all from 192.168.0.205 to any via $lif keep-state
$cmd 00010 allow all from any to any via lo0
#-------------------------------------------------------------------------
# DUMMYNET
#-------------------------------------------------------------------------
$cmd 00021 pipe 1 ip from 192.168.0.202 to any out
$cmd 00022 pipe 2 ip from any to 192.168.0.202 in
ipfw pipe 1 config mask src-ip 0x000000ff bw 20Kbit/s queue 10Kbytes
ipfw pipe 2 config mask dst-ip 0x000000ff bw 20Kbit/s queue 10Kbytes
$cmd 00025 pipe 3 ip from 192.168.0.203 to any out
$cmd 00026 pipe 4 ip from any to 192.168.0.203 in
ipfw pipe 3 config mask src-ip 0x000000ff bw 200Kbit/s queue 10Kbytes
ipfw pipe 4 config mask dst-ip 0x000000ff bw 40Kbit/s queue 10Kbytes
$cmd 00029 pipe 5 ip from 192.168.0.204 to any out
$cmd 00030 pipe 6 ip from any to 192.168.0.204 in
ipfw pipe 5 config mask src-ip 0x000000ff bw 1500Kbit/s queue 10Kbytes
ipfw pipe 6 config mask dst-ip 0x000000ff bw 300Kbit/s queue 10Kbytes
$cmd 00033 pipe 7 ip from 192.168.0.205 to any out
$cmd 00034 pipe 8 ip from any to 192.168.0.205 in
ipfw pipe 7 config mask src-ip 0x000000ff bw 0Kbit/s queue 10Kbytes
ipfw pipe 8 config mask dst-ip 0x000000ff bw 0Kbit/s queue 10Kbytes
karantan ::
imam problem pri ipfw. nastimau sm allow ip from any to any sam se vsen ne morm igrt age of empires prek neta. ce jest postavm server za aoe ga drugi ne vidjo (lan ga vid) ce ga pa drugi postavjo ga pa jest ne vidm...
fbsd# ipfw list
00005 allow ip from any to any via rl1
00010 allow ip from any to any via lo0
00110 allow tcp from any to 193.189.160.11 dst-port 53 out via tun0 setup keetate
00111 allow udp from any to 193.189.160.12 dst-port 53 out via tun0 keep-stat
00250 allow icmp from any to any out via tun0 keep-state
00260 allow tcp from any to any dst-port 37 out via tun0 setup keep-state
07000 allow ip from any to any
65535 deny ip from any to any
ce vm bo tole kj pomagal
fbsd# ipfw list
00005 allow ip from any to any via rl1
00010 allow ip from any to any via lo0
00110 allow tcp from any to 193.189.160.11 dst-port 53 out via tun0 setup keetate
00111 allow udp from any to 193.189.160.12 dst-port 53 out via tun0 keep-stat
00250 allow icmp from any to any out via tun0 keep-state
00260 allow tcp from any to any dst-port 37 out via tun0 setup keep-state
07000 allow ip from any to any
65535 deny ip from any to any
ce vm bo tole kj pomagal
If you don't understand something, please read Help. If you still don't understand something, please read help again.
Diplomat ::
A je možno narediti, da ima freebsd več načinov delovanja, med katerimi preklaplja sam glede na uro - npr. ponoči omogoči mulo (preusmeri promet z določenega porta), podnevi pa ne?
Mozno je s skriptami urediti tudi ta nacin, kar se pa tice tvojega dummyneta je pa tako:
${fwcmd} pipe 2 config bw 32Kbit/s queue 6Kbytes
${fwcmd} pipe 3 config bw 64Kbit/s queue 12Kbytes
${fwcmd} pipe 4 config bw 128Kbit/s queue 24Kbytes
${fwcmd} pipe 5 config bw 256Kbit/s queue 32Kbytes
${fwcmd} add 5000 pipe 3 from 192.168.0.2 to ${onet}:${omask}
${fwcmd} add 5001 pipe 2 from ${onet}:${omask} to 192.168.0.2
Na ta nacin je meni delovalo, vendar na ta nacin ki ga uporabljam zdaj mi ne dela. Vsaj ta rul ni prov spisan za moj net.
Zgodovina sprememb…
- spremenilo: Diplomat ()
slovencl ::
A je potrebno kaj dodatno nastavljati, da se bsd avtomatsko ponovno poveže na siol, saj naj bi se povezava vsakodnevno za kratek čas prekinila in se spremenil ip (če je dinamičen).
andyrozman ::
Nerdor je napisal:
Opišite malo, kakšne so vaše izkušnje z BSD. Moje so na kratko: "Smotan, a stabilen"
No jaz uporabljam FreeBSD že precej časa, mislim, da okoli 5 let sedaj. Dolgo časa sem ga uporabljal kot internetni strežnik (na začetku na P1 100Mhz), sedaj zadnje čase pa tudi kot desktop OS.
Sicer je res kar so kolegi rekli, da pač ne podpira novega hardwarea, vendar pa se včasih zgodi, da kakšne stvari podprejo (SATA, WLAN,...). Sem hotel na sluzbeni računalnik instalirat Linux, in vzamem Redhat mislim, da 3ko in sem hotel instalirat. Sistem je imel neko čudno plato (Soltek) in SATA disk. Vse se lepo štarta, setup mi pokaže disk, ga izberem nastravim mount pointe in vse to sranje in potem ko mu rečem, da naj vse skupaj zapiše setup crkne. Sem sprobal nekajkrat a ne dela. Potem sem pogledal malo po netu in sem ugotovil, da linux zahteva neki feature, ki ga moj motherboard nima v BIOsu. Seveda zelo jezen, vzamem FreeBSD vrzem not, da pač vidim kaj bo BSD naredil in instalacija gre mimo. Bil sem zelo šokiran seveda, saj kot smo zgoraj rekli, BSD ne podpira novega hardwarea. Zgleda da se kar trudijo, da bi podprli vsaj nujen hardware, ki ga user potrebuje, tako da ni panike.
No meni FBSD ni smotan, ker sem se že navadil na njega, vendar pa kaki linux (ali pa tudi windows) freak ne bi bil z njem preveč zadovoljen, saj je priližno grd, manjkajo mu razni tooli, da nastavitve in podobne stvari, čeprav če veš kako, se da marsikaj naredit. Mogoče ena od dobrih stvari so ports in packages. Ports je način kako zbildaš ražne aplikacije, s popravki za BSD, packages pa da te iste aplikacije kar instaliras in so že zbildane.
No to je z moje strani, o FreeBSDju.
Andy
slovencl ::
Poskusil sem tudi to kar je predlagal diplomat, in še vedno ne dela. Se mi zdi da imam pravila za dummynet postavljena na napačno mesto, ker če jih dam na začetek, mi zavrne vse, če pa na konec, pa jih sploh ne šmirgla. A ima kdo primer celotnega ipfw z dumynet pravili, sem že vse obrnil, pa ne najdem. Sedaj imam tole:
cmd="ipfw -q add"
pif="tun0" #public interface
lif="rl0" #LAN interface
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00010 allow all from any to any via lo0
#-----------------------------------------------------------------
# DUMMYNET
#-----------------------------------------------------------------
$cmd 00051 pipe 1 ip from 192.168.0.202 to any out via $pif
$cmd 00052 pipe 2 ip from any to 192.168.0.202 in via $pif
ipfw pipe 1 config bw 100Kbit/s
ipfw pipe 2 config bw 50Kbit/s
$cmd 00053 pipe 3 ip from 192.168.0.203 to any out via $pif
$cmd 00054 pipe 4 ip from any to 192.168.0.203 in via $pif
ipfw pipe 3 config bw 500Kbit/s
ipfw pipe 4 config bw 100KBit/s
$cmd 00055 pipe 5 ip from 192.168.0.204 to any out via $pif
$cmd 00056 pipe 6 ip from any to 192.168.0.204 in via $pif
ipfw pipe 5 config bw 1500Kbit/s
ipfw pipe 6 config bw 200Kbit/s
#-----------------------------------------------------------------
# KDO IMA INTERNET
#-----------------------------------------------------------------
$cmd 00042 allow all from 192.168.0.2 to any via $lif
$cmd 00043 allow all from 192.168.0.202 to any via $lif
$cmd 00044 allow all from 192.168.0.203 to any via $lif
$cmd 00045 allow all from 192.168.0.204 to any via $lif
#---------------------------------------------------------------------------
$cmd 00070 check-state
#stop spoofing ???
$cmd 00080 deny log all from 192.168.0.0/24:255.255.255.0 to any in via $pif
$cmd 00081 deny log all from 192.168.0.0/24:255.255.255.0 to any in via $lif
#-----------------------------------------------------------------------------
# PROMET VEN
#-----------------------------------------------------------------------------
# dovoli ven dostop do DNS serverjev
$cmd 00110 allow tcp from any to 193.189.160.11 53 out via $pif setup keep-state
$cmd 00111 allow udp from any to 193.189.160.11 53 out via $pif keep-state
$cmd 00112 allow tcp from any to 193.189.160.12 53 out via $pif setup keep-state
$cmd 00113 allow udp from any to 193.189.160.12 53 out via $pif keep-state
# dovoli ven internet (www) - port 80
$cmd 00200 allow tcp from any to any 80 out via $pif setup keep-state
# dovoli ven posiljanje in sprejemanje e-mejla - port 25=e-mail, port 110=pop3
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# dovoli ven pinganje
$cmd 00250 allow icmp from any to any out via $pif keep-state
# dovoli ven varen ftp, telnet in SCP - port 22
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
# dovoli ven whois - port 43
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# zavrne ven vse ostalo in zapise kaj je kdo hotel
$cmd 00299 deny log all from any to any out via $pif
#--------------------------------------------------------------------------
# PROMET NOT
#--------------------------------------------------------------------------
$cmd 00302 deny all from 10.0.0.0/8 to any in via $pif
$cmd 00303 deny all from 127.0.0.0/8 to any in via $pif
$cmd 00304 deny all from 0.0.0.0/8 to any in via $pif
$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif
$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif
$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif
# zavrne not ping
$cmd 00310 deny log icmp from any to any in via $pif
# zavrne not ident - port 113
$cmd 00315 deny log tcp from any to any 113 in via $pif
# zvrne not Netbios Services
$cmd 00320 deny tcp from any to any 137 in via $pif
$cmd 00321 deny tcp from any to any 138 in via $pif
$cmd 00322 deny tcp from any to any 139 in via $pif
$cmd 00323 deny tcp from any to any 81 in via $pif
# zavrne not vse zakasnele pakete ??
$cmd 00300 deny all from any to any frag in via $pif
# zavrne not ACK... ??
$cmd 00332 deny all from any to any established in via $pif
# zavrne not vse ostalo in zapise kaj je kdo hotel
$cmd 00499 deny log all from any to any in via $pif
#----------------------------------------------------------------------------
# DEFAULT
#----------------------------------------------------------------------------
# zavrne vse ostalo
$cmd 00999 deny all from any to any
cmd="ipfw -q add"
pif="tun0" #public interface
lif="rl0" #LAN interface
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00010 allow all from any to any via lo0
#-----------------------------------------------------------------
# DUMMYNET
#-----------------------------------------------------------------
$cmd 00051 pipe 1 ip from 192.168.0.202 to any out via $pif
$cmd 00052 pipe 2 ip from any to 192.168.0.202 in via $pif
ipfw pipe 1 config bw 100Kbit/s
ipfw pipe 2 config bw 50Kbit/s
$cmd 00053 pipe 3 ip from 192.168.0.203 to any out via $pif
$cmd 00054 pipe 4 ip from any to 192.168.0.203 in via $pif
ipfw pipe 3 config bw 500Kbit/s
ipfw pipe 4 config bw 100KBit/s
$cmd 00055 pipe 5 ip from 192.168.0.204 to any out via $pif
$cmd 00056 pipe 6 ip from any to 192.168.0.204 in via $pif
ipfw pipe 5 config bw 1500Kbit/s
ipfw pipe 6 config bw 200Kbit/s
#-----------------------------------------------------------------
# KDO IMA INTERNET
#-----------------------------------------------------------------
$cmd 00042 allow all from 192.168.0.2 to any via $lif
$cmd 00043 allow all from 192.168.0.202 to any via $lif
$cmd 00044 allow all from 192.168.0.203 to any via $lif
$cmd 00045 allow all from 192.168.0.204 to any via $lif
#---------------------------------------------------------------------------
$cmd 00070 check-state
#stop spoofing ???
$cmd 00080 deny log all from 192.168.0.0/24:255.255.255.0 to any in via $pif
$cmd 00081 deny log all from 192.168.0.0/24:255.255.255.0 to any in via $lif
#-----------------------------------------------------------------------------
# PROMET VEN
#-----------------------------------------------------------------------------
# dovoli ven dostop do DNS serverjev
$cmd 00110 allow tcp from any to 193.189.160.11 53 out via $pif setup keep-state
$cmd 00111 allow udp from any to 193.189.160.11 53 out via $pif keep-state
$cmd 00112 allow tcp from any to 193.189.160.12 53 out via $pif setup keep-state
$cmd 00113 allow udp from any to 193.189.160.12 53 out via $pif keep-state
# dovoli ven internet (www) - port 80
$cmd 00200 allow tcp from any to any 80 out via $pif setup keep-state
# dovoli ven posiljanje in sprejemanje e-mejla - port 25=e-mail, port 110=pop3
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# dovoli ven pinganje
$cmd 00250 allow icmp from any to any out via $pif keep-state
# dovoli ven varen ftp, telnet in SCP - port 22
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
# dovoli ven whois - port 43
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# zavrne ven vse ostalo in zapise kaj je kdo hotel
$cmd 00299 deny log all from any to any out via $pif
#--------------------------------------------------------------------------
# PROMET NOT
#--------------------------------------------------------------------------
$cmd 00302 deny all from 10.0.0.0/8 to any in via $pif
$cmd 00303 deny all from 127.0.0.0/8 to any in via $pif
$cmd 00304 deny all from 0.0.0.0/8 to any in via $pif
$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif
$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif
$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif
# zavrne not ping
$cmd 00310 deny log icmp from any to any in via $pif
# zavrne not ident - port 113
$cmd 00315 deny log tcp from any to any 113 in via $pif
# zvrne not Netbios Services
$cmd 00320 deny tcp from any to any 137 in via $pif
$cmd 00321 deny tcp from any to any 138 in via $pif
$cmd 00322 deny tcp from any to any 139 in via $pif
$cmd 00323 deny tcp from any to any 81 in via $pif
# zavrne not vse zakasnele pakete ??
$cmd 00300 deny all from any to any frag in via $pif
# zavrne not ACK... ??
$cmd 00332 deny all from any to any established in via $pif
# zavrne not vse ostalo in zapise kaj je kdo hotel
$cmd 00499 deny log all from any to any in via $pif
#----------------------------------------------------------------------------
# DEFAULT
#----------------------------------------------------------------------------
# zavrne vse ostalo
$cmd 00999 deny all from any to any
Zgodovina sprememb…
- spremenil: slovencl ()
slovencl ::
Zdej sem se mal igral z ipfw show, in sem ugotovil:
1 če dam dummynet pravila pred vse, potem dummynet sicer dela, vendar pa vseh ostalih pravil sploh ne šmirgla, se pravi firewall sploh ne deluje.
2. če dam dummynet pravila med pravila za lokalno omrežje in zunanje omrežje, potem lokalno omrežje filtrira, dumynet dela, za ven pa nič ne filtrira, se pravi firewall ne dela.
3. če dam dummynet pravila na koncu, pa fgirewall dela, vendar pa dummynet prvil ne šmirgla.
Zdej mi res ni jasn kako bi to rešil. Moral bi obstajati eno pravilo, ki pregledal dummynet in firewall pravila hkrati, ne pa da izbere prvega ostalo pa ne šmirgla.
A res nihče ne ve kako se to reši?
1 če dam dummynet pravila pred vse, potem dummynet sicer dela, vendar pa vseh ostalih pravil sploh ne šmirgla, se pravi firewall sploh ne deluje.
2. če dam dummynet pravila med pravila za lokalno omrežje in zunanje omrežje, potem lokalno omrežje filtrira, dumynet dela, za ven pa nič ne filtrira, se pravi firewall ne dela.
3. če dam dummynet pravila na koncu, pa fgirewall dela, vendar pa dummynet prvil ne šmirgla.
Zdej mi res ni jasn kako bi to rešil. Moral bi obstajati eno pravilo, ki pregledal dummynet in firewall pravila hkrati, ne pa da izbere prvega ostalo pa ne šmirgla.
A res nihče ne ve kako se to reši?
Diplomat ::
Vrsti red more biti tako:
konfiguracija pipe
tle pac napises vse pipe ki jih potrebujes
nato pa pravilo ki uporablja pipo
LP
konfiguracija pipe
tle pac napises vse pipe ki jih potrebujes
nato pa pravilo ki uporablja pipo
LP
slovencl ::
Našel rešitev!!
Problem je v tem, da ko je šel čez dummynet pravilo, potem ni nadaljeval čez ostala firewall pravila. Rešitev je net.inet.ip.fw.one_pass=0, kar je potrebno vpisati v /etc/sysctl.conf - potem pa gre po dummynet rulsih pregledat še firewall rulse.
Problem je v tem, da ko je šel čez dummynet pravilo, potem ni nadaljeval čez ostala firewall pravila. Rešitev je net.inet.ip.fw.one_pass=0, kar je potrebno vpisati v /etc/sysctl.conf - potem pa gre po dummynet rulsih pregledat še firewall rulse.
Zgodovina sprememb…
- spremenil: slovencl ()
krho ::
Fantje, ali kdo laufa FreeBSD na A64 (64bit verzijo)in nForce 4 s 2xSATA diskoma v RAID 1?
Bi sedanji Celeron 700 fileserver zamenjal...
Bi sedanji Celeron 700 fileserver zamenjal...
si.Mail odprto-kodni odjemalec elektronske pošte. - http://www.simail.si
Uredite si svojo zbirko filmov, serij in iger - http://xcollect.sf.net
Uredite si svojo zbirko filmov, serij in iger - http://xcollect.sf.net
Diplomat ::
Slovencl mi lahko prosim malo bol podrobno razlozis to kar si vpisal v rc.conf, ker nekako mam tak problem, ce mi dummynet dela, mam definirano pipo z 64 kbps, deluje mi pa s 4kbps .
LP
LP
slovencl ::
Moj rc.conf
# -- sysinstall generated deltas -- # Tue Aug 30 23:20:39 2005
# Created: Tue Aug 30 23:20:39 2005
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
usbd_enable="YES"
ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="SIOL"
gateway_enable="YES"
firewall_enable="YES"
firewall_type="OPEN"
firewall_logging="YES"
firewall_script="/etc/ipfw.rules"
sshd_enable="YES"
ifconfig_rl0="inet 192.168.0.99 netmask 255.255.255.0"
# -- sysinstall generated deltas -- # Tue Sep 13 19:29:33 2005
keymap="si.iso"
Jest sem hitrost testiral TUKAJ in mi je za omejitev 200Kbit/s kazalo 195Kbit/s.
# -- sysinstall generated deltas -- # Tue Aug 30 23:20:39 2005
# Created: Tue Aug 30 23:20:39 2005
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
usbd_enable="YES"
ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="SIOL"
gateway_enable="YES"
firewall_enable="YES"
firewall_type="OPEN"
firewall_logging="YES"
firewall_script="/etc/ipfw.rules"
sshd_enable="YES"
ifconfig_rl0="inet 192.168.0.99 netmask 255.255.255.0"
# -- sysinstall generated deltas -- # Tue Sep 13 19:29:33 2005
keymap="si.iso"
Jest sem hitrost testiral TUKAJ in mi je za omejitev 200Kbit/s kazalo 195Kbit/s.
slovencl ::
V sysctl.conf imam samo:
net.inet.ip.fw.one_pass=0
Kakšno imaš trenutno stanje pogledaš s # sysctl -a
Tole meni deluje, naprej s queue-ji še nisem poskusil.
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00010 allow all from any to any via lo0
#-----------------------------------------------------------------
# DUMMYNET
#-----------------------------------------------------------------
$cmd 00011 pipe 1 ip from 192.168.0.202 to any out via $pif
$cmd 00012 pipe 2 ip from any to 192.168.0.202 in via $pif
ipfw pipe 1 config bw 50Kbit/s
ipfw pipe 2 config bw 150Kbit/s
#-----------------------------------------------------------------
# KDO IMA INTERNET
#-----------------------------------------------------------------
$cmd 00043 allow all from 192.168.0.202 to any via $lif
#---------------------------------------------------------------------------
$cmd 00070 check-state
# firewall....
$cmd 00999 deny all from any to any
net.inet.ip.fw.one_pass=0
Kakšno imaš trenutno stanje pogledaš s # sysctl -a
Tole meni deluje, naprej s queue-ji še nisem poskusil.
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00010 allow all from any to any via lo0
#-----------------------------------------------------------------
# DUMMYNET
#-----------------------------------------------------------------
$cmd 00011 pipe 1 ip from 192.168.0.202 to any out via $pif
$cmd 00012 pipe 2 ip from any to 192.168.0.202 in via $pif
ipfw pipe 1 config bw 50Kbit/s
ipfw pipe 2 config bw 150Kbit/s
#-----------------------------------------------------------------
# KDO IMA INTERNET
#-----------------------------------------------------------------
$cmd 00043 allow all from 192.168.0.202 to any via $lif
#---------------------------------------------------------------------------
$cmd 00070 check-state
# firewall....
$cmd 00999 deny all from any to any
Zgodovina sprememb…
- spremenil: slovencl ()
Diplomat ::
Slucajno gdo ve kak bi moral bit vrstni red pri ipfju za pravilno delovanje.
setup lopback
stop spoofing
deny rfc nest
natd
stop rfc nests
stop dhcp
pravila za lan
Kje pa pridejo pravila za router?
setup lopback
stop spoofing
deny rfc nest
natd
stop rfc nests
stop dhcp
pravila za lan
Kje pa pridejo pravila za router?
Maximus ::
Živjo!
Rad bi probal FreeBSD, sam ga ne morem. Ko vstavim boot disk, bi lepo zbootra do menija, kjer izberem način inštalacije in mi pol javi da ne zazna diskov. Mam dva diska in 3 optične enote na MB-ju Gigabyte 7VRXP.
Linux (Slackware) mi use zazna in ga lahko inštaliram.
Lahko kdo kaj pomaga.
Rad bi probal FreeBSD, sam ga ne morem. Ko vstavim boot disk, bi lepo zbootra do menija, kjer izberem način inštalacije in mi pol javi da ne zazna diskov. Mam dva diska in 3 optične enote na MB-ju Gigabyte 7VRXP.
Linux (Slackware) mi use zazna in ga lahko inštaliram.
Lahko kdo kaj pomaga.
Kami ::
Hm, nobenega ti ne zazna?
Jaz sem imel enaki problem čisto na začetku, Windowso so delali ok, pa druge distribucije tudi samo FreeBSD ni zaznal diskov, potem sem lepo zamenjal vrstni red ide kablov (master, slave) in je FreeBSD zaznal diske
Jaz sem imel enaki problem čisto na začetku, Windowso so delali ok, pa druge distribucije tudi samo FreeBSD ni zaznal diskov, potem sem lepo zamenjal vrstni red ide kablov (master, slave) in je FreeBSD zaznal diske
Maximus ::
Čudn, ker kable in jumperje mam čist vredu nastavljen. Sam FreeBSD ne zazna niti enga diska. Sm probu že v biosu izklaplat en in drug disk, ter se še tko mal igral. Sam zaznati pa noče.
LP!
LP!
Kami ::
Ja glej, jaz tudi tak ko sem imel prvotno (prav) nastavljene mi je Windows zaznal pa Linux, FreeBSD pa mi ni, pa sem samo zamenjal (dal obratno) pol pa je -> zgodlo se mi je čisto enako kot ebi.
Nerdor ::
Da ne bo kdo omenil, da se nisem spomnil na vas! Na FTPjih je na voljo verjetno poslednji Release Candidate FreeBSD 6.0 [ link]
Torej izid FreeBSD 6.0 se bliža..
Torej izid FreeBSD 6.0 se bliža..
... for lifetime!
Zgodovina sprememb…
- spremenil: Nerdor ()
Nerdor ::
Zanimivo braje [ link] o (na kratko) primerjanju načina dela procesov in podpori file sistemom v jedrih Solarisa, Linuxa in FreeBSDja.
... for lifetime!
slovencl ::
Rad bi naredil pravilo, ki prepušča določen ip in mac, poskusil sem tole: $cmd allow all from moj-ip to any via $lif mac any moj-mac, ampak zadeva ne deluje, zapre mi ves promet s tega kompa.
Kako bi to rešil? (Baje da se za to uporablja nek static arp, ampak nikjer nisem nič pametnega našel.)
Kako bi to rešil? (Baje da se za to uporablja nek static arp, ampak nikjer nisem nič pametnega našel.)
Maximus ::
Kami, prav si mel. Kable sm mogu obrnit in mi zdej normalno zazna diske.
Hvala za info.
LP!
Hvala za info.
LP!
Diplomat ::
Slovencl, mi lahko prosim pastas, tvojo skripto ipfwja, z dummynetom. Meni ne deluje vec
slovencl ::
Evo moja prvila, najbrž niso idealna, tako da če ima kdo kakšen komentar naj pove:
cmd="ipfw -q add"
pif="tun0" #public interface
lif="rl0" #LAN interface
klemen_ip="192.168.0.11"
simon_ip="192.168.0.12"
miha_ip="192.168.0.13"
jan_ip="192.168.0.14"
do_ip="192.168.0.15"
simon_dl_ip="192.168.0.18"
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00010 allow all from any to any via lo0
#-----------------------------------------------------------------
# DUMMYNET
#-----------------------------------------------------------------
ipfw pipe 1 config bw 2000Kbit/s #not (2048 na razpolago)
#ipfw pipe 2 config bw 380Kbit/s #ven 384
ipfw queue 1 config pipe 1 weight 25 #klemen not
ipfw queue 2 config pipe 1 weight 25 #simon not
ipfw queue 3 config pipe 1 weight 25 #miha not
ipfw queue 4 config pipe 1 weight 25 #jan not
ipfw queue 8 config pipe 1 weight 25 #simon dlancnik
ipfw queue 10 config pipe 1 weight 25 #do not
$cmd 00011 queue 1 ip from any to $klemen_ip in via $pif
$cmd 00012 queue 2 ip from any to $simon_ip in via $pif
$cmd 00013 queue 3 ip from any to $miha_ip in via $pif
$cmd 00014 queue 4 ip from any to $jan_ip in via $pif
$cmd 00018 queue 8 ip from any to $simon_dl_ip in via $pif
$cmd 00020 queue 10 ip from any to $do_ip in via $pif
#-----------------------------------------------------------------
# KDO IMA INTERNET
#-----------------------------------------------------------------
#SSH
$cmd 00040 allow all from $klemen_ip to me 22 via $lif setup keep-state
$cmd 00042 allow all from $klemen_ip to any via $lif
$cmd 00043 allow all from $simon_ip to any via $lif
$cmd 00044 allow all from $miha_ip to any via $lif
$cmd 00045 allow all from $jan_ip to any via $lif
$cmd 00049 allow all from $simon_dl_ip to any via $lif
$cmd 00051 allow all from $do_ip to any via $lif
#---------------------------------------------------------------------------
#stop spoofing
$cmd 00071 deny log all from 192.168.0.0/24:255.255.255.0 to any in via $lif
#-----------------------------------------------------------------------------
# PROMET VEN
#-----------------------------------------------------------------------------
$cmd 00100 check-state
#--------------
# TEST
# messenger
$cmd 00101 allow tcp from any to any 5060 out via $pif setup keep-state
$cmd 00102 allow tcp from any to any 1503 out via $pif setup keep-state
$cmd 00103 allow tcp from any to any 3389 out via $pif setup keep-state
$cmd 00104 allow tcp from any to any 6891-6900 out via $pif setup keep-state
$cmd 00105 allow tcp from any to any 1863 out via $pif setup keep-state
$cmd 00106 allow tcp from any to any 1893 out via $pif setup keep-state
#--------------
# dovoli ven dostop do DNS serverjev
$cmd 00150 allow tcp from any to 193.189.160.11 53 out via $pif setup keep-state
$cmd 00151 allow udp from any to 193.189.160.11 53 out via $pif keep-state
$cmd 00152 allow tcp from any to 193.189.160.12 53 out via $pif setup keep-state
$cmd 00153 allow udp from any to 193.189.160.12 53 out via $pif keep-state
# dovoli ven internet (www) - port 80
$cmd 00200 allow tcp from any to any 80 out via $pif setup keep-state
# dovoli ven IRC - port 6667
$cmd 00201 allow tcp from any to any 6667 out via $pif setup keep-state
# dovoli ven https cez TLS SSL - port 443
$cmd 00220 allow tcp from any to any 443 out via $pif setup keep-state
# dovoli ven posiljanje in sprejemanje e-mejla - port 25=e-mail, port 110=pop3
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# dovoli ven pinganje
$cmd 00250 allow icmp from any to any out via $pif keep-state
# dovoli ven Time - port 37
#$cmd 00260 allow tcp from any to any 37 out via $pif setup keep-state
# dovoli ven nntp news - port 119
#$cmd 00270 allow tcp from any to any 119 out via $pif setup keep-state
# dovoli ven varen ftp, telnet in SCP - port 22
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
# dovoli ven whois - port 43
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# zavrne ven vse ostalo in zapise kaj je kdo hotel
$cmd 00299 deny log all from any to any out via $pif
#--------------------------------------------------------------------------
# PROMET NOT
#--------------------------------------------------------------------------
# zvrne not ves promet ki ni v mejah obicajnih ip naslovov
$cmd 00300 deny all from 192.168.0.0/16 to any in via $pif
$cmd 00301 deny all from 172.16.0.0/12 to any in via $pif
$cmd 00302 deny all from 10.0.0.0/8 to any in via $pif
$cmd 00303 deny all from 127.0.0.0/8 to any in via $pif
$cmd 00304 deny all from 0.0.0.0/8 to any in via $pif
$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif
$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif
$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif
# zavrne not ping
$cmd 00310 deny log icmp from any to any in via $pif
# zavrne not ident - port 113
$cmd 00315 deny log tcp from any to any 113 in via $pif
# zvrne not Netbios Services
$cmd 00320 deny tcp from any to any 137 in via $pif
$cmd 00321 deny tcp from any to any 138 in via $pif
$cmd 00322 deny tcp from any to any 139 in via $pif
$cmd 00323 deny tcp from any to any 81 in via $pif
# zavrne not vse zakasnele pakete ??
$cmd 00300 deny all from any to any frag in via $pif
# zavrne not ACK... ??
$cmd 00332 deny all from any to any established in via $pif
# zavrne not vse ostalo in zapise kaj je kdo hotel
$cmd 00499 deny log all from any to any in via $pif
#----------------------------------------------------------------------------
# DEFAULT
#----------------------------------------------------------------------------
# zavrne vse ostalo
$cmd 00999 deny all from any to any
V /etc/sysctl.conf obvezno dodaj: net.inet.ip.fw.one_pass=0 !
cmd="ipfw -q add"
pif="tun0" #public interface
lif="rl0" #LAN interface
klemen_ip="192.168.0.11"
simon_ip="192.168.0.12"
miha_ip="192.168.0.13"
jan_ip="192.168.0.14"
do_ip="192.168.0.15"
simon_dl_ip="192.168.0.18"
ipfw -q -f flush
ipfw -q pipe flush
$cmd 00010 allow all from any to any via lo0
#-----------------------------------------------------------------
# DUMMYNET
#-----------------------------------------------------------------
ipfw pipe 1 config bw 2000Kbit/s #not (2048 na razpolago)
#ipfw pipe 2 config bw 380Kbit/s #ven 384
ipfw queue 1 config pipe 1 weight 25 #klemen not
ipfw queue 2 config pipe 1 weight 25 #simon not
ipfw queue 3 config pipe 1 weight 25 #miha not
ipfw queue 4 config pipe 1 weight 25 #jan not
ipfw queue 8 config pipe 1 weight 25 #simon dlancnik
ipfw queue 10 config pipe 1 weight 25 #do not
$cmd 00011 queue 1 ip from any to $klemen_ip in via $pif
$cmd 00012 queue 2 ip from any to $simon_ip in via $pif
$cmd 00013 queue 3 ip from any to $miha_ip in via $pif
$cmd 00014 queue 4 ip from any to $jan_ip in via $pif
$cmd 00018 queue 8 ip from any to $simon_dl_ip in via $pif
$cmd 00020 queue 10 ip from any to $do_ip in via $pif
#-----------------------------------------------------------------
# KDO IMA INTERNET
#-----------------------------------------------------------------
#SSH
$cmd 00040 allow all from $klemen_ip to me 22 via $lif setup keep-state
$cmd 00042 allow all from $klemen_ip to any via $lif
$cmd 00043 allow all from $simon_ip to any via $lif
$cmd 00044 allow all from $miha_ip to any via $lif
$cmd 00045 allow all from $jan_ip to any via $lif
$cmd 00049 allow all from $simon_dl_ip to any via $lif
$cmd 00051 allow all from $do_ip to any via $lif
#---------------------------------------------------------------------------
#stop spoofing
$cmd 00071 deny log all from 192.168.0.0/24:255.255.255.0 to any in via $lif
#-----------------------------------------------------------------------------
# PROMET VEN
#-----------------------------------------------------------------------------
$cmd 00100 check-state
#--------------
# TEST
# messenger
$cmd 00101 allow tcp from any to any 5060 out via $pif setup keep-state
$cmd 00102 allow tcp from any to any 1503 out via $pif setup keep-state
$cmd 00103 allow tcp from any to any 3389 out via $pif setup keep-state
$cmd 00104 allow tcp from any to any 6891-6900 out via $pif setup keep-state
$cmd 00105 allow tcp from any to any 1863 out via $pif setup keep-state
$cmd 00106 allow tcp from any to any 1893 out via $pif setup keep-state
#--------------
# dovoli ven dostop do DNS serverjev
$cmd 00150 allow tcp from any to 193.189.160.11 53 out via $pif setup keep-state
$cmd 00151 allow udp from any to 193.189.160.11 53 out via $pif keep-state
$cmd 00152 allow tcp from any to 193.189.160.12 53 out via $pif setup keep-state
$cmd 00153 allow udp from any to 193.189.160.12 53 out via $pif keep-state
# dovoli ven internet (www) - port 80
$cmd 00200 allow tcp from any to any 80 out via $pif setup keep-state
# dovoli ven IRC - port 6667
$cmd 00201 allow tcp from any to any 6667 out via $pif setup keep-state
# dovoli ven https cez TLS SSL - port 443
$cmd 00220 allow tcp from any to any 443 out via $pif setup keep-state
# dovoli ven posiljanje in sprejemanje e-mejla - port 25=e-mail, port 110=pop3
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# dovoli ven pinganje
$cmd 00250 allow icmp from any to any out via $pif keep-state
# dovoli ven Time - port 37
#$cmd 00260 allow tcp from any to any 37 out via $pif setup keep-state
# dovoli ven nntp news - port 119
#$cmd 00270 allow tcp from any to any 119 out via $pif setup keep-state
# dovoli ven varen ftp, telnet in SCP - port 22
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
# dovoli ven whois - port 43
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# zavrne ven vse ostalo in zapise kaj je kdo hotel
$cmd 00299 deny log all from any to any out via $pif
#--------------------------------------------------------------------------
# PROMET NOT
#--------------------------------------------------------------------------
# zvrne not ves promet ki ni v mejah obicajnih ip naslovov
$cmd 00300 deny all from 192.168.0.0/16 to any in via $pif
$cmd 00301 deny all from 172.16.0.0/12 to any in via $pif
$cmd 00302 deny all from 10.0.0.0/8 to any in via $pif
$cmd 00303 deny all from 127.0.0.0/8 to any in via $pif
$cmd 00304 deny all from 0.0.0.0/8 to any in via $pif
$cmd 00305 deny all from 169.254.0.0/16 to any in via $pif
$cmd 00306 deny all from 192.0.2.0/24 to any in via $pif
$cmd 00307 deny all from 204.152.64.0/23 to any in via $pif
$cmd 00308 deny all from 224.0.0.0/3 to any in via $pif
# zavrne not ping
$cmd 00310 deny log icmp from any to any in via $pif
# zavrne not ident - port 113
$cmd 00315 deny log tcp from any to any 113 in via $pif
# zvrne not Netbios Services
$cmd 00320 deny tcp from any to any 137 in via $pif
$cmd 00321 deny tcp from any to any 138 in via $pif
$cmd 00322 deny tcp from any to any 139 in via $pif
$cmd 00323 deny tcp from any to any 81 in via $pif
# zavrne not vse zakasnele pakete ??
$cmd 00300 deny all from any to any frag in via $pif
# zavrne not ACK... ??
$cmd 00332 deny all from any to any established in via $pif
# zavrne not vse ostalo in zapise kaj je kdo hotel
$cmd 00499 deny log all from any to any in via $pif
#----------------------------------------------------------------------------
# DEFAULT
#----------------------------------------------------------------------------
# zavrne vse ostalo
$cmd 00999 deny all from any to any
V /etc/sysctl.conf obvezno dodaj: net.inet.ip.fw.one_pass=0 !
Diplomat ::
Slovencl, hvala kaj pa nat, ne vidim nikjer pravila za nat $cmd 100 divert natd ip from any to any in via $pif.
krho ::
hm. Jaz grem s 6.0 RC-1 v produkcijo, na file server. Močno upam, da ne bo problemov. 5.4 tako ali tako ne pozna nForce 4.
V glavnem, čez noč sem pustil, da je zadevo zvelek dol in instaliral.
Najbolj, se narežim, ko pogledam memory statistics, kjer je zasedenih slabih 70M od 2G, od tega je 30M buffeja, 4G swap particije se pa pomoje ne bo niti dotaknil.
Aja zadevo laufam na ASUS SLI Deluxe 2xgigabit LAN eden je v čipsetu, drugi je Marvelov, delujeta oba.
Tudi RAID lepo laufa. Sedaj pa mučenje s Sambo.
V glavnem, čez noč sem pustil, da je zadevo zvelek dol in instaliral.
Najbolj, se narežim, ko pogledam memory statistics, kjer je zasedenih slabih 70M od 2G, od tega je 30M buffeja, 4G swap particije se pa pomoje ne bo niti dotaknil.
Aja zadevo laufam na ASUS SLI Deluxe 2xgigabit LAN eden je v čipsetu, drugi je Marvelov, delujeta oba.
Tudi RAID lepo laufa. Sedaj pa mučenje s Sambo.
si.Mail odprto-kodni odjemalec elektronske pošte. - http://www.simail.si
Uredite si svojo zbirko filmov, serij in iger - http://xcollect.sf.net
Uredite si svojo zbirko filmov, serij in iger - http://xcollect.sf.net
christooss ::
FreeBsdjevci so izbrali nov logo
Zakaj je nebo modro? Da imamo lahko sladoled Modro Nebo
Nerdor ::
Prevech je otrochji nov Logotip IMO! Drugache pa je res, da sele novi 6.0 bo podpiral najnovejshi HW, kot je Nforce 4 in podobno.
Xbox (navaden in ne 360 verzija) naj bi postala nova platforma za FreeBSD 7.0, poleg PC, PC98 (japonska PC spec.), alphaPC, PowerPC.
Xbox (navaden in ne 360 verzija) naj bi postala nova platforma za FreeBSD 7.0, poleg PC, PC98 (japonska PC spec.), alphaPC, PowerPC.
... for lifetime!
krho ::
Ok Zadeva je takale. Mrežna kartica v nForce 4 chipsetu ga nekaj serje, tako da sem vse skupaj prestavil na Marvella. Dobivam napake nve0 has timed out. To dela nekaj časa nato pa je konec, vsaj danes zjutraj ko je bila mašina pod obremenitvijo jo je totalno sesulo. Upam, da bo na Marvellu delalo OK, drugače sem v qrcu.
ifconfig nve0 down
ifconfig nve0 up ne pomaga, je treba resetirat gajbo.
ifconfig nve0 down
ifconfig nve0 up ne pomaga, je treba resetirat gajbo.
si.Mail odprto-kodni odjemalec elektronske pošte. - http://www.simail.si
Uredite si svojo zbirko filmov, serij in iger - http://xcollect.sf.net
Uredite si svojo zbirko filmov, serij in iger - http://xcollect.sf.net
Poldi112 ::
Špasno. .0 so oznacili za release. Sem imel v spominu da so presedlali na metodo da pocakajo par minor verzij predno dajo ven release.
Ampak ne upam reci da je zato to slabo. Samo preseneca me.
Ampak ne upam reci da je zato to slabo. Samo preseneca me.
Where all think alike, no one thinks very much.
Walter Lippmann, leta 1922, o predpogoju za demokracijo.
Walter Lippmann, leta 1922, o predpogoju za demokracijo.
veteran ::
Pa na nobenem serverju ga še ni...
Telemach ima mirror, 6.0-release je že gor:
ftp://ftp.telemach.net/pub/FreeBSD/releases/i386/
Telemach ima mirror, 6.0-release je že gor:
ftp://ftp.telemach.net/pub/FreeBSD/releases/i386/
christooss ::
Hm kaj pa je fora
File: 6.0-RELEASE-i386-bootonly.iso 44860 KB 03. 11. 2005 14:25:00
File: 6.0-RELEASE-i386-disc1.iso 564852 KB 03. 11. 2005 16:13:00
File: 6.0-RELEASE-i386-disc2.iso 666378 KB 03. 11. 2005 17:45:00
File: CHECKSUM.MD5 1 KB 03. 11. 2005 17:45:00
File: CHECKSUM.SHA256 1 KB 03. 11. 2005 17:45:00
Domnevam da je bootonly.iso za net installl. Kaj pa je na disc 1 in 2? A so to binaryji al source. A sploh obstajajo FreeBsd binnaryji
File: 6.0-RELEASE-i386-bootonly.iso 44860 KB 03. 11. 2005 14:25:00
File: 6.0-RELEASE-i386-disc1.iso 564852 KB 03. 11. 2005 16:13:00
File: 6.0-RELEASE-i386-disc2.iso 666378 KB 03. 11. 2005 17:45:00
File: CHECKSUM.MD5 1 KB 03. 11. 2005 17:45:00
File: CHECKSUM.SHA256 1 KB 03. 11. 2005 17:45:00
Domnevam da je bootonly.iso za net installl. Kaj pa je na disc 1 in 2? A so to binaryji al source. A sploh obstajajo FreeBsd binnaryji
Zakaj je nebo modro? Da imamo lahko sladoled Modro Nebo
Nerdor ::
moramo sprobat, ni druge, da se prepričamo. Sam kokr je men znano so Disk1 in 2 binarni paketi, binary zadeva. Source pa priteče z neta dol in se skompajla.
Sicer je pa izšel Ging 0.1.0 live cd distro, ki bazira na Debian GNU/kFreeBSD. lol!
Sicer je pa izšel Ging 0.1.0 live cd distro, ki bazira na Debian GNU/kFreeBSD. lol!
... for lifetime!
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | Odkrita varnostna luknja v privzeti namestitvi OpenBSDOddelek: Novice / Varnost | 4306 (3241) | poweroff |
» | Težavica z Telnet povezavo na router, na katerem teče FreeBSDOddelek: Operacijski sistemi | 1412 (1382) | Meamoto |
» | linux vs freeBSDOddelek: Operacijski sistemi | 3174 (2871) | 64202 |
⊘ | FreeBSD z ADSL kot domači routerOddelek: Operacijski sistemi | 2327 (2228) | moj_nick |
» | FreeBSD - nekaj newbie vprašanjOddelek: Operacijski sistemi | 1233 (1095) | ghaefb |