Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Make iptables rules with targets by IP work through VPN.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
unknown_person
n00b
n00b


Joined: 08 Apr 2020
Posts: 40

PostPosted: Mon Jun 08, 2020 4:37 pm    Post subject: Make iptables rules with targets by IP work through VPN. Reply with quote

Hello, really make iptables work with targets by IP when working through a VPN?
At the moment the situation is as follows, the rules that are configured to work with certain subnets work with a direct connection, but stop working when using a VPN.
Immediately warn, not to offer options with setting iptables on a VPS server or something else, because I do not have access to it.
Back to top
View user's profile Send private message
Banana
l33t
l33t


Joined: 21 May 2004
Posts: 657
Location: Germany

PostPosted: Mon Jun 08, 2020 9:35 pm    Post subject: Reply with quote

show us your rules maybe someone can figure it out.
My gues is that VPN does have other IPs and make she rules not working anymore.
_________________
My personal space
Back to top
View user's profile Send private message
unknown_person
n00b
n00b


Joined: 08 Apr 2020
Posts: 40

PostPosted: Mon Jun 08, 2020 9:49 pm    Post subject: Reply with quote

@Banana:
Code:
iptables -A OUTPUT -o tun0 -d 94.232.56.0/21 -j DROP

As an example.
Waiting: Connections to IP from this subnet should drop and sites using these IPs should stop working.
Reality: Connection is successful and the sites open.
Back to top
View user's profile Send private message
unknown_person
n00b
n00b


Joined: 08 Apr 2020
Posts: 40

PostPosted: Mon Jun 08, 2020 10:12 pm    Post subject: Reply with quote

The problem is resolved.
The problem was that I did not understand correctly the order of priority rules, I thought that the prohibiting rule has the highest priority over other rules, but it’s not so, the priority of the rules is set by list, that is, if there is an allowing rule at the very top, and the prohibiting rule is at the very bottom, the highest priority will be given to the allowing rule and the prohibiting rule will not work.
Back to top
View user's profile Send private message
Banana
l33t
l33t


Joined: 21 May 2004
Posts: 657
Location: Germany

PostPosted: Tue Jun 09, 2020 9:07 am    Post subject: Reply with quote

Glad you learned something new and solved it
_________________
My personal space
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum