Temat: Zablokowane porty? Openwrrt opowiada tylko na ping.

Witam 

Zainstalowałem sobie     jakąś tam wersję     openwrt nie do końca pasującą do mojego   routera na razie z  jedną kartą ( czyli jeszcze to nie router).   Nie za bardzo wiem jak ma wyglądać   iptables ( załączone). Sorry że wielkie  ale nie wiem co   można wywalić.  Pobiera sobie sam adres z  DHCP   oraz jak już   weźmie to odpowiada  na   ping.  Interesuje mnie odblokowanie  ssh  oraz httpd.


root@OpenWrt:/# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            ctstate RELATED,EST
ABLISHED
ACCEPT     all  --  anywhere             anywhere
syn_flood  tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,R
ST,ACK/SYN
input_rule  all  --  anywhere             anywhere
input      all  --  anywhere             anywhere

Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            ctstate RELATED,EST
ABLISHED
forwarding_rule  all  --  anywhere             anywhere
forward    all  --  anywhere             anywhere
reject     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            ctstate RELATED,EST
ABLISHED
ACCEPT     all  --  anywhere             anywhere
output_rule  all  --  anywhere             anywhere
output     all  --  anywhere             anywhere

Chain forward (1 references)
target     prot opt source               destination
zone_wan_forward  all  --  anywhere             anywhere

Chain forwarding_lan (1 references)
target     prot opt source               destination

Chain forwarding_rule (1 references)
target     prot opt source               destination

Chain forwarding_wan (1 references)
target     prot opt source               destination

Chain input (1 references)
target     prot opt source               destination
zone_wan   all  --  anywhere             anywhere

Chain input_lan (1 references)
target     prot opt source               destination

Chain input_rule (1 references)
target     prot opt source               destination

Chain input_wan (1 references)
target     prot opt source               destination

Chain output (1 references)
target     prot opt source               destination
zone_lan_ACCEPT  all  --  anywhere             anywhere
zone_wan_ACCEPT  all  --  anywhere             anywhere

Chain output_rule (1 references)
target     prot opt source               destination

Chain reject (3 references)
target     prot opt source               destination
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-res
et
REJECT     all  --  anywhere             anywhere            reject-with icmp-po
rt-unreachable

Chain syn_flood (1 references)
target     prot opt source               destination
RETURN     tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,R
ST,ACK/SYN limit: avg 25/sec burst 50
DROP       all  --  anywhere             anywhere

Chain zone_lan (0 references)
target     prot opt source               destination
input_lan  all  --  anywhere             anywhere
zone_lan_ACCEPT  all  --  anywhere             anywhere

Chain zone_lan_ACCEPT (2 references)
target     prot opt source               destination

Chain zone_lan_DROP (0 references)
target     prot opt source               destination

Chain zone_lan_REJECT (1 references)
target     prot opt source               destination

Chain zone_lan_forward (0 references)
target     prot opt source               destination
zone_wan_ACCEPT  all  --  anywhere             anywhere
forwarding_lan  all  --  anywhere             anywhere
zone_lan_REJECT  all  --  anywhere             anywhere

Chain zone_wan (1 references)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere            udp dpt:bootpc
ACCEPT     icmp --  anywhere             anywhere            icmp echo-request
input_wan  all  --  anywhere             anywhere
zone_wan_REJECT  all  --  anywhere             anywhere

Chain zone_wan_ACCEPT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain zone_wan_DROP (0 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere

Chain zone_wan_REJECT (2 references)
target     prot opt source               destination
reject     all  --  anywhere             anywhere
reject     all  --  anywhere             anywhere

Chain zone_wan_forward (1 references)
target     prot opt source               destination
forwarding_wan  all  --  anywhere             anywhere
zone_wan_REJECT  all  --  anywhere             anywhere

2

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

http://eko.one.pl/?p=openwrt-konfigurac … estronywan

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

3

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Dzięki szukałem właśnie tego ale niestety nie pomogło  dodam  jeszcze   netstat. Może coś pomoże?


root@OpenWrt:/# netstat -al
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:www             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:domain          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:telnet          0.0.0.0:*               LISTEN
netstat: /proc/net/tcp6: No such file or directory
udp        0      0 0.0.0.0:domain          0.0.0.0:*
udp        0      0 0.0.0.0:bootps          0.0.0.0:*
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  6      [ ]         DGRAM                       255 /dev/log
unix  2      [ ACC ]     STREAM     LISTENING        352 /var/run/ubus.sock
unix  2      [ ]         DGRAM                       946
unix  2      [ ]         DGRAM                       874
unix  2      [ ]         DGRAM                       378
unix  2      [ ]         DGRAM                       367
unix  3      [ ]         STREAM     CONNECTED        365 /var/run/ubus.sock
unix  3      [ ]         STREAM     CONNECTED        364
unix  2      [ ]         DGRAM                       346

4

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

To pokaż cały /etc/config/firewall

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

5

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

To po  dodaniu   tych komend z linku (odblokowanie portów).  Mam z routera  normalny dostęp do netu       zainstalowałem sobie mc.  Obecnie łącze się terminalem  po rs232.


root@OpenWrt:/etc/config# cat 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 name 'Allow-ICMPv6-Forward'
        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 rule
        option name 'ssh'
        option src 'wan'
        option target 'ACCEPT'
        option proto 'tcp'
        option dest_port '22'

6

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

I masz publiczne ip na wanie tego routera?

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

7 (edytowany przez aloszka 2016-04-06 21:48:52)

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Nie   pobiera sobie lokalnie  z innego routera. Może  coś pomoże że   chyba  to jest na  alix-a 2 tego 3-ethernetowego. Może coś jeszcze   jest w nim uruchomione.  Teraz działa   na alix3

root@OpenWrt:/etc/config# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0D:B9:18:CC:74
          inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2521 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2223 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:232624 (227.1 KiB)  TX bytes:211292 (206.3 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1639 (1.6 KiB)  TX bytes:1639 (1.6 KiB)

8

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Więc:
a) ta reguła jest zbędna, bo ona jest dla wanu
b) ty masz źle skonfigurowane to, bo na routerze nadrzędnym musisz przekierować porty które chcesz na ip tego routera.

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

9 (edytowany przez aloszka 2016-04-06 21:51:47)

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Nie   ja nie chcę go wystawiać na zewnątrz   , potrzeba mi lokalnie nim sterować. Czyli  potrzebne mi www  i ssh      po lan.

10

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

I tak jest - ssh domyślnie słucha na lanie (jak sobie hasło ustawisz przez telnet), www tak samo.

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

11

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Może     jest nieskonfigurowany     serwer  www i  ssh?   Nieraz już odpalałem    openwrt na jakiś wynalazkach   .  Serwer www  był już zainstalowany.

12

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Ale  odpowiada tylko  na   ping po lan!

13

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Sam pokazałeś że słucha i telnet/ssh i www. Jeżeli tylko masz taką samą adresację i jesteś do tego lanu dołączony to musi działać.

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

14

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Trzeba by jakoś   odmienić  porty  a może ,któryś wywalić na razie. Zamieniony jest LAN z WAN  , trzeba by odmienić tylko nie wiem    jeszcze jak  wywalić coś ?  WAN  bierze  adres   LAN-u  i stąd     na LAN  mam tylko ping...

root@OpenWrt:/etc/config# cat network
# Copyright (C) 2011 OpenWrt.org

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

# N.B. the labels on the Netgate boxes actually reverse the LAN and WAN
# port markings.
config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

config interface wan
        option ifname   eth0
        option proto    dhcp

15

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Domyślnie openwrt blokuje wszystko co jest na wanie i musisz otwierać te porty które chcesz - więc wróć do drugiego postu. wan nie może mieć takiej samej adresacji jak lan bo wszystko będzie sprawiało problem wtedy.

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

16

Odp: Zablokowane porty? Openwrrt opowiada tylko na ping.

Tak   już wiem nawet zanim odpisałeś    komenda ze stronki Twojej nie działa ale   pogrzebałem w  firewall    (musiałem się dostosować do konfigu ) i już  po lanie jestem w routerku.  Dzięki.