Hirdetés

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

  • PeterPH

    senior tag

    válasz tomboy1000 #1696 üzenetére

    A 2706-os port-tól visszafelé meg kell nyitni egy pár portot (annyit, amennyit egyidejűleg használni akarsz, a példában 10-et).
    A /tmp/local/sbin/post-firewall fájl a következőket tartalmazza:

    #!/bin/sh
    #SSH
    iptables -D INPUT -j DROP
    iptables -A INPUT -p tcp --dport 2697:2706 -j ACCEPT
    iptables -A INPUT -p udp --dport 2697:2706 -j ACCEPT
    iptables -A INPUT -p tcp --dport 22 -j ACCEPT
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 22 -j DNAT --to-destination 192.168.1.1:22
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2697 -j DNAT --to-destination 192.168.1.1:2697
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2698 -j DNAT --to-destination 192.168.1.1:2698
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2699 -j DNAT --to-destination 192.168.1.1:2699
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2700 -j DNAT --to-destination 192.168.1.1:2700
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2701 -j DNAT --to-destination 192.168.1.1:2701
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2702 -j DNAT --to-destination 192.168.1.1:2702
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2703 -j DNAT --to-destination 192.168.1.1:2703
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2704 -j DNAT --to-destination 192.168.1.1:2704
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2705 -j DNAT --to-destination 192.168.1.1:2705
    iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 2706 -j DNAT --to-destination 192.168.1.1:2706
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2697 -j DNAT --to-destination 192.168.1.1:2697
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2698 -j DNAT --to-destination 192.168.1.1:2698
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2699 -j DNAT --to-destination 192.168.1.1:2699
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2700 -j DNAT --to-destination 192.168.1.1:2700
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2701 -j DNAT --to-destination 192.168.1.1:2701
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2702 -j DNAT --to-destination 192.168.1.1:2702
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2703 -j DNAT --to-destination 192.168.1.1:2703
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2704 -j DNAT --to-destination 192.168.1.1:2704
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2705 -j DNAT --to-destination 192.168.1.1:2705
    iptables -t nat -A PREROUTING -i vlan1 -p udp --dport 2706 -j DNAT --to-destination 192.168.1.1:2706
    iptables -A INPUT -j DROP

    A 22-es port az SSH miatt van megnyitva.
    A WAN interfész nálam a vlan1, de ez lehet hogy nálad más, ráadásul a post firewall scriptben lehet használni azt hiszem a $1 változót helyette. A 192.168.1.1 a router LAN IP címe, e helyett lehet használni a $4 változót.

    [ Szerkesztve ]

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