Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Firewall problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Scandinavian
View previous topic :: View next topic  
Author Message
kuzze
n00b
n00b


Joined: 19 Jan 2003
Posts: 10

PostPosted: Mon Nov 01, 2004 5:08 pm    Post subject: Firewall problem Reply with quote

Jag vill kör en firewall "iptables" på min gentooburk
med ett nat:at "INT" nät och ett icke nat:at "DMZ" nät.

Mitt extif är bond0 som har ip 10.252.5.64 och bond0:0 10.252.5.63
det lilla iptables scriptet jag kör nu funkar dock så är det utan firewall regler
och det ser ut så här.
Code:
#!/bin/bash
IPTABLES='/sbin/iptables'

# Set interface values
EXTIF='bond0'
INTIF1='eth0'
INTIF2='eth2'

# enable ip forwarding in the kernel
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward

# flush rules and delete chains
$IPTABLES -F
$IPTABLES -X

# enable masquerading to allow LAN internet access
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

# forward LAN traffic from $INTIF1 to Internet interface $EXTIF
$IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state NEW,ESTABLISHED -j A$



iptables -t nat -A POSTROUTING -s 10.0.1.2 -j SNAT --to 10.252.5.63
iptables -t nat -A PREROUTING -d 10.252.5.63 -j DNAT --to 10.0.1.2



Om jag nu stänger alla portar utåt för utom 22
det funkar då bara på firewallens ip 10.252.5.64 och .63 blir helt blockad

Hur öppnar jag portarna till både 10.252.5.63 och .64 ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Scandinavian 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