rendered paste body# iptables-save
# Generated by iptables-save v1.3.5 on Thu Aug 17 12:32:04 2006
*nat
:PREROUTING ACCEPT [1:48]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i ppp0 -p tcp -m tcp --dport 1022 -j DNAT --to-destination 10.0.0.87:22
COMMIT
# Completed on Thu Aug 17 12:32:04 2006
# Generated by iptables-save v1.3.5 on Thu Aug 17 12:32:04 2006
*filter
:INPUT DROP [7:517]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [299:43937]
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
COMMIT
# Completed on Thu Aug 17 12:32:04 2006
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:81:59:6E:58
inet addr:10.0.0.88 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:81ff:fe59:6e58/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:464 errors:0 dropped:0 overruns:0 frame:0
TX packets:386 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:45749 (44.6 Kb) TX bytes:58721 (57.3 Kb)
Interrupt:233
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
ppp0 Link encap:Point-to-Point Protocol
inet addr:84.2.132.69 P-t-P:145.236.238.111 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:886 (886.0 b) TX bytes:61 (61.0 b)
$ ssh 84.2.132.69
vmiklos@84.2.132.69's password:
Last login: Thu Aug 17 12:34:54 2006 from frugalware.elte.hu
vmiklos@nemesis:~$ ssh 10.0.0.87
vmiklos@10.0.0.87's password:
^ tehat ez megy faszan
$ ssh -p 1022 10.0.0.87
^ ez meg nem
# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 55 packets, 3185 bytes)
pkts bytes target prot opt in out source destination
2 120 DNAT tcp -- ppp0 any anywhere anywhere tcp dpt:1022 to:10.0.0.87:22
^ es ez a legviccesebb, h a csomagszam szepen no, tehat atengedi
jah, es ahogy irtad, INPUT 1022re nincs engedelyezve, de forward meg alapbol van
szal latod, h hol van itt a problema? :)