sziasztok, A tproxy patch-el megpatcheltem a 2.4.19-es kernelemet, leforditottam majd betoltottem a tproxy modulbol. majd feltettem a 1.4.8-as zorpot a deb csomagbol, ami fent van a lapon... elkovettem a kov konfigot: .... from Zorp.NAT import * ..... class Inter_SSH_Intra(PlugProxy): pass .... def Test(): Service("inter_SSH_intra", Inter_SSH_Intra, router=DirectedRouter(SockAddrInet ("192.168.0.100",22)), snat=ForgeClientSourceNAT()) Listener(SockAddrInet(IP_OUT,30000), "inter_SSH_intra") es azt vartam volna hogy bevisz SSH-n a belso gepre ugy, hogy latom a belso gepen a konnektalo gep IP-jet... valamit elcseszhettem, mert azt irja a zorp a logba, hogy nem tudja bindelni a cimet....pedig tproxy-val megpactheltem a kernelt ;-( Mit cseszhettem el? sziasztok, Istvan log: Nov 19 21:38:41 stargate Test[2807]: (zorp/nosession): Incoming connection; remote='AF_INET(195.38.103.132:1216)', fd='9' Nov 19 21:38:41 stargate Test[2807]: (Zorp@StarGate/inter_SSH_intra): Connection accepted; client_address='AF_INET(195.38.10 3.132:1216)' Nov 19 21:38:41 stargate Test[2807]: (Zorp@StarGate/inter_SSH_intra:0): Starting proxy instance; client_fd='9', client_addre ss='AF_INET(195.38.103.132:1216)', client_zone='Zone(internet, 0.0.0.0/0)', client_local='AF_INET(213.222.165.148:30000)' Nov 19 21:38:41 stargate Test[2807]: (Zorp@StarGate/inter_SSH_intra:0/plug): Proxy starting; class='Inter_SSH_Intra', module ='plug' Nov 19 21:38:41 stargate Test[2807]: (zorp/nosession): Module successfully loaded; module='plug', file='/usr/lib/zorp/libplu g.so' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): thread starting; Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): calling __config__() event; Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): calling config() event; Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): Config dump, attribute value; name='packet_stat s_interval', value='0' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): Config dump, attribute value; name='copy_to_cli ent', value='1' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): Config dump, attribute value; name='timeout', v alue='-1' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): Config dump, attribute value; name='copy_to_ser ver', value='1' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): calling __startup__() event; Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): calling startUp() event; Nov 19 21:38:41 stargate Test[2810]: (zorp/nosession): Connecting to remote host; local='AF_INET(195.38.103.132:0)', remote= 'AF_INET(192.168.0.100:22)' Nov 19 21:38:41 stargate Test[2810]: (zorp/nosession): Changing process capabilities; caps='= cap_net_bind_service+ep cap_ne t_admin+p' Nov 19 21:38:41 stargate Test[2810]: (zorp/nosession): Changing process capabilities; caps='= cap_net_bind_service,cap_net_a dmin+ep' Nov 19 21:38:41 stargate Test[2810]: (zorp/nosession): bind() failed; error='Cannot assign requested address' Nov 19 21:38:41 stargate Test[2810]: (zorp/nosession): Resetting process capabilities; caps='= cap_net_bind_service,cap_net_ admin+p' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): Exception occurred during connection establishm ent; Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): calling __destroy__() event; Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): Proxy destroy; class='Inter_SSH_Intra', module= 'plug' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0): client: Shutdown channel; fd='9', mode='2' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0): client: Closing channel; fd='9' Nov 19 21:38:41 stargate Test[2810]: (Zorp@StarGate/inter_SSH_intra:0/plug): thread exiting; Nov 19 21:38:41 stargate Test[2807]: (Zorp@StarGate/inter_SSH_intra:0/plug): Proxy ending; class='Inter_SSH_Intra', module=' plug' Nov 19 21:38:41 stargate Test[2807]: (Zorp@StarGate/inter_SSH_intra:0): client: accounting info; duration='0', sent='0', rec eived='0'
On Tue, Nov 19, 2002 at 11:33:14PM +0100, Ifj. Darvas Istvan wrote:
sziasztok,
A tproxy patch-el megpatcheltem a 2.4.19-es kernelemet, leforditottam majd betoltottem a tproxy modulbol.
majd feltettem a 1.4.8-as zorpot a deb csomagbol, ami fent van a lapon...
elkovettem a kov konfigot:
.... from Zorp.NAT import * ..... class Inter_SSH_Intra(PlugProxy): pass .... def Test(): Service("inter_SSH_intra", Inter_SSH_Intra, router=DirectedRouter(SockAddrInet ("192.168.0.100",22)), snat=ForgeClientSourceNAT()) Listener(SockAddrInet(IP_OUT,30000), "inter_SSH_intra")
es azt vartam volna hogy bevisz SSH-n a belso gepre ugy, hogy latom a belso gepen a konnektalo gep IP-jet...
valamit elcseszhettem, mert azt irja a zorp a logba, hogy nem tudja bindelni a cimet....pedig tproxy-val megpactheltem a kernelt ;-(
talaltunk egy hibat a kintlevo tproxy patchben, valoszinuleg patch generalasa kozben nyomtam egy sortorlest, a patch ennek ellenere fordul, de nem jol mukodik. az iptable_tproxy.c-ben az ip_tproxy_getsockopt() fuggvenyben van egy IP_TPROXY_FLAGS eset a switch-ben, ez valahogy igy nez ki: case IP_TPROXY_FLAGS: { u32 flags; return -EINVAL; ... a return elol hianyzik ez a sor: if (*len != sizeof(flags)) tehat helyesen: case IP_TPROXY_FLAGS: { u32 flags; if (*len != sizeof(flags)) return -EINVAL; modul ujraforditas utan mennie kell (rmmod/insmod) -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
Valakinek javult meg ezzel? Nekem tovabbra is bind() failed; error='Cannot assign requested address' van es nem tudom, hogy en rontottam e el valamit. Koszi d On 2002 Nov 20 at 08:57, Balazs Scheidler wrote:
talaltunk egy hibat a kintlevo tproxy patchben, valoszinuleg patch generalasa kozben nyomtam egy sortorlest, a patch ennek ellenere fordul, de nem jol mukodik.
az iptable_tproxy.c-ben az ip_tproxy_getsockopt() fuggvenyben van egy IP_TPROXY_FLAGS eset a switch-ben, ez valahogy igy nez ki:
case IP_TPROXY_FLAGS: { u32 flags;
return -EINVAL;
...
a return elol hianyzik ez a sor:
if (*len != sizeof(flags))
tehat helyesen:
case IP_TPROXY_FLAGS: { u32 flags;
if (*len != sizeof(flags)) return -EINVAL;
modul ujraforditas utan mennie kell (rmmod/insmod)
-- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
On Thu, Nov 21, 2002 at 12:11:28PM +0100, Hegedus Ferenc wrote:
Valakinek javult meg ezzel? Nekem tovabbra is bind() failed; error='Cannot assign requested address' van es nem tudom, hogy en rontottam e el valamit.
hamu a fejemre.. most mar tenyleg irok a tproxy patchrol egy szosszenetet. ifconfig dummy0 1.2.3.4 - 1.2.3.4 az mindegy mi, ne legyen lokalis, es ne legyen routeolhato) - az ip cimnek meg kell egyeznie a --autobind-ip parameterrel megadott cimmel (zorp parameter, instances.conf-bol) -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
On 2002 Nov 21 at 17:11, Balazs Scheidler wrote:
On Thu, Nov 21, 2002 at 12:11:28PM +0100, Hegedus Ferenc wrote:
Valakinek javult meg ezzel? Nekem tovabbra is bind() failed; error='Cannot assign requested address' van es nem tudom, hogy en rontottam e el valamit.
hamu a fejemre.. most mar tenyleg irok a tproxy patchrol egy szosszenetet.
ifconfig dummy0 1.2.3.4
- 1.2.3.4 az mindegy mi, ne legyen lokalis, es ne legyen routeolhato) - az ip cimnek meg kell egyeznie a --autobind-ip parameterrel megadott cimmel (zorp parameter, instances.conf-bol)
-- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
A --autobind-ip opciot csak 2.0pre21-ben lattam, az 1.4.8-asban nem. Pedig ujraforditottam 1.4.8-ast is egy --enable-netfilter-tproxy opcioval, az mire jo akkor? :) De akkor felraktam egy 2.0pre21-et is: A policy.py-t megirtam, SNAT nelkul mukodik is, a kovetkezokepp nez ki: az xx.xx.xx.xx 80-as porton uldogel egy HttpProxy, DirectedRouter-er atkuldi a 127.0.0.1 80-as portra. Ezutan megcsinaltam az ifconfig dummy0 10.0.0.1-t. Az instances.conf-ban ott van a --autobind-ip 10.0.0.1 A policy.py-ben a NAT-ot beallitottam: Service("ServiceHttpd", ClassHttpd, router=DirectedRouter(SockAddrInet("127.0.0.1",80)),snat=ForgeClientSourceNAT()) El is indul a proxy hibauzenet nelkul, de ha yy.yy.yy.yy iprol megnezem egy bongeszovel xx.xx.xx.xx-et, akkor a zorp eljut addig, hogy: Initiating connection; from='AF_INET(yy.yy.yy.yy:0)', to='AF_INET(127.0.0.1:80)' ezutan a kovetkezo sorok ismetlodnek a kern.log-ban: setup_nat, bidir lesz, proto=6, ctinfo=2 IP_TPROXY: ip_tproxy_setup_nat(): already inited! adding nat entry hooknum=4 0100000a:1a90 -> yyyyyyyy:1b90 Ezt 30 masodpercig probalja, majd a zorp ezt mondja: Connection to remote end failed; remote='AF_INET(127.0.0.1:80)', error='Connection timed out' majd ad egy: The target system was down and is not servicing requests tipusu hibaoldalt Csomagszuron nem akad meg elvileg, ip_forward is be van kapcsolva, iptable_nat, ip_conntrack modulok bent vannak, az eredeti es a javitott iptable_tproxy modulnal is ezt csinalja. Mit csinalok rosszul? Koszi d
participants (3)
-
Balazs Scheidler
-
Hegedus Ferenc
-
Ifj. Darvas Istvan