====== Configure an anycast service von solaris ======
%ICON{wip}%%ICON{wip}%%ICON{wip}% WORK IN PROGRESS %ICON{wip}%%ICON{wip}%%ICON{wip}%
===== Create virtual loopback interface =====
ifconfig lo0:1 plump up
ifconfig lo0:1 172.16.0.1 netmask 255.255.255.255
===== Persistent through reboots =====
=hostname.lo0:1=
172.16.0.1 netmask 255.255.255.255 up
===== Configure a DNS =====
groupadd -g 53 dnsadmin
useradd -g dnsadmin -u 53 -d /var/named -s /bin/false dnsadmin
usermod -A solaris.smf.manage.bind dnsadmin
svcprop dns/server
svccfg -s svc:network/dns/server:default setprop options/configuration_file=/etc/named.conf
svccfg -s svc:network/dns/server:default setprop options/ip_interfaces=IPv4
svccfg -s svc:network/dns/server:default setprop start/user=dnsadmin
svccfg -s svc:network/dns/server:default setprop start/group=dnsadmin
svccfg -s svc:network/dns/server:default setprop options/debug_level=3
# svccfg -s svc:network/dns/server:default setprop options/chroot_dir=/var/named
svcadm refresh svc:network/dns/server:default
# cat /etc/named.conf
options { directory "/var/named"; pid-file "/var/named/tmp/named.pid"; empty-zones-enable yes; };
zone "xyz.de" in { type master; file "xyz.de.zone"; };
zone "168.192.in-addr.arpa" in { type master; file "192.168.zone"; };
zone "16.172.in-addr.arpa" in { type master; file "172.16.zone"; };
zone "10.in-addr.arpa" in { type master; file "10.zone"; };
zone "arpa" in { type master; file "arpa.zone"; };
zone "." in { type hint; file "root.zone"; };
> cat /var/named/xyz.de.zone
$TTL 3h
@ IN SOA panama.xyz.de. dnsadmin.xyz.de. (
- ; Serial
3h ; Refresh after 3h
1h ; Retry after 1 hour
1w ; Expire after 1 week
1h ) ; Negative caching TTL of 1 hour
IN NS panama.xyz.de.
IN NS burma.xyz.de.
localhost IN A 127.0.0.1
panama IN A 192.168.111.48
burma IN A 192.168.111.8
fritzbox IN A 192.168.111.1
laos IN A 192.168.111.170
appleserver IN A 192.168.111.200
sparc IN CNAME panama
> cat /var/named/192.168.zone
$TTL 3h
@ IN SOA panama.xyz.de. dnsadmin.xyz.de. (
- ; Serial
3h ; Refresh after 3h
1h ; Retry after 1 hour
1w ; Expire after 1 week
1h ) ; Negative caching TTL of 1 hour
IN NS panama.xyz.de.
IN NS burma.xyz.de.
1.111 IN PTR fritzbox.xyz.de.
8.111 IN PTR burma.xyz.de.
48.111 IN PTR panama.xyz.de.
170.111 IN PTR laos.xyz.de.
200.111 IN PTR appleserver.xyz.de.
svcadm enable dns/server
==== Test the config ====
tail -50 /var/adm/messages
ps -eadlf | grep named
svcs dns/server
nslookup panama.xyz.de
nslookup 192.168.111.48
and a simpel [[sysadmin:dnstestscript|DnsTestScript]]
===== Static routing =====
svcadm enable ipv4-forwarding
Das Netz 172.16.0.0 taucht nicht in der routing table von solaris auf!
root@panama:/root> netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 192.168.111.1 UG 1 358
192.168.111.0 192.168.111.48 U 1 325 hme0
224.0.0.0 192.168.111.48 U 1 0 hme0
127.0.0.1 127.0.0.1 UH 7 50 lo0
obwohl es direkt verbunden ist
root@panama:/root> ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849 mtu 8232 index 1
inet 172.16.0.1 netmask ffff0000
hme0: flags=1100843 mtu 1500 index 2
inet 192.168.111.48 netmask ffffff00 broadcast 192.168.111.255
ether 8:0:20:a2:ba:5f
- have tried it as a small net
root@panama:/etc> ifconfig lo0:1 172.16.0.1/30
root@panama:/etc> ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849 mtu 8232 index 1
inet 172.16.0.1 netmask fffffffc
hme0: flags=1100843 mtu 1500 index 2
inet 192.168.111.48 netmask ffffff00 broadcast 192.168.111.255
ether 8:0:20:a2:ba:5f
and with a static route for a directly connected host !!???!!
route add -net 172.16.0.0/30 172.16.0.1 -interface
---+++alternative
ifconfig lo0:1 172.16.0.1/32
route delete -net 172.16.0.0/30 172.16.0.1 -interface
route add -host 172.16.0.1 172.16.0.1 -interface
root@panama:/etc> netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 192.168.111.1 UG 1 523
172.16.0.1 172.16.0.1 UH 1 0 lo0:1
192.168.111.0 192.168.111.48 U 1 327 hme0
224.0.0.0 192.168.111.48 U 1 0 hme0
127.0.0.1 127.0.0.1 UH 8 133 lo0
otherhost ~ $ ping 172.16.0.1
PING 172.16.0.1 (172.16.0.1): 56 data bytes
92 bytes from fritz.box (192.168.111.1): Redirect Host(New addr: 192.168.111.48)
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst
- 5 00 0054 1218 0 0000 3f 01 8d9e 192.168.111.57 172.16.0.1
- bytes from 172.16.0.1: icmp_seq=0 ttl=255 time=6.169 ms
64 bytes from 172.16.0.1: icmp_seq=1 ttl=255 time=1.567 ms
64 bytes from 172.16.0.1: icmp_seq=2 ttl=255 time=4.655 ms
^C
--- 172.16.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.567/4.130/6.169/1.915 ms
---+++alternative
After a reboot i did not need the extra route, the forwarding seems to recognize the additional virtual host.
===== 172.16.0.1 is reachable form the outside network. =====
If i set a static route on my router or at the host himself i can ping ''172.16.0.1'' from the outside net.
===== Dynamic routing via OSPF =====
Have alook at ''/etc/quagga/[[sysadmin:anycastdnssolaris|README.Solaris]]'' %ICON{more}%
==== Enable routing and disable forwarding ====
%ICON{info}% ipv4 routing is disabled if ''/etc/defaultrouter'' is not empty
echo "" > /etc/defaultrouter
svcadm disable ipv4-forwarding
svcadm enable route:default
==== Disable IPMP ====
Disable IPMP if machine is set up with it. To do this you will have to undo all the things you had done to configure IPMP on your system. Please see:
%ICON{book}% http://docs.sun.com %ICON{go_forward}% Product Categories>> Solaris >> Solaris 10 %ICON{go_forward}% Solaris 10 System Administration Guide:IP services, Chapter 30 %ICON{more}% for configuration details of IPMP.
==== Configure OSPF ====
cd /etc/quagga
cp zebra.conf.sample zebra.conf
cp ospfd.HA.conf.sample ospfd.conf
Example ''/etc/quagga/[[sysadmin:anycastdnszebra|zebra.conf]]'' and ''/etc/quagga/[[sysadmin:anycastdnsospfd|ospfd.conf]]''
==== Start OSPF ====
svcadm enable zebra:quagga
svcadm enable ospf:quagga
==== Configure cisco router ====
Conf t
Router ospf 1
network 192.168.100.9 0.0.0.255 area 0.0.0.23
end
working (together with zebra.conf and ospfd.conf above) example [[sysadmin:anycastdnsswitchconfig|cisco running-config]]
TODOS
passive interface default
no passive interface
interface rtk0
no ip ospf authentication-key
ip ospf hello-interval 2
ip ospf dead-interval 4
Achtung auf beiden seiten!
==== Debugging ====
Connecting to the router
routeadm -m zebra:quagga vty_address="127.0.0.1"
routeadm -m zebra:quagga vty_port="2601"
routeadm -u
/usr/sbin/quaggaadm zebra
routeadm -u seems not enough, so
svcadm disable zebra:quagga
svcadm enable zebra:quagga
svcprop ospf:quagga
routeadm -m ospf:quagga vty_address="127.0.0.1"
routeadm -m ospf:quagga vty_port="2604"
routeadm -u
/usr/sbin/quaggaadm ospfd
Checking log files
tail -30 /var/adm/routing
tail -30 /var/adm/routing.ospf
Sniffing the traffic
snoop -rv ospf
==== Degugging OSPF ====
show ip ospf interface
show ip ospf neighbor
show ip ospf database
show ip ospf route
Monitoring
monit,netcat,curl
====== Links ======
* http://www.netlinxinc.com/netlinx-blog/45-dns/122-anycast-dns-part-4-using-ospf.html
* http://hub.opensolaris.org/bin/view/Project+quagga/
* http://ignore.tv/2011/04/19/anycast-handling-routes/
* http://www.linuxjournal.com/magazine/ipv4-anycast-linux-and-quagga
* https://island.byu.edu/blog/34/basic-cisco-ios-router-configuration