| Dostęp z zewnątrz - proszę o pomoc ;) | 
| Bronas | Dodano 27-02-2008 09:33 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | Witam Od niedawna posiadam Asus Wl 500 GP od razu wgrałem openwrt WhiteRussian 0.9 i pięknie chodzi. Qos, VPN, Cron wszystko to chodzi pieknie problem mam jedynie z dostępem z zewnątrz do strony X-wrt oraz po ssh ( na standardzie porcie 22 )
 Poniżej zamieszczam zawartość mojego pliku /etc/firewall.users
 
 
 
 ### Open port to WAN## -- This allows port 22 to be answered by (dropbear on) the router
 iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT
 iptables        -A input_wan      -p tcp --dport 22 -j ACCEPT
 
 ### Port forwarding
 ## -- This forwards port 80 on the WAN to port 80 on 192.168.1.1
 iptables -t nat -A prerouting_wan -p tcp --dport 80 -j DNAT --to 192.168.1.1:80
 ptables        -A forwarding_wan -p tcp --dport 80 -d 192.168.1.1 -j ACCEPT
 Dodam, że to nie działa.
 
 Czy nie powinieniem jeszcze wykonać poniższe komendy?:
 
 
 
 echo "forward:proto=tcp dport=8080:192.168.1.1:80" >> /etc/config/firewalloraz
 accept:proto=tcp dport=8080
 Proszę o jakieś sugestie w tej sprawie bo dopiero poznaję możliwości tego systemu.
 | 
|  | 
 
 | 
|  | 
| obsy | Dodano 27-02-2008 09:44 | 
|  
 VIP
 
  
 
 Posty: 5775
 Dołączył: 31/10/2006 20:06
 
 
 | To drugie nie jest potrzebne. Pierwsze zapewnia wszystko co jest wymagane  aby odblokować port 22 i 80. 
 Oczywiście zrestartowałeś ponownie firewalla lub uruchomiłeś ruter ponownie?
 
 | 
|  | 
 
 | 
|  | 
| Bronas | Dodano 27-02-2008 10:05 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | No pewnie ;) Najpierw zrestartowałem firewalla
 
 
 a potem pod ssh
 
 
 
 Powiem że to dalej nie działa.
 Przy połączeniu się przez ssh odrzuca mi połączenie a po http to wyświetla błąd połaczenia - nie znaleziono strone.
 HELP ;)
 | 
|  | 
 
 | 
|  | 
| obsy | Dodano 27-02-2008 10:17 | 
|  
 VIP
 
  
 
 Posty: 5775
 Dołączył: 31/10/2006 20:06
 
 
 | To pokaż wynik iptables -v -L 
 (jak to sprawdzasz? Czasami nie od strony lanu? Jak tak to _może_ nie działać; sprawdz jak faktycznie jesteś na hoście od wan)
 
 | 
|  | 
 
 | 
|  | 
| Bronas | Dodano 27-02-2008 10:22 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | Sprawdzam łącząc się przez VPN CISCO do kompa w pracy i tam probuję się dostać do routera po http. Więc napewno jestem na hoście po stronie WAN'u. Obecnie jestem w pracy więc zabardzo nie mogę wykonać Twojej prośby, wróce to od razu sprawdzę i zamieszcze wynik. Mozesz na PM wysłać mi bezpośredni kontakt do Ciebie ?
  | 
|  | 
 
 | 
|  | 
| reaper7 | Dodano 27-02-2008 11:26 | 
|  
 User
 
  
 
 Posty: 148
 Dołączył: 26/12/2006 15:41
 
 
 | A zobacz to: 
 
 # SSL WEBIFiptables -t nat -A prerouting_wan -p tcp --dport 443 -j DNAT --to 192.168.0.1:443
 iptables        -A input_wan      -p tcp --dport 443 -d 192.168.0.1 -j ACCEPT
 # SSH
 iptables -t nat -A prerouting_wan -p tcp --dport 22 -j DNAT --to 192.168.0.1:22
 iptables        -A input_wan      -p tcp --dport 22 -d 192.168.0.1 -j ACCEPT
U mnie działa - z tym, że mam www po ssl'u więc jeśli Ty masz na porcie 80 to zamień wszystkie wpisy 443 na 80 i oczywiście zmień 192.168.0.1 na 192.168.1.1 :)
 
 =====================ASUS 500gP+Kamikaze
 IPBOX9000HD+STLinux(sh4)
 w razie co Compaq+FreeBSD 6.2
  =====================
 
 | 
|  | 
 
 | 
|  | 
| Bronas | Dodano 27-02-2008 11:45 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | Ok sprawdzę. Mam nadzieję że to pomoże
  | 
|  | 
 
 | 
|  | 
| Bronas | Dodano 27-02-2008 17:21 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | 
  pkts bytes target     prot opt in     out     source               destination 1    56 DROP       all  --  any    any     anywhere             anywhere            state INVALID
 544 74377 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
 4701  188K DROP       tcp  --  any    any     anywhere             anywhere            tcp option=!2 flags:SYN/SYN
 25736 1458K input_rule  all  --  any    any     anywhere             anywhere
 25042 1353K input_wan  all  --  ppp0   any     anywhere             anywhere
 25736 1458K LAN_ACCEPT  all  --  any    any     anywhere             anywhere
 109  6649 ACCEPT     icmp --  any    any     anywhere             anywhere
 0     0 ACCEPT     gre  --  any    any     anywhere             anywhere
 23119 1177K REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset
 1814  169K REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable
 
 Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 0     0 DROP       all  --  any    any     anywhere             anywhere            state INVALID
 8188  392K TCPMSS     tcp  --  any    any     anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
 257K  197M ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
 4616  222K forwarding_rule  all  --  any    any     anywhere             anywhere
 0     0 forwarding_wan  all  --  ppp0   any     anywhere             anywhere
 0     0 ACCEPT     all  --  br0    br0     anywhere             anywhere
 4616  222K ACCEPT     all  --  br0    ppp0    anywhere             anywhere
 
 Chain LAN_ACCEPT (1 references)
 pkts bytes target     prot opt in     out     source               destination
 25042 1353K RETURN     all  --  ppp0   any     anywhere             anywhere
 0     0 RETURN     all  --  vlan1  any     anywhere             anywhere
 694  105K ACCEPT     all  --  any    any     anywhere             anywhere
 
 Chain OUTPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 0     0 DROP       all  --  any    any     anywhere             anywhere            state INVALID
 25601 1246K ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
 150 14735 output_rule  all  --  any    any     anywhere             anywhere
 150 14735 ACCEPT     all  --  any    any     anywhere             anywhere
 0     0 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset
 0     0 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable
 
 Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
 
 Chain forwarding_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination
 0     0 ACCEPT     tcp  --  any    any     anywhere             Asus                tcp dpt:8080
 0     0 ACCEPT     all  --  any    any     anywhere             Bronas.lan
 0     0 ACCEPT     all  --  any    any     anywhere             Bronas.lan
 0     0 ACCEPT     all  --  any    any     anywhere             Bronas.lan
 0     0 ACCEPT     all  --  any    any     anywhere             Bronas.lan
 
 Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
 
 Chain input_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination
 
 Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
 Po komendzie iptables -v -L = wynik jw.
 | 
|  | 
 
 | 
|  | 
| Bronas | Dodano 27-02-2008 17:33 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | Niestety to też nie działa :( Już brak mi pomysłów. 
 
 Cytat reaper7 napisał/a:
A zobacz to:
 # SSL WEBIFiptables -t nat -A prerouting_wan -p tcp --dport 443 -j DNAT --to 192.168.0.1:443
 iptables        -A input_wan      -p tcp --dport 443 -d 192.168.0.1 -j ACCEPT
 # SSH
 iptables -t nat -A prerouting_wan -p tcp --dport 22 -j DNAT --to 192.168.0.1:22
 iptables        -A input_wan      -p tcp --dport 22 -d 192.168.0.1 -j ACCEPT
 
U mnie działa - z tym, że mam www po ssl'u więc jeśli Ty masz na porcie 80 to zamień wszystkie wpisy 443 na 80 i oczywiście zmień 192.168.0.1 na 192.168.1.1 :) | 
|  | 
 
 | 
|  | 
| obsy | Dodano 27-02-2008 17:38 | 
|  
 VIP
 
  
 
 Posty: 5775
 Dołączył: 31/10/2006 20:06
 
 
 | Ale Ty nie restartujesz firewalla! Przeciez w tych regułkach co wypisałeś nie ma ani grama o porcie 22 czy 80... 
 | 
|  | 
 
 | 
|  | 
| Bronas | Dodano 27-02-2008 17:42 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | Dobra czekaj zrestartuje firewalla jeszcze raz!! zobaczymy.. | 
|  | 
 
 | 
|  | 
| Bronas | Dodano 27-02-2008 17:48 | 
|  
 User
 
  
 
 Posty: 39
 Dołączył: 27/02/2008 09:21
 
 
 | Albo jestem kretynem albo teraz to działa  nie wiem czemu, wcześniej też resetowałem i nie wchodziło teraz śmiga. Opinia osób trzecich zawsze dobrze wpływa na rozwiązanie problemu...
 
 To może już pomożecie jeszcze w jednym - jak przenieść usługę ssh na inni niż port 22?
 | 
|  | 
 
 | 
|  | 
| obsy | Dodano 27-02-2008 17:56 | 
|  
 VIP
 
  
 
 Posty: 5775
 Dołączył: 31/10/2006 20:06
 
 
 | Nie pamiętam jak w whiterussian, zobacz  w /etc/init.d/??dropbear tam na sztywno masz port ustawiony. 
 | 
|  | 
 
 |