Érdekes problémába ütköztem, mivel csak most ismerkedek a bind -al, lehet benézek valamit. Az alábbi hálózaton a tűzfalra kapcsolódik két
különböző hálózat két külön bridge -en keresztül. A DNS és a LOG egy hálózatban vannak, de a VPN már másikban. A tűzfalon semmi sincs tiltva,
az ip_forward 1-re van állítva és a natolást is belőttem iptablessel. Az a gáz, hogy bár a DNSszerver hálózatából megy a névfeloldás, a
másik hálózatból viszont kifelé nem. Tehát a belső hálózaton minden szervert elérek (nincs felrajzolva az összes), minden nevet felold, de
egy ping index.hu már unknown host -ot eredményez a VPN -ről. A LOGszerveren minden tökéletesen működik. Mi lehet ennek az oka? Ráadásul a
tűzfalról a ping és ssh iszonyat lassú a VPNszerver felé, viszont a LOGszerver felé nem. Rakok ide pár konfigot is.
A hálózat:
NET
|
|
Tűzfal
| |
| |
| xenbr6(10.10.60.1)
| |
| |
| +-----DNS/DHCP(10.10.60.2)
| |
| +-----LOGszerver(10.10.60.4)
|
|
xenbr3(10.10.30.1)
|
|
+-----VPNszerver(10.10.30.2)
VPN:
--------------------------------------
vpn:~# cat /etc/resolv.conf
search tilb.sze.hu
nameserver 10.10.60.2
--------------------------------------
vpn:~# cat /etc/hosts
127.0.0.1 localhost
--------------------------------------
vpn:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.10.30.2
gateway 10.10.30.1
netmask 255.255.255.0
post-up ethtool -K eth0 tx off
--------------------------------------
DNS:
--------------------------------------
dnsdhcp:~# cat /etc/resolv.conf
search tilb.sze.hu
nameserver 127.0.0.1
--------------------------------------
dnsdhcp:~# cat /etc/hosts
127.0.0.1 localhost
--------------------------------------
dnsdhcp:~# cat /etc/bind/named.conf.local
zone "tilb.sze.hu" {
type master;
file "belso.db";
allow-query {
127.0.0.1;
10.10.60.0/24;
10.10.50.0/24;
10.10.40.0/24;
10.10.30.0/24;
10.10.20.0/24;
10.10.10.0/24;
};
also-notify {
10.10.50.2;
};
notify yes;
};
zone "60.10.10.in-addr.arpa" {
type master;
file "belso-rev.db";
allow-query {
127.0.0.1;
10.10.60.0/24;
};
also-notify {
10.10.50.2;
};
notify yes;
};
zone "50.10.10.in-addr.arpa" {
type master;
file "belso-rev.db";
allow-query {
127.0.0.1;
10.10.50.0/24;
};
also-notify {
10.10.50.2;
};
notify yes;
};
zone "40.10.10.in-addr.arpa" {
type master;
file "belso-rev.db";
allow-query {
127.0.0.1;
10.10.40.0/24;
};
also-notify {
10.10.50.2;
};
notify yes;
};
zone "30.10.10.in-addr.arpa" {
type master;
file "belso-rev.db";
allow-query {
127.0.0.1;
10.10.30.0/24;
};
also-notify {
10.10.50.2;
};
notify yes;
};
-----------------------------------------------------------------------
dnsdhcp:~# cat /etc/bind/named.conf.options
acl admin_zona { 10.10.60.0/24; };
options {
directory "/var/cache/bind";
// query-source address * port 53;
//forward only;
//forwarders {
// 10.10.60.1;
//};
check-names master fail;
check-names response warn;
allow-query { localhost; admin_zona; };
allow-recursion { localhost; admin_zona; };
auth-nxdomain no;
listen-on-v6 { none; };
};
-----------------------------------------------------------------------
dnsdhcp:~# cat /var/cache/bind/belso.db
$TTL 86400
@ IN SOA dnsdhcp.tilb.sze.hu. dnsmaster.tilb.sze.hu. (
2008111201 ; Serial
86400 ; Refresh
900 ; Retry
604800 ; Expire
86400 ) ; Negativ cache TTL
@ IN NS dnsdhcp.tilb.sze.hu.
$origin tilb.sze.hu.
honey IN A 10.10.20.2
vpn IN A 10.10.30.2
file IN A 10.10.40.2
mail IN A 10.10.50.2
web IN A 10.10.50.3
dnsdhcp IN A 10.10.60.2
ldap IN A 10.10.60.3
log IN A 10.10.60.4
-----------------------------------------------------------------------
dnsdhcp:~# cat /var/cache/bind/belso-rev.db
$TTL 86400
@ IN SOA dnsdhcp.tilb.sze.hu. root.dnsdhcp.tilb.sze.hu. (
2008111201 ; Serial
86400 ; Refresh
900 ; Retry
604800 ; Expire
86400 ) ; Negativ cache TTL
@ IN NS dnsdhcp.tilb.sze.hu.
$origin 60.10.10.in-addr.arpa.
2 IN PTR dnsdhcp.tilb.sze.hu.
3 IN PTR ldap.tilb.sze.hu.
4 IN PTR log.tilb.sze.hu.
$origin 50.10.10.in-addr.arpa.
2 IN PTR mail.tilb.sze.hu.
3 IN PTR web.tilb.sze.hu.
$origin 40.10.10.in-addr.arpa.
2 IN PTR file.tilb.sze.hu.
$origin 30.10.10.in-addr.arpa.
2 IN PTR vpn.tilb.sze.hu.
$origin 20.10.10.in-addr.arpa.
2 IN PTR honey.tilb.sze.hu.
-----------------------------------------------------------------------
Belépek a LOGszerverre és pingetek egy oldalt amit a dns még nem cachelt el, majd a forglmat monitorozom a xenbr6 -os intefészen a tűzfalon:
dom0:~# tcpdump -i xenbr6 -vvv
tcpdump: listening on xenbr6, link-type EN10MB (Ethernet), capture size 96 bytes
11:00:11.298237 IP (tos 0x0, ttl 64, id 9259, offset 0, flags [DF], proto: UDP (17), length: 53) log.tilb.sze.hu.32768 > dnsdhcp.
tilb.sze.hu.domain: [bad udp cksum 2db3!] 31115+ A? pina.hu. (25)
11:00:11.298715 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 64) dnsdhcp.tilb.sze.hu.55690 > hu1.dns
node.net.domain: [udp sum ok] 3801 [1au] A? pina.hu. ar: . OPT UDPsize=4096 OK (36)
11:00:11.298961 IP (tos 0x0, ttl 64, id 15129, offset 0, flags [DF], proto: UDP (17), length: 69) dom0.local.32769 > dnsdhcp.tilb
.sze.hu.domain: [udp sum ok] 21471+ PTR? 2.60.10.10.in-addr.arpa. (41)
11:00:11.299087 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 136) dnsdhcp.tilb.sze.hu.domain > dom0.
local.32769: 21471* q: PTR? 2.60.10.10.in-addr.arpa. 1/1/0 2.60.10.10.in-addr.arpa. PTR[|domain]
11:00:11.299197 IP (tos 0x0, ttl 64, id 15129, offset 0, flags [DF], proto: UDP (17), length: 69) dom0.local.32769 > dnsdhcp.tilb
.sze.hu.domain: [udp sum ok] 30841+ PTR? 4.60.10.10.in-addr.arpa. (41)
11:00:11.299276 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 132) dnsdhcp.tilb.sze.hu.domain > dom0.
local.32769: 30841* q: PTR? 4.60.10.10.in-addr.arpa. 1/1/0 4.60.10.10.in-addr.arpa. PTR[|domain]
11:00:11.299400 IP (tos 0x0, ttl 64, id 15129, offset 0, flags [DF], proto: UDP (17), length: 72) dom0.local.32769 > dnsdhcp.tilb
.sze.hu.domain: [udp sum ok] 46120+ PTR? 251.229.72.77.in-addr.arpa. (44)
11:00:11.299583 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 83) dnsdhcp.tilb.sze.hu.62131 > a.root-
servers.net.domain: 1126 [1au] PTR? 251.229.72.77.in-addr.arpa. ar: . (55)
11:00:11.338561 IP (tos 0x0, ttl 50, id 0, offset 0, flags [DF], proto: UDP (17), length: 130) hu1.dnsnode.net.domain > dnsdhcp.t
ilb.sze.hu.55690: 3801- q: A? pina.hu. 0/2/2 ns: pina.hu. NS ns2.myhosting.hu., [|domain]
11:00:11.338839 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 64) dnsdhcp.tilb.sze.hu.33900 > mail1.p
dx.hu.domain: [udp sum ok] 21661 [1au] A? pina.hu. ar: . OPT UDPsize=4096 OK (36)
11:00:11.338912 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 73) dnsdhcp.tilb.sze.hu.16696 > ns1.nic
.hu.domain: [udp sum ok] 23509% [1au] A? ns2.myhosting.hu. ar: . OPT UDPsize=4096 OK (45)
11:00:11.341396 IP (tos 0x0, ttl 57, id 0, offset 0, flags [DF], proto: UDP (17), length: 146) mail1.pdx.hu.domain > dnsdhcp.tilb
.sze.hu.33900: 21661*- q: A? pina.hu. 1/2/2 pina.hu. A mail1.pdx.hu ns: pina.hu. NS[|domain]
11:00:11.341556 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 119) dnsdhcp.tilb.sze.hu.domain > log.t
ilb.sze.hu.32768: 31115 q: A? pina.hu. 1/2/0 pina.hu. A mail1.pdx.hu ns: pina.hu. NS[|domain]
11:00:11.341882 IP (tos 0x0, ttl 57, id 0, offset 0, flags [DF], proto: UDP (17), length: 133) ns1.nic.hu.domain > dnsdhcp.tilb.s
ze.hu.16696: 23509- q: A? ns2.myhosting.hu. 0/2/2 ns: myhosting.hu. NS[|domain]
11:00:11.341913 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: ICMP (1), length: 84) log.tilb.sze.hu > mail1.pdx.hu: ICM
P echo request, id 6920, seq 1, length 64
11:00:11.342370 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 73) dnsdhcp.tilb.sze.hu.40905 > ns2.ext
ernet.hu.domain: [udp sum ok] 60381% [1au] A? ns2.myhosting.hu. ar: . OPT UDPsize=4096 OK (45)
11:00:11.342449 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: UDP (17), length: 71) dnsdhcp.tilb.sze.hu.27987 > ns.nic.
hu.domain: [udp sum ok] 45318% [1au] A? ns.externet.hu. ar: . OPT UDPsize=4096 OK (43)
11:00:11.344426 IP (tos 0x0, ttl 57, id 2158, offset 0, flags [none], proto: ICMP (1), length: 84) mail1.pdx.hu > log.tilb.sze.hu
: ICMP echo reply, id 6920, seq 1, length 64
Most belépek a VPNszerverre és ugyanezt megcsinálom, monitorozom a xenbr3 -as interfészt a tűzfalon:
dom0:~# tcpdump -i xenbr3 -vvv
tcpdump: listening on xenbr3, link-type EN10MB (Ethernet), capture size 96 bytes
11:43:05.243607 IP (tos 0x0, ttl 64, id 28757, offset 0, flags [DF], proto: UDP (17), length: 53) 10.10.30.2.1024 > dnsdhcp.tilb.
sze.hu.domain: [udp sum ok] 47452+ A? pina.hu. (25)
11:43:05.249770 arp who-has 10.10.30.2 tell dom0.local
11:43:05.249824 arp reply 10.10.30.2 is-at 00:16:3e:1a:34:a2 (oui Unknown)
11:43:05.249835 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto: UDP (17), length: 53) dnsdhcp.tilb.sze.hu.domain > 10.10.
30.2.1024: [udp sum ok] 47452 Refused- q: A? pina.hu. 0/0/0 (25)
11:43:05.249950 IP (tos 0x0, ttl 64, id 28758, offset 0, flags [DF], proto: UDP (17), length: 53) 10.10.30.2.1024 > dnsdhcp.tilb.
sze.hu.domain: [udp sum ok] 47452+ A? pina.hu. (25)
11:43:05.250138 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto: UDP (17), length: 53) dnsdhcp.tilb.sze.hu.domain > 10.10.
30.2.1024: [udp sum ok] 47452 Refused- q: A? pina.hu. 0/0/0 (25)
11:43:05.250309 IP (tos 0x0, ttl 64, id 28758, offset 0, flags [DF], proto: UDP (17), length: 65) 10.10.30.2.1024 > dnsdhcp.tilb.
sze.hu.domain: [udp sum ok] 51112+ A? pina.hu.tilb.sze.hu. (37)
11:43:05.250561 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto: UDP (17), length: 119) dnsdhcp.tilb.sze.hu.domain > 10.10
.30.2.1024: 51112 NXDomain*- q: A? pina.hu.tilb.sze.hu. 0/1/0 ns: tilb.sze.hu. SOA[|domain]
11:43:05.350036 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 69) dom0.local.mdns > 224.0.0.251.mdns:
[udp sum ok] 0 PTR? 2.30.10.10.in-addr.arpa. (41)
11:43:06.350012 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 69) dom0.local.mdns > 224.0.0.251.mdns:
[udp sum ok] 0 PTR? 2.30.10.10.in-addr.arpa. (41)
11:43:08.360005 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 69) dom0.local.mdns > 224.0.0.251.mdns:
[udp sum ok] 0 PTR? 2.30.10.10.in-addr.arpa. (41)
11:43:10.249921 arp who-has dom0.local tell 10.10.30.2
11:43:10.249939 arp reply dom0.local is-at fe:ff:ff:ff:ff:ff (oui Unknown)
11:43:10.359960 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 69) dom0.local.mdns > 224.0.0.251.mdns:
[udp sum ok] 0 PTR? 1.30.10.10.in-addr.arpa. (41)
11:43:10.360297 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 87) dom0.local.mdns > 224.0.0.251.mdns:
0*- [0q] 1/0/0 1.30.10.10.in-addr.arpa. (Cache flush) PTR[|domain]
11:43:10.869986 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 70) dom0.local.mdns > 224.0.0.251.mdns:
[udp sum ok] 0 PTR? 251.0.0.224.in-addr.arpa. (42)
11:43:11.879974 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 70) dom0.local.mdns > 224.0.0.251.mdns:
[udp sum ok] 0 PTR? 251.0.0.224.in-addr.arpa. (42)
11:43:13.879916 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto: UDP (17), length: 70) dom0.local.mdns > 224.0.0.251.mdns:
[udp sum ok] 0 PTR? 251.0.0.224.in-addr.arpa. (42)
Remélem mindent ideraktam amiből rá lehet jönni a problémára.
- 1674 megtekintés
Hozzászólások
/etc/bind/named.conf.options:
acl admin_zona { 10.10.60.0/24; };
allow-query { localhost; admin_zona; };
allow-recursion { localhost; admin_zona; };
Csak a 10.10.60.0/24-ből van megengedve a kérések kiszolgálása, de a vpn gép a 10.10.30.2. Add hozzá a fenti két allow- bejegyzéshez a 10.10.30.0/24-et is.
- A hozzászóláshoz be kell jelentkezni
Báááázeg!!
Köszi, ezt tényleg elnéztem mégha annyira nem is vágom a bindot. THX. Működik.
Kellene valami pontozórendszer , stra, te vinnéd az első helyet ha a segítségekről lenne szó.
- A hozzászóláshoz be kell jelentkezni