iptables - zoufalstvi - cele

Martin Dvorak martin.dvorak na jasnet.cz
Čtvrtek Květen 22 09:25:47 CEST 2003


nemate jen otocene sitovky?
martik

Kovar Jan wrote:
> Ujela mi ruka, ted posilam cele.
> 
> Dobry den.
> 
> Uz si pripadam jako idiot. Nemuzu zprovoznit iptables. Postupne jsem zacal
> odebirat vsechno mozne, az jsem se dostal do stavu, kdy uz nemam zadny FW,
> ale predpokladal jsem, ze mam aspon NAT. Ale mam houby. :-( Zkusil jsem
> distribucni jadro RH 9 updatnute z up2date na 2.4.20-13.9. Zkusil jsem
> stejne jadro, ale se vsim z vetve netfilter primo v jadre a bez natahovani
> modulu. Bez rozdilu.
> 
> Udelal jsem script nat-only, ktery se mi spousti pri startu.
> 
> -----------------------
> 
> #!/bin/sh
> 
> echo "1" > /proc/sys/net/ipv4/ip_forward
> 
> for interface in /proc/sys/net/ipv4/conf/*/rp_filter; do
>    echo "1" > ${interface}
> done
> 
> # Natahneme moduly
> 
> /sbin/depmod -a
> /sbin/modprobe ip_tables
> /sbin/modprobe ip_conntrack
> /sbin/modprobe iptable_mangle
> /sbin/modprobe iptable_nat
> /sbin/modprobe ipt_MASQUERADE
> /sbin/modprobe ip_conntrack_ftp
> /sbin/modprobe ip_nat_ftp
> 
> # Normalne vsechno zakazuju, ale ted uz si nevim rady.
> iptables -P INPUT ACCEPT
> iptables -P OUTPUT ACCEPT
> iptables -P FORWARD ACCEPT
> 
> iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
> iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j
> ACCEPT 
> iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE
> 
> ---------------------
> 
> Vypis iptables -L -v
> 
> Chain INPUT (policy ACCEPT 159 packets, 10452 bytes)
>  pkts bytes target     prot opt in     out     source
> destination         
> 
> Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
>  pkts bytes target     prot opt in     out     source
> destination         
>     0     0 ACCEPT     all  --  eth1   eth0    anywhere             anywhere
> 
>     0     0 ACCEPT     all  --  eth0   eth1    anywhere             anywhere
> state RELATED,ESTABLISHED 
> 
> Chain OUTPUT (policy ACCEPT 131 packets, 11750 bytes)
>  pkts bytes target     prot opt in     out     source
> destination         
> 
> ---------------------
> 
> Mozna to mam pred ocima, ale nevidim to. :-((
> 
> Myslel jsem, ze sam posledni radek:
> 
> iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE
> 
> Bude stacit na NAT. Ale asi to nechapu. Precetl jsem dost pozorne clanky
> pana Petricka na root.cz, prochazim iptables tutorial od Oskara Andreassona,
> ale nic.
> BTW, v tom tutorialu se pouziva SNAT --to-source adresa. To mi moje iptables
> vubec nesezerou. Sezerou SNAT --to adresa, ale stejne to nefunguje.
> 
> Prosim o nakopnuti. Klidne spicatou botou, pokud to k necemu bude.
> 
> Diky
> 
> TNX



Další informace o konferenci Linux