ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Как отменить проброшенный порт?
@ 2008-09-26  5:17 Vitalik Salomatin
  2008-09-26  5:20 ` SKeeper
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vitalik Salomatin @ 2008-09-26  5:17 UTC (permalink / raw)
  To: community

Допустим я пробросил 80 порт снаружи через сервер на копм внутри 
сети
iptables -t nat -A PREROUTING -d 11.11.11.61 -p 
tcp --destination-port 80 -j DNAT --to-destination 10.0.0.112

А как отменить только это правило? (http)

Я знаю, что так

iptables -t nat -D POSTROUTING 2

можно отменить 2 правило в моем примере изнутри


# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DNAT       tcp  --  anywhere             77.247.212.61       tcp 
dpt:ssh to:10.0.0.112
DNAT       tcp  --  anywhere             77.247.212.61       tcp 
dpt:http to:10.0.0.112

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  0    --  10.0.0.4             anywhere
MASQUERADE  0    --  10.0.0.112             anywhere


А как только HTTP, оставив например ssh?

Спасибо.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Comm] Как отменить проброшенный порт?
  2008-09-26  5:17 [Comm] Как отменить проброшенный порт? Vitalik Salomatin
@ 2008-09-26  5:20 ` SKeeper
  2008-09-26  5:26 ` Костарев Алексей
  2008-09-26  5:31 ` Костарев Алексей
  2 siblings, 0 replies; 4+ messages in thread
From: SKeeper @ 2008-09-26  5:20 UTC (permalink / raw)
  To: Vitalik Salomatin, ALT Linux Community general discussions

Vitalik Salomatin пишет:
> Допустим я пробросил 80 порт снаружи через сервер на копм внутри 
> сети
> iptables -t nat -A PREROUTING -d 11.11.11.61 -p 
> tcp --destination-port 80 -j DNAT --to-destination 10.0.0.112
>
> А как отменить только это правило? (http)
>
>   
Переписываете все правило, но -A заменяете на -D и удалится только оно

iptables -t nat -D PREROUTING -d 11.11.11.61 -p 
tcp --destination-port 80 -j DNAT --to-destination 10.0.0.112



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Comm] Как отменить проброшенный порт?
  2008-09-26  5:17 [Comm] Как отменить проброшенный порт? Vitalik Salomatin
  2008-09-26  5:20 ` SKeeper
@ 2008-09-26  5:26 ` Костарев Алексей
  2008-09-26  5:31 ` Костарев Алексей
  2 siblings, 0 replies; 4+ messages in thread
From: Костарев Алексей @ 2008-09-26  5:26 UTC (permalink / raw)
  To: Vitalik Salomatin, ALT Linux Community general discussions

Vitalik Salomatin пишет:
> Допустим я пробросил 80 порт снаружи через сервер на копм внутри 
> сети
> iptables -t nat -A PREROUTING -d 11.11.11.61 -p 
> tcp --destination-port 80 -j DNAT --to-destination 10.0.0.112
>
> А как отменить только это правило? (http)
>   
Запустить правило с флагом -D

iptables -t nat -A PREROUTING -d 11.11.11.61 -p tcp --destination-port 80 -j DNAT --to-destination 10.0.0.112




-- 
С Уважением
Директор ООО НЕВОД
Костарев А.Ф.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Comm] Как отменить проброшенный порт?
  2008-09-26  5:17 [Comm] Как отменить проброшенный порт? Vitalik Salomatin
  2008-09-26  5:20 ` SKeeper
  2008-09-26  5:26 ` Костарев Алексей
@ 2008-09-26  5:31 ` Костарев Алексей
  2 siblings, 0 replies; 4+ messages in thread
From: Костарев Алексей @ 2008-09-26  5:31 UTC (permalink / raw)
  To: Vitalik Salomatin, ALT Linux Community general discussions

Vitalik Salomatin пишет:
> Допустим я пробросил 80 порт снаружи через сервер на копм внутри 
> сети
> iptables -t nat -A PREROUTING -d 11.11.11.61 -p 
> tcp --destination-port 80 -j DNAT --to-destination 10.0.0.112
>
> А как отменить только это правило? (http)
>   
Прошу прощения - букву перепутал

iptables -t nat -D PREROUTING -d 11.11.11.61 -p tcp --destination-port 80 -j DNAT --to-destination 10.0.0.112


> Я знаю, что так
>
> iptables -t nat -D POSTROUTING 2
>
> можно отменить 2 правило в моем примере изнутри
>
>
> # iptables -t nat -L
> Chain PREROUTING (policy ACCEPT)
> target     prot opt source               destination
> DNAT       tcp  --  anywhere             77.247.212.61       tcp 
> dpt:ssh to:10.0.0.112
> DNAT       tcp  --  anywhere             77.247.212.61       tcp 
> dpt:http to:10.0.0.112
>
> Chain POSTROUTING (policy ACCEPT)
> target     prot opt source               destination
> MASQUERADE  0    --  10.0.0.4             anywhere
> MASQUERADE  0    --  10.0.0.112             anywhere
>
>
> А как только HTTP, оставив например ssh?
>
> Спасибо.
>
>
> _______________________________________________
> community mailing list
> community@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/community


-- 
С Уважением
Директор ООО НЕВОД
Костарев А.Ф.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-26  5:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-26  5:17 [Comm] Как отменить проброшенный порт? Vitalik Salomatin
2008-09-26  5:20 ` SKeeper
2008-09-26  5:26 ` Костарев Алексей
2008-09-26  5:31 ` Костарев Алексей

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git