Keresés

Hirdetés

Új hozzászólás Aktív témák

  • Almos

    aktív tag

    válasz Almos #15910 üzenetére

    Sajnos vannak még furcsaságok...
    A tomato admin felületet most el tudom érni kívülről, viszont a lighttpd-n futó oldalakat most már nem, azokra timeout a válasz, pedig 1 órája még működött. lighttpd-t gond nélkül újra tudom indítani ssh-n keresztül, de nincs változás. Az rtorrent leállításakor, vagy újraindításakor viszont ezt az üzenetet kapom:
    root@router:/tmp/home/root# /opt/etc/init.d/S99rtorrent stop
    Stopping rtorrent
    iptables: Bad rule (does a matching rule exist in that chain?)
    .

    Közben arra már rájöttem, hogy az előbb írt iptables szabályok nem tökéletesek, így azt már javítottam, a scripts/firewall alatt most ezek találhatóak:
    iptables -D INPUT -j DROP
    iptables -I INPUT -p tcp --dport 6890 -j ACCEPT
    iptables -A INPUT -p tcp --dport 443 -j ACCEPT
    iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:443
    iptables -A INPUT -j DROP

    Az iptables pedig így néz ki:
    root@router:/tmp/home/root# iptables -L
    Chain INPUT (policy DROP)
    target prot opt source destination
    ACCEPT tcp -- anywhere anywhere tcp dpt:6890
    DROP all -- anywhere 178-164-141-89.pool.digikabel.hu
    logdrop all -- anywhere anywhere state INVALID
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT all -- anywhere anywhere
    ACCEPT all -- anywhere anywhere
    ACCEPT icmp -- anywhere anywhere
    ACCEPT udp -- anywhere anywhere udp dpts:33434:33534
    ACCEPT tcp -- anywhere router tcp dpt:www
    ACCEPT tcp -- anywhere router tcp dpt:ssh
    ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
    logdrop all -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere tcp dpt:https
    DROP all -- anywhere anywhere

    Chain FORWARD (policy DROP)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere
    DROP all -- anywhere anywhere state INVALID
    TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
    monitor all -- anywhere anywhere
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    wanin all -- anywhere anywhere
    wanout all -- anywhere anywhere
    ACCEPT all -- anywhere anywhere
    upnp all -- anywhere anywhere

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Chain logdrop (2 references)
    target prot opt source destination
    LOG all -- anywhere anywhere state NEW limit: avg 2/sec burst 5 LOG level warning tcp-options ip-options prefix `DROP '
    DROP all -- anywhere anywhere

    Chain logreject (0 references)
    target prot opt source destination
    LOG all -- anywhere anywhere limit: avg 2/sec burst 5 LOG level warning tcp-options ip-options prefix `REJECT '
    REJECT tcp -- anywhere anywhere reject-with tcp-reset

    Chain monitor (1 references)
    target prot opt source destination
    all -- anywhere anywhere WEBMON --max_domains 300 --max_searches 300

    Chain upnp (1 references)
    target prot opt source destination

    Chain wanin (1 references)
    target prot opt source destination
    ACCEPT tcp -- anywhere router tcp dpt:https
    ACCEPT udp -- anywhere router udp dpt:https

    Chain wanout (1 references)
    target prot opt source destination

    Ezekből a FORWARD chain 6 és 7-es szabálya tűnt gyanúsnak, ezeket töröltem. Ezután már nem jelzett iptables bad rules hibát az rtorrent újraindításkor, de továbbra sem tudom wan oldalról elérni az rtorrent/ados/stb kezelőfelületét...

    A logban viszont továbbra is van egy csomó ilyen bejegyzés:
    Nov 23 12:19:01 router user.warn kernel: DROP IN=ppp0 OUT= MAC= SRC=84.1.212.36 DST=178.164.141.89 LEN=58 TOS=0x00 PREC=0x00 TTL=118 ID=18106 PROTO=UDP SPT=53293 DPT=6890 LEN=38
    Nov 23 12:19:03 router user.warn kernel: DROP IN=ppp0 OUT= MAC= SRC=195.56.51.243 DST=178.164.141.89 LEN=95 TOS=0x00 PREC=0x00 TTL=117 ID=11071 PROTO=UDP SPT=58993 DPT=6890 LEN=75

    Ötlet, javaslat, mit ronthattam el?

  • Intruder2k5

    MODERÁTOR

    válasz Almos #15910 üzenetére

    És ez az összes ami ott van? Nem hinném, hogy ez így működne, mivel legjobb tudomásom szerint a Tomato nem kezeli ezeket a változókat, stb, stb... Én ezt így módosítanám ADSL internet esetén:

    iptables -D INPUT -j DROP
    iptables -I INPUT -p tcp --dport 6880 -j ACCEPT
    iptables -I INPUT -p tcp --dport 443 -j ACCEPT
    iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:443
    iptables -A INPUT -j DROP

    és így DHCP-s kapcsolat esetén:

    iptables -D INPUT -j DROP
    iptables -I INPUT -p tcp --dport 6880 -j ACCEPT
    iptables -I INPUT -p tcp --dport 443 -j ACCEPT
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 443 -j DNAT --to-destination 192.168.1.1:443
    iptables -A INPUT -j DROP

    Ezekben már benne van az is, hogy a torrent kapcsolatod aktív legyen, amennyiben a 6880-as portot használod. Ha nem, akkor értelemszerűen módosítani kell.

    szerk.:
    És még annyit, hogy ha a saját otthoni hálózatodból próbálgatod a távoli elérést mondjuk dyndns cím alapján, akkor még az

    Advanced -< Firewall -> NAT Loopback -> All

    legyen.

    [ Szerkesztve ]

Új hozzászólás Aktív témák