conf t
no ip nat service sip tcp port 5060
no ip nat service sip udp port 5060
tc filter add dev eth1 protocol ip parent 1:0 prio 25 u32 match \
ip sport 80 0xffff flowid 1:10
tc class add dev eth1 parent 1: classid 1:1 htb rate 100Mbit ceil 100Mbit
<?php
$connection = new AMQPConnection(['host'=> '127.0.0.1', 'port' => '5672', 'login' => '', 'password' => '', 'vhost' => 'ejebberd', 'connect_timeout' => 10]);
$connection->connect();
$channel = new AMQPChannel($connection);
$exchangename = IPhonParameters::$rabbit_EXCHANGE;
$queue = 'ejabberd';
$routing_key = 'ejabberd';
$exchange = new AMQPExchange($channel);
$exchange->setName($exchangename);
$exchange->setType(AMQP_EX_TYPE_DIRECT);
$exchange->setFlags(AMQP_DURABLE);
$exchange->declareExchange();
$q = new AMQPQueue($channel);
$q->setName($queue);
$q->setFlags(AMQP_DURABLE);
$q->declareQueue();
$q->bind($exchangename, $routing_key);
for ($i = 1001; $i < 3001 ; $i++) {
$aaa = sprintf('%04d', $i);
$a_body = [
'server' => 'default'
, 'domain' => 'test.com'
, 'action' => 'add'
, 'login' => 'test'.$aaa
, 'password' => 'test'.$aaa
];
$msg_body = json_encode($a_body, JSON_UNESCAPED_UNICODE);
$exchange->publish($msg_body, $routing_key, AMQP_NOPARAM, ['content_type' => 'text/javascript', 'delivery_mode' => 2]);
}
$connection->disconnect();
?>
101 prov1
102 prov2
# ip rule add from all fwmark 0x1 lookup prov1
# ip rule add from all fwmark 0x2 lookup prov2
# iptables -t mangle -A PREROUTING -i vlan10 -m conntrack --ctstate NEW -j CONNMARK --set-mark 0x1
# iptables -t mangle -A PREROUTING -i vlan20 -m conntrack --ctstate NEW -j CONNMARK --set-mark 0x2
# iptables -t mangle -A PREROUTING -i eth0 -m conntrack --ctstate ESTABLISHED -j CONNMARK --restore-mark
# iptables -t nat -A PREROUTING -i vlan10 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.10:80
# iptables -t nat -A PREROUTING -i vlan20 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.10:80
# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o vlan10 -j SNAT --to-source 176.x.x.x
# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o vlan20 -j SNAT --to-source 212.y.y.y
# iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# iptables -A FORWARD -p tcp -m tcp -d 192.168.1.10 --dport 80 -j ACCEPT
iptables-save
iptables -A INPUT -s BANNED_IP -j LOG
iptables -t nat -A PREROUTING -s BANNED_IP -j LOG
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
start program = "/bin/systemctl start openvpn.service"
stop program = "/bin/systemctl stop openvpn.service"
не? iptables -t nat -A POSTROUTING -p tcp --sport 5689 -d 192.168.55.55 -o eth1 -j SNAT --to-source 192.168.49.56
ip ro add 192.168.55.55/32 via 192.168.49.1 dev eth1