Linux777 пишет:тогда требуется понять структуру сети, показать iptables -L -n -v
возможно также потребуется кофиг сквида
и опиши, интерфейсы. а то не зная структуры сети, гадать можно довольно долго.
Есть два интерфейса: eth0 смотрит в локалку 172.20.46.2/24 и выходит в интернет через ppp0(динамический ip) с eth1(dhcp от провайдера)
еще gre туннель поднят по сети провайдера. вот ip a:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:24:21:ed:c4:83 brd ff:ff:ff:ff:ff:ff
inet 172.20.46.2/24 brd 172.20.46.255 scope global eth0
inet6 fe80::224:21ff:feed:c483/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:80:48:34:ea:41 brd ff:ff:ff:ff:ff:ff
inet 10.0.64.16/26 brd 10.0.64.63 scope global eth1
inet6 fe80::280:48ff:fe34:ea41/64 scope link
valid_lft forever preferred_lft forever
4: gre0: <NOARP> mtu 1476 qdisc noop state DOWN
link/gre 0.0.0.0 brd 0.0.0.0
5: tun0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1476 qdisc noqueue state UNKNOWN
link/gre 0.0.0.0 peer 10.1.65.200
inet 192.168.168.1 peer 192.168.168.2/32 scope global tun0
214: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 176.110.235.xxx peer 213.108.144.33/32 scope global ppp0
iptables
[root@gw sysconfig]# iptables -L -v -n
Chain INPUT (policy DROP 2538 packets, 175K bytes)
pkts bytes target prot opt in out source destination
7712 1531K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
175K 19M ACCEPT all -- eth0 * 0.0.0.0/0 0.0.0.0/0
694K 825M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
556 22913 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
267 56669 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:!0x17/0x02 state NEW
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
3 144 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:55999
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:1194
0 0 ACCEPT tcp -- eth0 * 172.20.46.0/24 0.0.0.0/0 tcp dpt:3128
0 0 ACCEPT tcp -- ppp0 * !172.20.46.0/24 0.0.0.0/0 tcp spt:80 ctstate RELATED,ESTABLISHED
2 92 ACCEPT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:5222
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:1194
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1194
0 0 ACCEPT tcp -- eth1 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
0 0 ACCEPT all -- tap0 * 0.0.0.0/0 0.0.0.0/0
11 756 ACCEPT all -- tun0 * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp spt:3000
0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:3000
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:55999
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:55999
0 0 ACCEPT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp spt:55999
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp spt:55999
0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp spt:1194
4650 231K TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU
132K 72M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW,RELATED,ESTABLISHED
826 34243 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
0 0 ACCEPT all -- tap0 ppp0 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- eth0 ppp0 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:5190
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:5190
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:5190
Chain OUTPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
7712 1531K ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
311K 379M ACCEPT all -- * eth0 0.0.0.0/0 0.0.0.0/0
739K 86M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state NEW,RELATED,ESTABLISHED
0 0 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:!0x17/0x02 state NEW
0 0 ACCEPT tcp -- * eth0 0.0.0.0/0 172.20.46.0/24 tcp spt:3128 ctstate RELATED,ESTABLISHED
311 12440 ACCEPT tcp -- * ppp0 0.0.0.0/0 !172.20.46.0/24 tcp dpt:80
0 0 ACCEPT tcp -- * ppp0 0.0.0.0/0 0.0.0.0/0 tcp spt:631
0 0 ACCEPT tcp -- * ppp0 0.0.0.0/0 0.0.0.0/0 tcp spt:1194
0 0 ACCEPT all -- * tap0 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- * tun0 0.0.0.0/0 0.0.0.0/0
squid.conf выглядит так:
visible_hostname gw.ngdbnet.local
#acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 172.20.46.0/24
acl localnet src 172.20.45.0/25
#acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl SSL_ports port 443
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 CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
icp_access deny all
http_access deny all
# Squid normally listens to port 3128
http_port 172.20.46.2:3128 intercept
hierarchy_stoplist cgi-bin ?
redirect_program /usr/bin/squidGuard -c /etc/squid/squidguard.conf
coredump_dir /var/spool/squid
cache_dir ufs /var/squid/cache 1024 32 256
maximum_object_size 32 MB
memory_pools on
memory_pools_limit 150 MB
icp_port 3130
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320