IPtables en Squid

Status
Niet open voor verdere reacties.

Davano

Gebruiker
Lid geworden
17 okt 2009
Berichten
10
Hallo iedereen
IK heb een netwerkje gemaakt zo als hier onder beschreven.

Een Linux router/proxy met External interface: 192.168.121.240
Internal interface: 10.0.0.2 en een DMZ interface: 10.1.0.2

Op de DMZ heb ik een linux webserver met het ip: 10.1.0.10 and apache2, php5, mysql and samba geïnstalleerd.

Op de internal interface heb ik het ip: 10.0.0.3(Windows 2003 als premiere dc en DNS) 10.0.0.4(Windows 2003 back-up dc en DNS) 10.0.0.5(Windows 2003 backup server), Een Linux mailserver with the ip: 10.0.0.6 and a windows xp with the ip: 10.0.0.20

Dit netwerk maakt verbinding met een ander netwerk waar een proxy opdraait met het ip: 192.168.1.253

Nu kan ik van mijn client naar www.google.com
Als ik in de zoekbalk op google.com nu.nl in type krijg ik de links niet te zien, maar deze fout melding.

The requested URL could not be retrieved
--------------------------------------------------------------------------------
While trying to retrieve the URL: http://www.google.nl/search?
The following error was encountered:
Unable to determine IP address from host name for www.google.nl
The dnsserver returned:
No Address records
This means that:
The cache was not able to resolve the hostname presented in the URL.
Check if the address is correct.
Your cache administrator is webmaster.


--------------------------------------------------------------------------------
Generated Wed, 13 Jul 2011 03:38:03 GMT by linux-od82.site (squid/2.7.STABLE6)


Ik kan ook niet van af de xp bij de webserver komen in de dmz, of op de mailserver.

In de file /etc/resolv.conf van de proxy heb ik het volgende DNS servers staan:
nameserver 10.0.0.4
nameserver 10.0.0.3

Heb een forwarder op de DNS ingesteld, Moet ik dat ook op de proxy doen ?

nu is mijn vraag zijn mijn iptables or squid.conf wrong or both ?

Hieronder mijn iptables en squid.conf:

Greets Davano

SQUID.CONF
acl all src all
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 10.1.0.0/24 # RFC1918 possible internal network
acl localnet src 10.0.0.0/24 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # 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 all
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 allow all
icp_access allow localnet
icp_access deny all

cache_peer 192.168.1.253 parent 8080 3130 proxy-only no-query
cache_peer 192.168.1.252 parent 8080 3130 proxy-only no-query
cache_peer 192.168.1.251 parent 8080 3130 proxy-only no-query
hierarchy_stoplist cgi-bin ?


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
dns_nameservers 10.0.0.3 10.0.0.4
retry_on_error on

IPTABLES

linux-od82:~ # iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_IN:'
ext-if all -- anywhere anywhere
dmz-if all -- anywhere anywhere
int-if all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_OUT:'
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_IN:'
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
int-dmz all -- 10.0.0.0/24 anywhere
int-ext all -- 10.0.0.0/24 anywhere
dmz-ext all -- 10.1.0.0/24 anywhere
dmz-int all -- 10.1.0.0/24 anywhere
ext-dmz all -- anywhere anywhere
ext-int all -- anywhere anywhere
LOG all -- anywhere anywhere LOG level warning prefix `chain-jump'
DROP all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
LOG all -- anywhere anywhere LOG level debug prefix `BANDWIDTH_OUT:'
ACCEPT all -- anywhere anywhere
Chain dmz-ext (1 references)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere tcp dpt:nicname
ACCEPT tcp -- anywhere anywhere tcp dpt:telnet
ACCEPT tcp -- anywhere anywhere tcp dpt:ntp
icmp-acc icmp -- anywhere anywhere
LOG all -- anywhere anywhere LOG level warning prefix `dmz-ext'
ACCEPT all -- anywhere anywhere
Chain dmz-if (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Chain dmz-int (1 references)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp spt:domain
ACCEPT tcp -- anywhere anywhere tcp spt:domain flags:!FIN,SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere tcp spt:http flags:!FIN,SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere tcp spt:ssh flags:!FIN,SYN,RST,ACK/SYN
icmp-acc icmp -- anywhere anywhere
LOG all -- anywhere anywhere LOG level warning prefix `dmz-int'
DROP all -- anywhere anywhere
Chain ext-dmz (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 10.1.0.10 tcp dpt:http
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
icmp-acc icmp -- anywhere anywhere
LOG all -- anywhere anywhere LOG level warning prefix `ext-dmz'
ACCEPT all -- anywhere anywhere
Chain ext-if (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Chain ext-int (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
Chain icmp-acc (4 references)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp source-quench
ACCEPT icmp -- anywhere anywhere icmp time-exceeded
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT icmp -- anywhere anywhere icmp echo-reply
LOG all -- anywhere anywhere LOG level warning prefix `icmp-acc'
DROP all -- anywhere anywhere
Chain int-dmz (1 references)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:telnet
ACCEPT tcp -- anywhere anywhere tcp dpt:ident
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
icmp-acc icmp -- anywhere anywhere
LOG all -- anywhere anywhere LOG level warning prefix `int-dmz'
DROP all -- anywhere anywhere
Chain int-ext (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
Chain int-if (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
linux-od82:~ #
 
Hallo,

Ten eerst vindt ik het apart waarom je een 10 range gebruikt en een 192 range.
Hoe heb je de routing geregeld?
Zijn de 2 verschillende ranges op 1 router met vlan's geregeld? of apart?
En zou je een kleine tekening kunnen maken hoe je het hebt geregeld? dat is wat overzichtelijker.
 
Het netwerkje wat ik gemaakt heb hangt aan een ander net werk met IP:192.168
vandaar dat ik een 192 en een 10 range heb.

dit is my routing op de router/proxy:
linux-od82:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 10.0.0.2 255.255.255.0 UG 0 0 0 eth2
10.1.0.0 10.1.0.2 255.255.255.0 UG 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.253 0.0.0.0 UG 0 0 0 eth0


Plaatje van netwerk:
http://imageshack.us/photo/my-images/828/tekening1c.jpg/



Groeten Davano
 
Laatst bewerkt:
Vraagje: Over hoeveel PC's gaat het feitelijk ? Ik bedoel, als het zo tussen de 5 á 10 PC's gaat dan kun je via Iptables ook toegang verschaffen naar buiten, dat scheelt weer een service op je servertje ;)
 
Thx voor de repl'y

Het gaat om een klein aantal: 6 servers en een paar clients.
Dus dat moeten kunnen.
Wat zou ik dan moeten aanpassen in mijn iptables ?


Groeten Davano
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan