Linux Netfilter discussions
 help / color / mirror / Atom feed
* [Help] Allow website using iptables
@ 2020-05-04  6:53 Sơn Đỗ
  2020-05-04  8:43 ` Alessandro Vesely
  0 siblings, 1 reply; 9+ messages in thread
From: Sơn Đỗ @ 2020-05-04  6:53 UTC (permalink / raw)
  To: netfilter

I have a Linux router and using iptables 1.4 to configure the firewall.

And I want to permit a device to access a certain website with a
domain name and block other websites. So I have use some cmds in
iptables below:



iptables -N allow_chain
iptables -A FORWARD -j allow_chain
iptables -A allow_chain -m mac --mac-source 11:22:33:44:55:66 -m
string --algo bm --string youtube -j ACCEPT
iptables -A allow_chain -m mac --mac-source 11:22:33:44:55:66 -j DROP


In this case, I want computer with MAC address 11:22:33:44:55:66
connected to my Linux router can only access the youtube . But the
result was not my expectation, after I apply those rules , my computer
cannot access to youtube and other web also, it drop all internet
connection . In my understanding, the rule with ACCEPT target was not
apply even the package match with the condition, and all packages are
handled in the rule with DROP target.

So is there any thing wrong with my cmd? What was the problem ?

Please help me, Thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [Help] Allow website using iptables
@ 2020-05-04  8:54 Lazuardi Nasution
  2020-05-04 14:00 ` John Haxby
  0 siblings, 1 reply; 9+ messages in thread
From: Lazuardi Nasution @ 2020-05-04  8:54 UTC (permalink / raw)
  To: netfilter; +Cc: Sơn Đỗ

Hi,

YouTube use SSL. So you can't match strings inside the packet, it is
encrypted.

Best regards,

On Mon, May 4, 2020, 15:40 Sơn Đỗ <sondd1096@gmail.com> wrote:

> I have a Linux router and using iptables 1.4 to configure the firewall.
>
> And I want to permit a device to access a certain website with a
> domain name and block other websites. So I have use some cmds in
> iptables below:
>
>
>
> iptables -N allow_chain
> iptables -A FORWARD -j allow_chain
> iptables -A allow_chain -m mac --mac-source 11:22:33:44:55:66 -m
> string --algo bm --string youtube -j ACCEPT
> iptables -A allow_chain -m mac --mac-source 11:22:33:44:55:66 -j DROP
>
>
> In this case, I want computer with MAC address 11:22:33:44:55:66
> connected to my Linux router can only access the youtube . But the
> result was not my expectation, after I apply those rules , my computer
> cannot access to youtube and other web also, it drop all internet
> connection . In my understanding, the rule with ACCEPT target was not
> apply even the package match with the condition, and all packages are
> handled in the rule with DROP target.
>
> So is there any thing wrong with my cmd? What was the problem ?
>
> Please help me, Thanks.
>

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

end of thread, other threads:[~2020-05-11 12:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04  6:53 [Help] Allow website using iptables Sơn Đỗ
2020-05-04  8:43 ` Alessandro Vesely
2020-05-07  1:40   ` Trent W. Buck
  -- strict thread matches above, loose matches on Subject: below --
2020-05-04  8:54 Lazuardi Nasution
2020-05-04 14:00 ` John Haxby
2020-05-11 10:20   ` Sơn Đỗ
2020-05-11 11:34     ` Reindl Harald
2020-05-11 11:48       ` Mauricio Tavares
2020-05-11 12:24         ` Marc SCHAEFER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox