Доброго вечера.
Мне нужно удалённо через squid подключится к серверу Астериск.
Ни как не получается это сделать.
ниже конфиги.
192.168.0.0/24 - это внутренняя сеть. Астериск: 192.168.0.58
77.73.11.11 - это IP в глобальную сеть у шлюза
192.168.0.2 - Это IP в локальную сеть смотрит шлюз
Это скрипт для моих команд и заворачивания сквида.
Тут я и прописываю команды для Iptables.
Данный скрипт самостоятельно подгружается в систему после каждого её запуска.
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
iptables -t nat -A PREROUTING -d 77.73.11.11 -p udp --dport 5060 -j DNAT --to 192.168.0.58
iptables -t nat -A POSTROUTING -p udp --src 192.168.0.58 --dport 5060 -j SNAT --to-source 77.73.11.11
iptables -t nat -A OUTPUT --dst 77.73.11.11 -p udp --dport 5060 -j DNAT --to-destination 192.168.0.58
/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 77.73.11.11
netmask 255.255.255.192
network 77.73.26.64
broadcast 77.73.26.127
dns-nameservers 77.73.24.2 77.73.25.2
gateway 77.73.26.65
# dns-* options are implemented by the resolvconf package, if installed
auto eth1
iface eth1 inet static
address 192.168.0.2
netmask 255.255.255.0
# dns-nameservers 192.168.0.2
#Recommended minimum configuration:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl our_networks src 192.168.0.0/24 192.168.1.0/24
http_access allow our_networks
http_access allow localhost
http_access deny all
icp_access allow all
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid 100 16 256
access_log /var/log/squid/access.log squid
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
visible_hostname poxy.router
hosts_file /etc/hosts
coredump_dir /var/spool/squid
Ребята помогите пожалуйста. Вообще даже простенький редирект не могу сделать.
И ещё по ходу вопрос, тк ночь, голова "ходит", какой командой Iptables Очищается? Мне это нужно в начало моего скрипта поместить, те что бы только строки скрипта моего выполнялись.
Может я пакетик забыл какой-нибудь. Ткните пальцем.
Спасибо.