Wygląd

Moze mi ktos pomoc z iptables ? linux/router USR9105

Autor XiSiO

8 odpowiedziarchiwum

Software

Wątek archiwalny, dyskusja jest zamknięta.

Mam router 9105 oparty na linuxie i mam iptables
ale nie umiej zrobi przekierowania portow za pomoca iptables, moze mi ktos podpowie jaka regolka wpisjemy przekierowanie / blokowanie ?

iptables v1.2.7a

Usage: iptables -[AD] chain rule-specification [options]
iptables -[RI] chain rulenum rule-specification [options]
iptables -D chain rulenum [options]
iptables -[LFZ] [chain] [options]
iptables -[NX] chain
iptables -E old-chain-name new-chain-name
iptables -P chain target [options]
iptables -h (print this help information)

Commands:
Either long or short options are allowed.
--append -A chain Append to chain
--delete -D chain Delete matching rule from chain
--delete -D chain rulenum
Delete rule rulenum (1 = first) from chain
--insert -I chain [rulenum]
Insert in chain as rulenum (default 1=first)
--replace -R chain rulenum
Replace rule rulenum (1 = first) in chain
--list -L [chain] List the rules in a chain or all chains
--flush -F [chain] Delete all rules in chain or all chains
--zero -Z [chain] Zero counters in chain or all chains
--new -N chain Create a new user-defined chain
--delete-chain
-X [chain] Delete a user-defined chain
--policy -P chain target
Change policy on chain to target
--rename-chain
-E old-chain new-chain
Change chain name, (moving any references)
Options:
--proto -p [!] proto protocol: by number or name, eg. `tcp'
--source -s [!] address[/mask]
source specification
--destination -d [!] address[/mask]
destination specification
--in-interface -i [!] input name[+]
network interface name ([+] for wildcard)
--jump -j target
target for rule (may load target extension)
--match -m match
extended match (may load extension)
--numeric -n numeric output of addresses and ports
--out-interface -o [!] output name[+]
network interface name ([+] for wildcard)
--table -t table table to manipulate (default: `filter')
--verbose -v verbose mode
--line-numbers print line numbers when listing
--exact -x expand numbers (display exact values)
[!] --fragment -f match second or further fragments only
--modprobe=<command> try to insert modules using this command
--set-counters PKTS BYTES set the counter during insert/append
[!] --version -V print package version.

FTOS target options
--set-ftos value Set TOS field in packet header to value
This value can be in decimal (ex: 32)
or in hex (ex: 0x20)

MARK target v1.2.7a options:
--set-mark value Set nfmark value


SNAT v1.2.7a options:
--to-source <ipaddr>[-<ipaddr>][:port-port]
Address to map source to.
(You can use this more than once)


REDIRECT v1.2.7a options:
--to-ports <port>[-<port>]
Port (range) to map to.


MASQUERADE v1.2.7a options:
--to-ports <port>[-<port>]
Port (range) to map to.


DNAT v1.2.7a options:
--to-destination <ipaddr>[-<ipaddr>][:port-port]
Address to map destination to.
(You can use this more than once)


LOG v1.2.7a options:
--log-level level Level of logging (numeric or see syslog.conf)
--log-prefix prefix Prefix log messages with this prefix.

--log-tcp-sequence Log TCP sequence numbers.

--log-tcp-options Log TCP options.

--log-ip-options Log IP options.


Standard v1.2.7a options:
(If target is DROP, ACCEPT, RETURN or nothing)

TCPMSS target v1.2.7a mutually-exclusive options:
--set-mss value explicitly set MSS option to specified value
--clamp-mss-to-pmtu automatically clamp MSS value to (path_MTU - 40)

ICMP v1.2.7a options:
--icmp-type [!] typename match icmp type
(or numeric type or type/code)

Valid ICMP Types:
echo-reply (pong)
destination-unreachable
network-unreachable
host-unreachable
protocol-unreachable
port-unreachable
fragmentation-needed
source-route-failed
network-unknown
host-unknown
network-prohibited
host-prohibited
TOS-network-unreachable
TOS-host-unreachable
communication-prohibited
host-precedence-violation
precedence-cutoff
source-quench
redirect
network-redirect
host-redirect
TOS-network-redirect
TOS-host-redirect
echo-request (ping)
router-advertisement
router-solicitation
time-exceeded (ttl-exceeded)
ttl-zero-during-transit
ttl-zero-during-reassembly
parameter-problem
ip-header-bad
required-option-missing
timestamp-request
timestamp-reply
address-mask-request
address-mask-reply

limit v1.2.7a options:
--limit avg max average match rate: default 3/hour
[Packets per second unless followed by
/sec /minute /hour /day postfixes]
--limit-burst number number to match in a burst, default 5


state v1.2.7a options:
[!] --state [INVALID|ESTABLISHED|NEW|RELATED][,...]
State(s) to match


TCP v1.2.7a options:
--tcp-flags [!] mask comp match when TCP flags & mask == comp
(Flags: SYN ACK FIN RST URG PSH ALL NONE)
[!] --syn match when only SYN flag set
(equivalent to --tcp-flags SYN,RST,ACK SYN)
--source-port [!] port[:port]
--sport ...
match source port(s)
--destination-port [!] port[:port]
--dport ...
match destination port(s)
--tcp-option [!] number match if TCP option set


UDP v1.2.7a options:
--source-port [!] port[:port]
--sport ...
match source port(s)
--destination-port [!] port[:port]
--dport ...
match destination port(s)

MARK match v1.2.7a options:
[!] --mark value[/mask] Match nfmark value with optional mask
"Przyjaźń - bezcenna za wszytko inne
zapłacisz adeną" (C) XiSiO
Link do posta
  1. Może to ciutek pomoże....

    Remek

    Remek Link do posta
  2. co do blokowania to looknij tutaj

    qp15

    qp15 Link do posta
  3. cale neostrada info juz przejzalem

    XiSiO

    ale nadal nie wiem jaka jest skladnia regolki dodajacej
    XiSiO Link do posta
    1. skoro tak to lepiej szukaj na forum linux

      qp15

      qp15 Link do posta
    2. to znalazlem...

      qp15

      cytuje:

      Problem ten omowie na podstawie programu buddyphone.
      Ponizej przedstawiam sposob konfiguracji firewall-a (iptables) dla buddyphone-a
      * wystarczy w iptables wpisac stosowna regulke (zadnych dodatkowych redirect lub cos w tym stylu) regulka poprawna to np.:

      /usr/local/sbin/iptables -A PREROUTING -t nat -p udp -d 217.96.208.35 --dport 10000 -j DNAT --to 192.168.0.2:700
      217.96.208.35 - to przykład adresu naszego serwera (adres publiczny)
      --dport 10000 - to przyklad portu na ktory chcemy na zewnatrz widziec buddyphona (lepiej stosować porty powyżej 1024)

      192.168.0.2:700 - to przyklad adresu komputera na ktorym chcemy miec dostep.
      Dajemy na koncu :700 - (ten port buddyphone wykorzystje standardowo)

      * dla kazdego uzytkownika (komputera) w sieci przypisujemy inny port na serwerze (ale to chyba logiczne ;)
      * laczac sie z zewnatrz wybieramy IP (dla przykladu powyzej): 217.96.208.35:10000
      * nie opłaca sie instalowac najnowszej wersji buddyphona 3.x (bo nie wiadomo gdzie wpisywac adres IP), tak wiec polecam wersje 2.x
      qp15 Link do posta
  4. popatrz np na Linux iptables Howto

    gorky

    np tutaj: http://www.linuxguruz.com/iptables/howto/

    Ale dalej nie rozumiem czego nie jestes w stanie zrobic korzystajac z konfiguracji Virtual Servers via Web Interface...
    gorky Link do posta
    1. chmmm duzo rzeczy mozna wiecej z CLI zrobic

      XiSiO

      niz z www ktore jest dosc ograniczone, np przekieroj ruch zportu 80 na moj serwer www w sieci lokalnej.
      XiSiO Link do posta
    2. a to akurat

      gorky

      robie w trywialny sposob przez Virtual Servers - po co maja mi pakiety gonic do wszystkich kompow w sieci, jak server www mam tylko jeden...
      gorky Link do posta
Zgłoś nadużycie

Kolejne wątki w dziale Software

Cały dział Software
  1. Kto wziął wolne na premierę GTA? · autor: gromki_86 · Re: 23 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  2. Legalnosc klucza - MS Office 2024 · autor: dida · Re: 13 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  3. Windows - usypianie kontra hibernacja - co stosujecie? · autor: gromki_86 · Re: 16 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  4. Kopiowanie dużej ilości plików starszych niż wskazany czas wg daty modyfikacji · autor: Jumper · Re: 3 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  5. ma ktos Prime i nie odbiera z Luna gier? · autor: marcin502 · Re: 5 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  6. Dlaczego Excel zaczął pokazywać sumę wartości wielu komórek jako "-0,00 zł"? · autor: NimnuL · Re: 8 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  7. Star Wars Zero Company · autor: rookie · Re: 1 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  8. Spotify - wstrzymywanie strumienia audio przy zmianie utworu · autor: Kool@ · Re: 7 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  9. Techspot pyta otwarcie: was ray tracing a scam · autor: rookie · Re: 21 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

  10. CashyOs, poczytalem, pogladalem tych bijacych "Niemca" po kasku tez, zreszta innych chyba · autor: etranger · Re: 26 Otwórz wątekSoftware

    Wczytuję wątek…

    Otwórz wątek

Wróć na stronę główną Boarda