1 (edytowany przez reFORma 2013-05-26 22:38:35)

Temat: Gargoyle 1.5.9.1 przekierowanie portu na router

mam dziwną przypadłość (pewnie przez braki w wiedzy)
konfiguracja wygląda tak:
modem ADSL->router->lan

odpalam na routerze - server (aplikacja własna) która oczekuje na transmisję na porcie 8030 i co bym nie robił nic nie dostaje sad brak komunikacji z komputerem na zewnątrz. Ten sam server odpalony na drugim routerku podłączonym wewnątrz sieci lan (z przekierowaniem na niego) działa prawidłowo.

plik: firewall

config defaults
    option syn_flood '1'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'lan'
    option network 'lan'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'wan'
    option network 'wan'
    option input 'REJECT'
    option output 'ACCEPT'
    option forward 'REJECT'
    option masq '1'
    option mtu_fix '1'

config forwarding
    option src 'lan'
    option dest 'wan'

config rule
    option name 'Allow-DHCP-Renew'
    option src 'wan'
    option proto 'udp'
    option dest_port '68'
    option target 'ACCEPT'
    option family 'ipv4'

config rule
    option name 'Allow-Ping'
    option src 'wan'
    option proto 'icmp'
    option icmp_type 'echo-request'
    option family 'ipv4'
    option target 'ACCEPT'

config rule
    option name 'Allow-DHCPv6'
    option src 'wan'
    option proto 'udp'
    option src_ip 'fe80::/10'
    option src_port '547'
    option dest_ip 'fe80::/10'
    option dest_port '546'
    option family 'ipv6'
    option target 'ACCEPT'

config rule
    option name 'Allow-ICMPv6-Input'
    option src 'wan'
    option proto 'icmp'
    list icmp_type 'echo-request'
    list icmp_type 'echo-reply'
    list icmp_type 'destination-unreachable'
    list icmp_type 'packet-too-big'
    list icmp_type 'time-exceeded'
    list icmp_type 'bad-header'
    list icmp_type 'unknown-header-type'
    list icmp_type 'router-solicitation'
    list icmp_type 'neighbour-solicitation'
    list icmp_type 'router-advertisement'
    list icmp_type 'neighbour-advertisement'
    option limit '1000/sec'
    option family 'ipv6'
    option target 'ACCEPT'

config rule
    option name 'Allow-ICMPv6-Forward'
    option src 'wan'
    option dest '*'
    option proto 'icmp'
    list icmp_type 'echo-request'
    list icmp_type 'echo-reply'
    list icmp_type 'destination-unreachable'
    list icmp_type 'packet-too-big'
    list icmp_type 'time-exceeded'
    list icmp_type 'bad-header'
    list icmp_type 'unknown-header-type'
    option limit '1000/sec'
    option family 'ipv6'
    option target 'ACCEPT'

config include
    option path '/etc/firewall.user'

config include
    option path '/usr/lib/gargoyle_firewall_util/gargoyle_additions.firewall'

config include 'openvpn_include_file'
    option path '/etc/openvpn.firewall'

config restriction_rule 'rule_1'
    option is_ingress '0'
    option description 'xbox'
    option local_addr '7C:ED:8D:98:0F:4C'
    option enabled '1'

config remote_accept 'ra_22_22'
    option local_port '22'
    option remote_port '22'
    option proto 'tcp'
    option zone 'wan'

config redirect 'redirect_enabled_number_0'
    option name '-'
    option src 'wan'
    option dest 'lan'
    option proto 'tcp'
    option src_dport '8030'
    option dest_ip '192.168.1.1'
    option dest_port '8030'

config redirect 'redirect_enabled_number_1'
    option name '-'
    option src 'wan'
    option dest 'lan'
    option proto 'udp'
    option src_dport '8030'
    option dest_ip '192.168.1.1'
    option dest_port '8030'

nie mam już pomysłu co z tym zrobić - wiem, że powinno to działać, jednak ja poległem.
proszę podpowiedzcie cosik

2

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

Jeżeli aplikacja jest uruchomiona na routerze  za modemem adsl i połączony przez wan  to masz tylko otworzyć port: http://eko.one.pl/?p=openwrt-konfigurac … estronywan. Jeżeli modem jest przezroczysty to to wszystko, jeżeli robi nata to masz na nim (na adslu) ten port przekierować na router.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

Dzięki za podpowiedzi.
Dodałem reguły i niestety efekt jest taki sam jak poprzednio:

config defaults
    option syn_flood '1'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'lan'
    option network 'lan'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'wan'
    option network 'wan'
    option input 'REJECT'
    option output 'ACCEPT'
    option forward 'REJECT'
    option masq '1'
    option mtu_fix '1'

config forwarding
    option src 'lan'
    option dest 'wan'

config rule
    option name 'Allow-DHCP-Renew'
    option src 'wan'
    option proto 'udp'
    option dest_port '68'
    option target 'ACCEPT'
    option family 'ipv4'

config rule
    option name 'Allow-Ping'
    option src 'wan'
    option proto 'icmp'
    option icmp_type 'echo-request'
    option family 'ipv4'
    option target 'ACCEPT'

config rule
    option name 'Allow-DHCPv6'
    option src 'wan'
    option proto 'udp'
    option src_ip 'fe80::/10'
    option src_port '547'
    option dest_ip 'fe80::/10'
    option dest_port '546'
    option family 'ipv6'
    option target 'ACCEPT'

config rule
    option name 'Allow-ICMPv6-Input'
    option src 'wan'
    option proto 'icmp'
    list icmp_type 'echo-request'
    list icmp_type 'echo-reply'
    list icmp_type 'destination-unreachable'
    list icmp_type 'packet-too-big'
    list icmp_type 'time-exceeded'
    list icmp_type 'bad-header'
    list icmp_type 'unknown-header-type'
    list icmp_type 'router-solicitation'
    list icmp_type 'neighbour-solicitation'
    list icmp_type 'router-advertisement'
    list icmp_type 'neighbour-advertisement'
    option limit '1000/sec'
    option family 'ipv6'
    option target 'ACCEPT'

config rule
    option name 'Allow-ICMPv6-Forward'
    option src 'wan'
    option dest '*'
    option proto 'icmp'
    list icmp_type 'echo-request'
    list icmp_type 'echo-reply'
    list icmp_type 'destination-unreachable'
    list icmp_type 'packet-too-big'
    list icmp_type 'time-exceeded'
    list icmp_type 'bad-header'
    list icmp_type 'unknown-header-type'
    option limit '1000/sec'
    option family 'ipv6'
    option target 'ACCEPT'

config include
    option path '/etc/firewall.user'

config include
    option path '/usr/lib/gargoyle_firewall_util/gargoyle_additions.firewall'

config include 'openvpn_include_file'
    option path '/etc/openvpn.firewall'

config restriction_rule 'rule_1'
    option is_ingress '0'
    option description 'xbox'
    option local_addr '7C:ED:8D:98:0F:4C'
    option enabled '1'

config remote_accept 'ra_22_22'
    option local_port '22'
    option remote_port '22'
    option proto 'tcp'
    option zone 'wan'

config rule
    option _name 'p0_8030'
    option src 'wan'
    option target 'ACCEPT'
    option proto 'tcp'
    option dest_port '8030'

config rule
    option _name 'p1_8030'
    option src 'wan'
    option target 'ACCEPT'
    option proto 'udp'
    option dest_port '8030'

konfiguracja połączenia:

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option ifname 'eth0.1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option dns '192.168.1.1'

config interface 'wan'
    option ifname 'eth0.2'
    option proto 'pppoe'
    option username 'xxxxxxxx@net24.com.pl'
    option password 'yyyyyyyy'
    option keepalive '3 5'

config switch
    option name 'eth0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'eth0'
    option vlan '1'
    option ports '0t 2 3 4 5'

config switch_vlan
    option device 'eth0'
    option vlan '2'
    option ports '0t 1'

Jeśli router podłącze w sieci gdzie konfiguracja wygląda tak: WAN->router->LAN to wszystko działa prawidłowo. Nie mam pomysłu dlaczego przez modem to nie działa.

4

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

iptables -v -L INPUT

zrób i zobacz czy przy regułce od portu licznik Ci się zwiększa w ogóle.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5 (edytowany przez reFORma 2013-05-27 22:54:57)

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

Nie bardzo wiem jak to odczytać:

root@Gargoyle:~# iptables -v -L INPUT
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  148 33172 bw_ingress  all  --  pppoe-wan any     anywhere             anywhere
  147 33754 ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED
   87  6347 ACCEPT     all  --  lo     any     anywhere             anywhere
    1    52 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
  258  109K input_rule  all  --  any    any     anywhere             anywhere
  258  109K input      all  --  any    any     anywhere             anywhere
root@Gargoyle:~# iptables -v -L INPUT
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  148 33172 bw_ingress  all  --  pppoe-wan any     anywhere             anywhere
  155 34178 ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED
   87  6347 ACCEPT     all  --  lo     any     anywhere             anywhere
    1    52 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
  258  109K input_rule  all  --  any    any     anywhere             anywhere
  258  109K input      all  --  any    any     anywhere             anywhere
root@Gargoyle:~# iptables -v -L INPUT
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  151 33355 bw_ingress  all  --  pppoe-wan any     anywhere             anywhere
  163 34602 ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED
   87  6347 ACCEPT     all  --  lo     any     anywhere             anywhere
    1    52 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
  261  109K input_rule  all  --  any    any     anywhere             anywhere
  261  109K input      all  --  any    any     anywhere             anywhere
root@Gargoyle:~# iptables -v -L INPUT
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  151 33355 bw_ingress  all  --  pppoe-wan any     anywhere             anywhere
  170 34986 ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED
   87  6347 ACCEPT     all  --  lo     any     anywhere             anywhere
    1    52 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
  261  109K input_rule  all  --  any    any     anywhere             anywhere
  261  109K input      all  --  any    any     anywhere             anywhere
root@Gargoyle:~#

6

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

Wg konfiga miałeś odblokować port 8030. Za grosz w ttym co pokazałeś nie ma tego portu. Uruchomiłeś firewalla czy router ponownie?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

to około 5 restart firewalla i z 3 restart boxa z wpisami:

config rule
    option _name 'p0_8030'
    option src 'wan'
    option target 'ACCEPT'
    option proto 'tcp'
    option dest_port '8030'

config rule
    option _name 'p1_8030'
    option src 'wan'
    option target 'ACCEPT'
    option proto 'udp'
    option dest_port '8030'

8

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

Zrób /etc/init.d/firewall restart i zobaczy czy błędów gdzieś nie ma.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

9

Odp: Gargoyle 1.5.9.1 przekierowanie portu na router

root@Gargoyle:~# /etc/init.d/firewall restart
Loading defaults
Loading synflood protection
Adding custom chains
Loading zones
Loading forwardings
Loading rules
Loading redirects
Loading includes
udhcpc (v1.19.4) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
Optimizing conntrack
Loading interfaces
root@Gargoyle:~#