SuSE 9.3 NAT

Fórumok

Hát a problémám adot, szeretnék NAT-ot indítani és egy egyzserű port forwardot SuSE 9.3-on. Squid megy rajta, tehát a böngészéssel nincs gond, de a NAT-ra is szükség lenne, mert így nem megy se a torrent, se a netrádió, se a Thunderbird... Már rengeteget gugliztam, keresgéltem, olvasgattam, találtam is sok leírást, de egyik sem akar menni, még a legegyszerűbb sem. (Értsd: a parancsot elfogadja, de nem NAT-ol). Már a tűzfalak kikapcsolását is próbáltam, meg úgy is, hogy a squid-et leállítottam, nehogy bezavarjon.

A helyzet tehát, van egy SuSE, ami wifin (ra0 interfész) kapcsolódik az AP-hoz, és eth1 a belső háló.

Mi lehet a gond? Már próbálkozok kb. 3 napja....

Hozzászólások

iptables?

valamint a csomag atiranyitast engedelyezted?
echo "1" > /proc/sys/net/ipv4/ip_forward

SuSEfirewall2 ?
mondjuk ilyen reszletesen nem lehet konfigolni GUI val de pl: ip forwardingot, masqizet lehet, advanced konfigot cask /etc/sysconing/susefirewall (ha jol emlekszek) lehet

Kikapcsoltad a tuzfalat es akkor sem ment? Hogy probaltad? Mivolt a hibauzenet vagy mi van a logokban?

Azt irtad hogy a http megy, csak a tobbi nem. Peldaul hogy nem megy a Thunderbird. A Suse-s geprol ki tudsz-e menni a 110-es portra (feltetelezem hogy egy kulso mail szerverhez probalsz csatlakozni)?

"a hostról az AP-ra még egy vacak ping se megy át" - ez a host a Suse-s gep vagy egy desktop bentrol?

Íme:
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
input_int all -- anywhere anywhere
input_int all -- anywhere anywhere
input_ext all -- anywhere anywhere
LOG all -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-IN-ILL-TARGET '
DROP all -- anywhere anywhere

Chain FORWARD (policy DROP)
target prot opt source destination
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
forward_int all -- anywhere anywhere
forward_int all -- anywhere anywhere
forward_ext all -- anywhere anywhere
LOG all -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWD-ILL-ROUTING '
DROP all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
LOG all -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-OUT-ERROR '

Chain forward_ext (1 references)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp echo-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp time-exceeded
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp parameter-problem
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp timestamp-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp address-mask-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp protocol-unreachable
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp redirect
LOG tcp -- anywhere anywhere limit: avg 3/min burst 5 tcp flags:SYN,RST,ACK/SYN LOG level warning tcp-options ip-options prefix `SFW2-FWDext-DROP-DEFLT '
LOG icmp -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWDext-DROP-DEFLT '
LOG udp -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWDext-DROP-DEFLT '
LOG all -- anywhere anywhere limit: avg 3/min burst 5 state INVALID LOG level warning tcp-options ip-options prefix `SFW2-FWDext-DROP-DEFLT-INV '
DROP all -- anywhere anywhere

Chain forward_int (2 references)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp echo-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp time-exceeded
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp parameter-problem
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp timestamp-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp address-mask-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp protocol-unreachable
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp redirect
LOG tcp -- anywhere anywhere limit: avg 3/min burst 5 tcp flags:SYN,RST,ACK/SYN LOG level warning tcp-options ip-options prefix `SFW2-FWDint-DROP-DEFLT '
LOG icmp -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWDint-DROP-DEFLT '
LOG udp -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-FWDint-DROP-DEFLT '
LOG all -- anywhere anywhere limit: avg 3/min burst 5 state INVALID LOG level warning tcp-options ip-options prefix `SFW2-FWDint-DROP-DEFLT-INV '
DROP all -- anywhere anywhere

Chain input_ext (1 references)
target prot opt source destination
DROP all -- anywhere anywhere PKTTYPE = broadcast
ACCEPT icmp -- anywhere anywhere icmp source-quench
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp echo-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp time-exceeded
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp parameter-problem
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp timestamp-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp address-mask-reply
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp protocol-unreachable
ACCEPT icmp -- anywhere anywhere state RELATED,ESTABLISHED icmp redirect
reject_func tcp -- anywhere anywhere tcp dpt:ident state NEW
LOG tcp -- anywhere anywhere limit: avg 3/min burst 5 tcp flags:SYN,RST,ACK/SYN LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
LOG icmp -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
LOG udp -- anywhere anywhere limit: avg 3/min burst 5 LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT '
LOG all -- anywhere anywhere limit: avg 3/min burst 5 state INVALID LOG level warning tcp-options ip-options prefix `SFW2-INext-DROP-DEFLT-INV '
DROP all -- anywhere anywhere

Chain input_int (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere

Chain reject_func (1 references)
target prot opt source destination
REJECT tcp -- anywhere anywhere reject-with tcp-reset
REJECT udp -- anywhere anywhere reject-with icmp-port-unreachable
REJECT all -- anywhere anywhere reject-with icmp-proto-unreachable

Közbe rajtavagyok az ügyön :), próbáltam egy másik SuSE-n is, ami ugyan nem erre van fenttartva, de azért kipróbálni jó volt...
Hogy értsétek, így néz ki a háló:


........./-------\.........../---\
.*)-ra0--| Proxy |---eth1----|.S.|--------PC1
.........\-------/...........|.W.|
.............|...............|.I.|
.............eth0............|.T.|--------PC2
.............|...............|.C.|
........./-------\...........|.H.|
.........|Apache.|---eth1----|...|--------PC3
.........\-------/...........\---/

Amit próbáltam: a fentebb említett egyszerű módon NAT-ot csinálni a webszerveren, PC1 gatewaynek apache eth1, proxy eth1 down (nehogy ott válaszoljon), a próba a PC1-ről a proxy eth0 pingelése volt, ugyanúgy nem natol az apache-os gép sem... :(

Újraindítottam a proxy-s és a webszerveres gépet is, megcsináltam, most az apach-on átmegy a ping a proxyra....

Egyébként a routing tábla így néz ki a proxyn:

Kernel IP routing table
Destination.....Gateway.........Genmask.........Flags.Metric.Ref......Use.Iface
10.0.0.0........0.0.0.0.........255.255.255.0...U.....0......0........0...eth0
192.168.1.0.....0.0.0.0.........255.255.255.0...U.....0......0........0...eth1
10.1.2.0........0.0.0.0.........255.255.255.0...U.....0......0........0...ra0
169.254.0.0.....0.0.0.0.........255.255.0.0.....U.....0......0........0...eth0
127.0.0.0.......0.0.0.0.........255.0.0.0.......U.....0......0........0...lo
0.0.0.0.........10.1.2.1........0.0.0.0.........UG....0......0........0...ra0

"Újraindítottam a proxy-s és a webszerveres gépet is, megcsináltam, most az apach-on átmegy a ping a proxyra...."
Ezt úgy értettem, hogy válasz is jön, tehát műxik. :)
Mert nincs gateway, csak a default gateway, ami az utolsó sorba figyel. Egyébként szerintem ebben a felállásba nem sok köze volt a routing táblának ahhoz, hogy a proxy eth0-ról nem ment vissza a ping a PC1-re. Tudtommal pont ez a NAT lényege, hogy a külső gépeknek nem kell tudni a belső hálóról. Vagyis a webszerver ip-jét látja a proxy az echo request-be, és arra küldi a reply-t, neki arról fogalma nincs, hogy az máshonnan jött. Márpedig ebbe az esebe nincs szükség routing táblára, mert a forráscím a saját hálójából jött, közvetlenül eléri.

Akkor mostmár csak azt kell kideríteni, hogy a proxy miért nem natol...

Még egy kérdés... Ezeket amit beírogatok az iptables-be, ezeket megjegyzi, vagyis újraindítás után is megmaradnak? Mert akkor lehet, hogy azért nem megy, mert már próbálkoztam annyiféle képpen, hogy szörnyű....
Van arra valami parancs, hogy az iptables-t alaphelyzetbe hozzam?
pl.: iptables --restoredefaults