F
F
fbmkatny2018-05-15 21:35:55
Mikrotik
fbmkatny, 2018-05-15 21:35:55

How to configure traffic routing from webproxy to a specific pptp interface, depending on the port?

scheme
(eth1)192.168.1.2:1001<->pptp1
(eth1)192.168.1.2:1002<->pptp2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Cool Admin, 2014-06-25
@ifaustrue

Change the default action to DROP, discard the drop rule.

I
Igor, 2014-06-25
@merryjane

Here is an approximate script with comments to the commands:

#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# сбрасываем правила, очищаем цепочки
iptables -F
iptables -X

# настраиваем политики по умолчанию
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

#
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# LOOPBACK
iptables -A INPUT -i lo -j ACCEPT

# ICMP
iptables -A INPUT -p icmp -j ACCEPT

# если порты для tcp
iptables -A INPUT -p tcp -m multiport --dports 221,10000,2302 -m state --state NEW -j ACCEPT

# если порты для udp
iptables -A INPUT -p udp -m multiport --dports 221,10000,2302 -j ACCEPT

exit 0

The point is that we make the default policies DROP for the INPUT and FORWARD chains, and then we add the permissions we need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question