Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
@home kabel en internet delen + firewall hoe is dit mogelijk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Dutch
View previous topic :: View next topic  
Author Message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Wed Oct 09, 2002 10:41 am    Post subject: @home kabel en internet delen + firewall hoe is dit mogelijk Reply with quote

ik zit met het volgende

ik wou graag mijn gentoo linux bak het internet laten delen en ik wou deze bak als firewall laten dienen.
wat ik zoek is een duidelijke het liefst nederlandse uitleg om het internet te kunnen delen en firewall ik weet dat iptables dit kan maar ik zie nergens in de how-to's staan hoe je het internet moet delen. ik gebruik dus @home kabelinternet en ik krijg mijn ip enz via dhcpcd.

graag sites met how-to's of kan iemand me op weg helpen?


heel hartelijk bedankt alvast

Tom
Back to top
View user's profile Send private message
Spydog
n00b
n00b


Joined: 15 Aug 2002
Posts: 9
Location: Eindhoven, NL

PostPosted: Wed Oct 09, 2002 5:35 pm    Post subject: Reply with quote

Kijk hier eens, hiermee is het mij ook gelukt (en je hebt een heel erg uitgebreide firewall).

http://www.nedlinux.nl/~bart/index.php?page=3

Succes!
Back to top
View user's profile Send private message
voidzero
Bodhisattva
Bodhisattva


Joined: 21 Jul 2002
Posts: 265
Location: Grnn

PostPosted: Wed Oct 09, 2002 9:06 pm    Post subject: Re: @home kabel en internet delen + firewall hoe is dit moge Reply with quote

alberstom wrote:
graag sites met how-to's of kan iemand me op weg helpen?


Sure. Syntax is vrij duidelijk:
Code:
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT --to-source 0.0.0.0

-t nat -- gebruik de nat-module: die reageert als er een nieuw datapakket binnenkomt; en...
-A POSTROUTING -- voeg een nieuwe regel toe in de "chain" postrouting; die de datapakketjes aanpast voor ze naar buiten gaan)
-s 192.168.1.0/24 <-- dit moet je aanpassen voor jouw ipadressen. Dit is een voorbeeld voor 192.168.1.1 tot 192.168.1.255 (dus een /24), maar als jij maar 1 intern ipadres wil gebruiken kan je dat ook intypen.
-j SNAT - roep de module SNAT aan
--to-source 0.0.0.0 <-- aanpassen voor jouw @home IP.

Hoop dat 't helpt :)

Later
Mark
_________________
Diplomacy is the art of letting the other party have things your way.
-- Daniele Vare
Back to top
View user's profile Send private message
voidzero
Bodhisattva
Bodhisattva


Joined: 21 Jul 2002
Posts: 265
Location: Grnn

PostPosted: Wed Oct 09, 2002 9:08 pm    Post subject: Reply with quote

O jah, als je een dynamisch ip hebt (Dat heeft @Home toch?) kan je dit doen:

Code:
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQ


Suc6
Mark
_________________
Diplomacy is the art of letting the other party have things your way.
-- Daniele Vare
Back to top
View user's profile Send private message
felysium
n00b
n00b


Joined: 27 May 2002
Posts: 43
Location: Netherlands

PostPosted: Fri Oct 11, 2002 10:46 pm    Post subject: Reply with quote

http://www.ecst.csuchico.edu/~dranch/LINUX/ipmasq/examples/rc.firewall-2.4-stronger

Je moet wel de juiste iptables modules hebben gecompileerd.
Back to top
View user's profile Send private message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Sat Oct 12, 2002 12:18 am    Post subject: Reply with quote

wat moet ik allemaal mee compileren voor iptables welke modules en hoe moeten deze gecompileerd worden als module of gewoon in de kernel?
Back to top
View user's profile Send private message
felysium
n00b
n00b


Joined: 27 May 2002
Posts: 43
Location: Netherlands

PostPosted: Sat Oct 12, 2002 12:54 am    Post subject: Reply with quote

>Networking Options
In de kernel:
* Packet socket
* Packet socket mmapped io
* Unix domain sockets
* TCP/IP networking

Network packet filtering

>Networking Options>IP: Netfilter Configuration
Als modules:
M Connection Tracking
M FTP protocol support
M IRC protocol support
M IP tables support
M Full NAT
M MASQUERADE target support
M Connection state match support

en misschien ook nog LOG target support, ik weet niet zeker.
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Sat Oct 12, 2002 9:25 am    Post subject: Reply with quote

alberstom wrote:
wat moet ik allemaal mee compileren voor iptables welke modules en hoe moeten deze gecompileerd worden als module of gewoon in de kernel?

Je kan een firewall instellen met guarddog, als je deze aanzet vraagt hij om de nodige modules die evt. niet aanwezig zijn.
Op zo'n manier kun je experimenteren welke je wel en niet nodig hebt.
Ik gebruik deze:
Code:
CONFIG_PACKET=y

CONFIG_NETFILTER=y

CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE=m
#   IP: Netfilter Configuration
#
CONFIG_IP_NF_CONNTRACK=m
CONFIG_IP_NF_FTP=m
CONFIG_IP_NF_IRC=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_LIMIT=m
CONFIG_IP_NF_MATCH_MAC=m
CONFIG_IP_NF_MATCH_MARK=m
CONFIG_IP_NF_MATCH_MULTIPORT=m
CONFIG_IP_NF_MATCH_TOS=m
CONFIG_IP_NF_MATCH_TCPMSS=m
CONFIG_IP_NF_MATCH_STATE=m
CONFIG_IP_NF_MATCH_UNCLEAN=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_TARGET_REDIRECT=m
CONFIG_IP_NF_NAT_IRC=m
CONFIG_IP_NF_NAT_FTP=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP_NF_TARGET_TOS=m
CONFIG_IP_NF_TARGET_MARK=m
CONFIG_IP_NF_TARGET_LOG=m
Back to top
View user's profile Send private message
voidzero
Bodhisattva
Bodhisattva


Joined: 21 Jul 2002
Posts: 265
Location: Grnn

PostPosted: Sat Oct 12, 2002 9:31 am    Post subject: Reply with quote

biroed wrote:
Je kan een firewall instellen met guarddog


En ter aanvulling: met webmin kan het ook.

Dit is een tof onderwerp, over networking zijn best veel vragen. Daarom heb ik deze maar even sticky gemaakt :)
_________________
Diplomacy is the art of letting the other party have things your way.
-- Daniele Vare
Back to top
View user's profile Send private message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Sat Oct 12, 2002 12:37 pm    Post subject: Reply with quote

nadat ik alle benodigde modules had meegecompileerd voerde ik deze regel in: iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQ (zoals in dit topic is vermeld)

en ik krijg de volgende error : Modporbe Can't locate module ip_tables
iptables v1.2.7a: can't initialize iptables table 'nat : iptables who? (do you need to insmod?)

Wat heb ik verkeerd gedaan of heb ik dingen vergeten te compileren (ook al denk ik dat dat niet het geval is ik heb namelijk gewoon alles gecompileerd wat in het topic stond aangegeven)

en admin dit is inderdaad een leuk / leerzaam topic :D
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Sat Oct 12, 2002 12:43 pm    Post subject: Reply with quote

Doe eens lsmod, je krijgt iets als
Code:
Module                  Size  Used by    Not tainted
ipt_state                568  13  (autoclean)
ipt_REJECT              3000   4  (autoclean)
ipt_limit                888   2  (autoclean)
ipt_LOG                 3416   2  (autoclean)
ip_conntrack_ftp        3808   0  (unused)
ip_conntrack           15100   2  [ipt_state ip_conntrack_ftp]
iptable_filter          1740   1  (autoclean)
ip_tables              11896   5  [ipt_state ipt_REJECT ipt_limit ipt_LOG iptable_filter]

Zoniet, dan ben je modules vergeten...(ip_tables,full nat,masquerade target, rederect target).


Last edited by biroed on Sat Oct 12, 2002 12:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Sat Oct 12, 2002 12:49 pm    Post subject: Reply with quote

als ik het commando "insmod" geef dan krijg ik geen iptables modules te zien

of moet ik iets van "insmod iptables" doen?

en ik kan trouwens in de kernel netfilter niet als module compileren alleen gelijk in de kernel stoppen dus y in plaats van m
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Sat Oct 12, 2002 12:59 pm    Post subject: Reply with quote

alberstom wrote:
als ik het commando "insmod" geef dan krijg ik geen iptables modules te zien

of moet ik iets van "insmod iptables" doen?

en ik kan trouwens in de kernel netfilter niet als module compileren alleen gelijk in de kernel stoppen dus y in plaats van m


Ik bedoel "lsmod" list modules, als je niks ziet staan kun je b.v. inderdaad modprobe ip_tables etc. doen, kijk even hoe de modules heten(o.a. ip-conntrack-ftp, iptable_filter, ip_tables, ipt_LOG etc.)
Back to top
View user's profile Send private message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Sat Oct 12, 2002 1:56 pm    Post subject: Reply with quote

ik heb dus lsmod gedaan en ik krijg dus niet de modules die er zouden moeten staan (ik krijg alleen me videokaart driver en nic driver) en als ik modprobe staat er can't locate module (bijv ip_tables)

kan iemand mij nog eens uitleggen van voor af aan welke modules ik nou precies moet hebben en hoe deze moeten worden gecompileerd (dus y of m)

ik kan ook Network packet filtering (replaces ipchains) niet als module compileren (klopt dit of zit hier het probleem?)

en als ik alle modules heb gecompileerd moet ik deze dan ook in me /etc/modules.autoload zetten>?

als iptables eenmaal werkt kan ik er zelf wel beetje uitkomen denk/hoop ik door het lezen van de goedde how-to van nedlinux

bedankt voor de snelle reacties tot nu toe relaxed forum =P
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Sat Oct 12, 2002 2:25 pm    Post subject: Reply with quote

Met de lijst van mij +- zes draadjes terug kun je een goede firewall draaien.
Wat ik voorheen deed is deze opties direkt in de kernel compilen, nadeel ze worden allemaal geladen. Het maakt dus eigenlijk niet uit module of niet.
Als je als modules laad, moet je de goede module naam vinden(kijk naar de kernel help functie), dan kan je ze inderdaad in modules.autoload zetten.
Ik gebruik guarddog omdat ik geen iptables guru ben, en omdat hij de modules die het nodig heeft zelf laadt.(mits ze in de kernel staan)
Als hij een module mist dan vraagt hij erom, erg handig voor 'n iptables n00b.
Kijk in jou geval hoe de modules heten die je in de kernel hebt, en laad ze dan......
Back to top
View user's profile Send private message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Sun Oct 13, 2002 10:41 pm    Post subject: Reply with quote

ik heb alles gecompiled in de kernel
maar nog krijg ik dezelfde fout melding :S
bij het invoeren van dit commando:

iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQ

iptables v1.2.7a: can't initialize iptables table 'nat : iptables who? (do you need to insmod?)
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Mon Oct 14, 2002 4:27 pm    Post subject: Reply with quote

Je kan testen of iptables werkt,
met "iptables -L -n" kun je jouw rules zien.
Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Als dat werkt kun je een regel toevoegen b.v." iptables -A INPUT -p icmp -j DROP " je machine reageerd nu niet meer op pings.
Als je geen foutmelding heb gehad, doe je nog eens "iptables -L -n".
Nu zie je de regel:
Code:
 Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       icmp --  0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

staan, en iptables werkt dus eigenlijk. Als je firewall complexer word zul je ook meerdere modules moeten laden, en dat zul je zelf moeten testen.
Het kan dus zijn dat je voor de rule: iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQ geen module hebt geladen.....
Voor de juiste module kan vocis je misschien helpen :wink:
Back to top
View user's profile Send private message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Tue Oct 15, 2002 11:29 am    Post subject: Reply with quote

als ik iptables test krijg ik weer een fout

can't innitialize iptables table 'filter: iptables who?
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Tue Oct 15, 2002 9:08 pm    Post subject: Reply with quote

Code:
CONFIG_PACKET=y

CONFIG_NETFILTER=y

CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE=m
#   IP: Netfilter Configuration
#
CONFIG_IP_NF_CONNTRACK=m
CONFIG_IP_NF_FTP=m
CONFIG_IP_NF_IRC=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_LIMIT=m
CONFIG_IP_NF_MATCH_MAC=m
CONFIG_IP_NF_MATCH_MARK=m
CONFIG_IP_NF_MATCH_MULTIPORT=m
CONFIG_IP_NF_MATCH_TOS=m
CONFIG_IP_NF_MATCH_TCPMSS=m
CONFIG_IP_NF_MATCH_STATE=m
CONFIG_IP_NF_MATCH_UNCLEAN=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_TARGET_REDIRECT=m
CONFIG_IP_NF_NAT_IRC=m
CONFIG_IP_NF_NAT_FTP=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP_NF_TARGET_TOS=m
CONFIG_IP_NF_TARGET_MARK=m
CONFIG_IP_NF_TARGET_LOG=m

Weet je zeker dat je deze modules (of direkt gecompiled) in je kernel hebt? Ipchains niet gebruikt?(werkt niet samen met iptables)
Dan behoort het te werken....
Back to top
View user's profile Send private message
alberstom
n00b
n00b


Joined: 05 Sep 2002
Posts: 26

PostPosted: Thu Oct 17, 2002 6:43 pm    Post subject: Reply with quote

ja dit is allemaal het geval wat kan het probleem zijn :S
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Thu Oct 17, 2002 7:14 pm    Post subject: Reply with quote

deze misschien
Code:
rc-update add iptables default
Back to top
View user's profile Send private message
water
Guru
Guru


Joined: 19 Jun 2002
Posts: 387
Location: Zierikzee, The Netherlands

PostPosted: Fri Oct 18, 2002 6:27 am    Post subject: Reply with quote

biroed wrote:
deze misschien
Code:
rc-update add iptables default


En wat doet dit script? Ik heb het zelf nooit gebruikt of nodig gehad.
_________________
Groeten uit Holland
Back to top
View user's profile Send private message
biroed
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 147
Location: Amsterdam

PostPosted: Sat Oct 19, 2002 7:14 am    Post subject: Reply with quote

Code:
# Location in which iptables initscript will save set rules on
# service shutdown
IPTABLES_SAVE="/var/lib/iptables/rules-save"

# Change to "yes" to enable forwarding support in the kernel.  Please
# note that this will override any setting placed in /etc/sysctl.conf.
ENABLE_FORWARDING_IPv4="no"
ENABLE_FORWARDING_IPv6="no"

Dit is het script, staat er bij mij standaard al in. Iptables heeft een init script, dus het zou kunnen dat ie default moet worden.
Back to top
View user's profile Send private message
water
Guru
Guru


Joined: 19 Jun 2002
Posts: 387
Location: Zierikzee, The Netherlands

PostPosted: Mon Oct 21, 2002 11:10 am    Post subject: Reply with quote

Ik begrijp dat dus elk firewall regeltje dat je intikt opgeslagen wordt bij afsluiten, maar ook weer geladen? Moet ik toch eens proberen. :)
_________________
Groeten uit Holland
Back to top
View user's profile Send private message
voidzero
Bodhisattva
Bodhisattva


Joined: 21 Jul 2002
Posts: 265
Location: Grnn

PostPosted: Thu Nov 14, 2002 12:01 am    Post subject: Reply with quote

biroed wrote:
Code:
# Location in which iptables initscript will save set rules on
# service shutdown
IPTABLES_SAVE="/var/lib/iptables/rules-save"

# Change to "yes" to enable forwarding support in the kernel.  Please
# note that this will override any setting placed in /etc/sysctl.conf.
ENABLE_FORWARDING_IPv4="no"
ENABLE_FORWARDING_IPv6="no"

Dit is het script, staat er bij mij standaard al in. Iptables heeft een init script, dus het zou kunnen dat ie default moet worden.


Ho, voordat het straks verkeerd in de wereld geholpen is; voor de duidelijkheid:

rc-update zorgt ervoor dat bepaalde programma's wel of niet opstarten tijdens het booten.

Dat zegt niets over de inhoud van het script, dit kan van alles zijn, zelfs complete onzin.
/etc/init.d-scripts (zoals /etc/init.d/iptables) zorgen voor het uitvoeren en stoppen van daemons en andere zaken (zoals modules laden etc.). Maar goed, voor meer info: lees de gentoo docs ;)

8)
Mark
_________________
Diplomacy is the art of letting the other party have things your way.
-- Daniele Vare
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Dutch All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum