Register for your free account! | Forgot your password?

You last visited: Today at 06:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[how to] ipfw firewall

Discussion on [how to] ipfw firewall within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 1
Join Date: Jul 2008
Posts: 78
Received Thanks: 93
[how to] ipfw firewall

Hallo ich wollte euch hier ma zeigen wie man eine ipfw Firewall installiert auf FreeBSD da es viele ungesicherte FreeBSD roots gibt es sollten niemals mehr Port als nötig gefönet sein
ich erkläre euch wie ihr eine ipfw firewall auf FreeBSD installiert ich übernehme keine Verantwortung für irgend welche fehlt Einstellung oder sonstiges wenn ihr die Sachen einfach kopiert selbst schuld

was brauche ich?
1 FreeBSD root
1 metin2 Server
1 ein wenig Grips
und die Ports die der metin2 Server braucht
Putty

2. testen ob ipfw möglich ist
das macht ihr mit
Code:
ipfw list
den müstet ihr folgenden eror erhalten
Code:
ipfw: getsockopt(IP_FW_GET): Protocol not available
2. ipfw regel anlegen

ihr erstelle eine neue datei namens ipfw.rules

wir müssen naturlich auch den ssh port ec auch freigeben da ihr sonst nicht mehr euch per ssh zu euren root verbinden könnt
ich habe hier ma eine standart regel gemacht für metin2 und einem channel
dies basiert ledeglich auf den Standart ports!

ihr gebt also folgenden Text ein in eure ipfw.rules Datei
Code:
IPF="ipfw -q add"
ipfw -q -f flush

#loopback
$IPF 10 allow all from any to any via lo0
$IPF 20 deny all from any to 127.0.0.0/8
$IPF 30 deny all from 127.0.0.0/8 to any
$IPF 40 deny tcp from any to any frag

# statefull
$IPF 50 check-state
$IPF 60 allow tcp from any to any established
$IPF 70 allow all from any to any out keep-state
$IPF 80 allow icmp from any to any

# open port ftp (20,21), ssh (22), mail (25)
# http (80), dns (53) etc
$IPF 110 allow tcp from any to any 21 in
$IPF 120 allow tcp from any to any 21 out
$IPF 130 allow tcp from any to any 22 in
$IPF 140 allow tcp from any to any 22 out
$IPF 170 allow udp from any to any 53 in
$IPF 175 allow tcp from any to any 53 in
$IPF 180 allow udp from any to any 53 out
$IPF 185 allow tcp from any to any 53 out

# metin2 ch1 ports
$IPF 200 allow tcp from any to any 11002 in
$IPF 210 allow tcp from any to any 11002 out
$IPF 200 allow udp from any to any 11002 in
$IPF 210 allow udp from any to any 11002 out
$IPF 200 allow tcp from any to any 13000 in
$IPF 210 allow tcp from any to any 13000 out
$IPF 200 allow tcp from any to any 13001 in
$IPF 210 allow tcp from any to any 13001 out
$IPF 200 allow tcp from any to any 13002 in
$IPF 210 allow tcp from any to any 13002 out
$IPF 200 allow tcp from any to any 13003 in
$IPF 210 allow tcp from any to any 13003 out
$IPF 200 allow tcp from any to any 13004 in
$IPF 210 allow tcp from any to any 13004 out
$IPF 200 allow tcp from any to any 13061 in
$IPF 210 allow tcp from any to any 13061 out
$IPF 200 allow tcp from any to any 13099 in
$IPF 210 allow tcp from any to any 13099 out
und speichert es auf eurem FreeBSD root im folgenden Verzeichnis
/etc/ipfw.rules
und zu guter lezt müssen wir das ganze in die rc.conf einfügen am schnellsten geht das so
1.ihr könnt naturlich die ipfw.rules auch in einem anderen Verzeichnis packen nur den müsst ihr den pfad anpassen das bleibt euch überlassen
Code:
echo 'firewall_enable="YES"' >> /etc/rc.conf 
echo 'firewall_script="/etc/ipfw.rules"' >> /etc/rc.conf
jezt nur noch rebooten das macht ihr folgt
Code:
reboot
wenn ipfw einmal aktive ist den müsst ihr für kleinere Änderungen keinen reboot machen den reloadet ihr es einfach mit folgenden befehlt
Code:
/etc/rc.d/ipfw restart
um jetzt zu sehn ob ipfw arbeitet gebt ihr folgenden befehl in putty ein
ipfw show


Mit ipfw ips bannen

wenn ihr ma einen Angreifer habt auf euren freebsd root und es defentive als ddos indefiziren könt den kann man mit ipfw auch ips bannen
das geht so
Code:
ipfw add deny ip from 123.145.167.123 to any
entbannen
Code:
ipfw add allow ip from 123.145.167.123 to any

ich habe jeze nur eine beispiel ip genommen ihr sezte naturlich die ip des angreifers ein


ipfw im kernel kompilieren

ich möchte darauf hinweisen in 99% der falle braucht man es nicht ich werde hier nicht erklären wie ihr an die source bzw kernel source kommt zum compilen ich werden lediglich zeigen wie ihr es in den kernel bzw in den source editiert und kompilieren

als erste gebt ihr das ein
Code:
grep IPFIREWALL /usr/src/sys/i386/conf
und dan das
Code:
cd /usr/src/sys/i386/conf
und den noch das
Code:
cp GENERIC IPFWKERNEL
den müsst ihr jezt die IPFWKERNEL editiren das geht so

ihr könnt vi oder ee nehm ich personlich zihe ee vor

Code:
ee IPFWKERNEL
ihr fügt nun folgendes ein

Code:
options IPFIREWALL # required for IPFW
options IPFIREWALL_VERBOSE # optional; logging
options IPFIREWALL_VERBOSE_LIMIT=10 # optional; don't get too many log entries
options IPDIVERT # needed for natd
compilen
Code:
cd /usr/src
Code:
make buildkernel KERNCONF=IPFWKERNEL
und dann zum installen

Code:
make installkernel KERNCONF=IPFWKERNEL
und dann zu guter lezt
Code:
reboot
ihr müst dieses als erstes schrit aufüren normal aber da viele freebsd anbieter es vor instaliert haben braucht man es oft nicht aufüren

quelle



wenn euch gefallen hat gebt mir ein thanks
virus total scan:

/update 2 kernconfig mit PAE+Ipfw für OVH Server hinzugefügt
Attached Files
File Type: rar GENERIC.rar (5.3 KB, 557 views)
Mathias1000 is offline  
Thanks
36 Users
Old 04/07/2010, 09:31   #2
 
elite*gold: 626
Join Date: Aug 2009
Posts: 7,149
Received Thanks: 2,943
Können dann andere keine ddos attaken mehr machen?
тrαder is offline  
Old 04/07/2010, 09:35   #3
 
elite*gold: 1
Join Date: Jul 2008
Posts: 78
Received Thanks: 93
man kann wenn man es im kernel macht durch aus dos atacken verhindern
Mathias1000 is offline  
Thanks
1 User
Old 04/07/2010, 11:39   #4

 
IgorGlock's Avatar
 
elite*gold: 1862
Join Date: Jan 2009
Posts: 3,725
Received Thanks: 7,671
wenn du dich damit auskennst (ich nutze andere Firewall) dann erklär mir wozu diese:
Quote:
$IPF 210 allow tcp from any to any 11002 out
^ 210 steht!
IgorGlock is offline  
Thanks
3 Users
Old 04/07/2010, 11:50   #5
 
elite*gold: 1199
Join Date: Apr 2010
Posts: 4,528
Received Thanks: 909
Find ich gut

Werden denk ich mal viele benutzten !
Rosalein is offline  
Old 04/07/2010, 14:00   #6
 
elite*gold: 0
Join Date: Oct 2008
Posts: 737
Received Thanks: 311
Sehr schön! #thx given
Turundeth is offline  
Old 04/07/2010, 14:08   #7

 
IgorGlock's Avatar
 
elite*gold: 1862
Join Date: Jan 2009
Posts: 3,725
Received Thanks: 7,671
und wozu stehen diese Zahlen?
Quote:
$IPF 210 allow tcp from any to any 11002 out
^ wenn der Typ das nicht mit Copy&Paste geklaut hat, sollte er das wissen.
IgorGlock is offline  
Thanks
2 Users
Old 04/07/2010, 14:34   #8
 
elite*gold: 1
Join Date: Nov 2007
Posts: 1,382
Received Thanks: 754


Sieht fast gleich aus kommisch

Edit 10x10ter Beitrag
westilein is offline  
Thanks
1 User
Old 04/07/2010, 14:43   #9
 
elite*gold: 8
Join Date: Feb 2010
Posts: 5,260
Received Thanks: 1,473
Quote:
Originally Posted by .westside View Post


Sieht fast gleich aus kommisch

Edit 10 Beitrag
Wollt ich grad auch schreiben.
Naja für leute die nicht wissen das es sowas wie ein Handbuch gibt...
Escalon is offline  
Old 04/07/2010, 14:45   #10
 
elite*gold: 0
Join Date: Feb 2010
Posts: 244
Received Thanks: 28
Übrigens Heißt das entweder IPFw oder IPFirewall nicht IPFirewallFirewall^^
Andy888 is offline  
Old 04/07/2010, 18:09   #11
 
elite*gold: 1
Join Date: Jul 2008
Posts: 78
Received Thanks: 93
/quelle hinzugefügt
Mathias1000 is offline  
Thanks
3 Users
Old 09/04/2010, 12:43   #12
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,381
Received Thanks: 332
Sry fürs pushen aber möchte kein neuen thread aufmachen:

Wie entblocke ich die ips?^^
Wernii is offline  
Thanks
1 User
Old 11/25/2010, 11:08   #13
 
elite*gold: 0
Join Date: Sep 2010
Posts: 302
Received Thanks: 116
Kleine Warnung an alle, ihr müsst die ipfw.rules bearbeiten,
sonst wird CH2 geblockt(wenn auf anderem Root läuft).
.Gravita is offline  
Old 12/03/2010, 23:15   #14
 
elite*gold: 0
Join Date: Apr 2010
Posts: 92
Received Thanks: 1
somebady attacking my server to 11034 port how i can disable this attack?
sowanted is offline  
Old 12/03/2010, 23:20   #15
 
elite*gold: 0
Join Date: Sep 2010
Posts: 302
Received Thanks: 116
Add a rule to the ipfw.rules wich blocks the port.
If this is a DDoS you can't do something, except waiting
for the end. Sit down, drink tea.
.Gravita is offline  
Reply

Tags
firewall, ipfw, metin, root


Similar Threads Similar Threads
IPFW Install Anhang zu Infinitys Tutorial
03/22/2011 - Metin2 PServer Guides & Strategies - 124 Replies
Hey Leute, Fangen wir direkt mit der Installation an Anhang zum Thema von .Infinity Weil er halt geschrieben hat... Dieses Thema geht zu 99% :D Erstmal Ports Updaten
[Guide]Firewall+P2P Firewall
12/13/2010 - Metin2 PServer Guides & Strategies - 18 Replies
Hey Community, heute erkläre ich euch mal wie man IPFW2+P2P Firewall auf FreeBSD Installiert. Natürliche Via SSH. Als erstes tippt ihr ein... # cd /etc # ee rc.conf Danach schreibt ihr dieses rein...
[HELP]Firewall
05/22/2010 - CO2 Private Server - 0 Replies
Can anyone help me set up Eset Smart Security firewall? It seems that when I turn off the firewall I can connect to the server...when I turn it on (automatic with exceptions) it won't let me...I added COSERVERPROJECT.EXE on exceptions for port 3306, 9958 and it won't let me connect...I don't know where to add the exceptions for the server.... help? EDIT: what ports are used for APPSERV (web page hosting)? EDIT2: NVM FIXED



All times are GMT +1. The time now is 06:28.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.