2014年8月16日 星期六

RedHat/Fedora/CentOs Linux 中啟動及設定IPv6


RedHat/Fedora/CentOs Linux 中啟動及設定IPv6
在RedHat/Fedora/CentOs Linux 核心>=2.6 以後已經將IPv6編譯入核心,2008年以後出的Linux 版本內建IPv6是開啟的,所以只需少少的設定就能使用 IPv6。
一、啟動 IPv6
檢視IPv6模組是否已經掛進系統,如果預設沒啟動IPv6,則修改 /etc/modprobe.conf ,加入:
alias net-pf-10 ipv6
如果有這兩行,把他移除
alias ipv6 off
alias net-pf-10 off
請重新開機。
二、讓網卡介面中的 IPv6 設定生效
步驟一已經能正常使用IPv6,但如果網卡要設定 IPv6 屬性,則要修改 /etc/sysconfig/network,加入這行:
NETWORKING_IPV6=yes
修改網卡介面,vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPV6ADDR=2001:288:5400:1::12/64
IPV6_DEFAULTGW=2001:288:5400::ff
IPV6INIT=yes
重啟網卡 /etc/init.d/network restart 或 service network restart
三、測試
測試模組是否加入
modprobe -c | grep ipv6
要有這行 alias net-pf-10 ipv6
測試自己
$ ping6 ::1
測試 GW
$ ping6 2001:288:5400:1::ff
測試外部
$ping6 2001:288:5400:2::1
其他
1. 關閉IPv6
修改 /etc/modprobe.conf ,移除 alias net-pf-10 ipv6
加入這兩行
alias ipv6 off
alias net-pf-10 off
重新開機
2. 關閉防火牆
$ service ip6tables stop
3. 設定DNS on IPv6
要加入 IPv6 DNS,可修改 /etc/resolv.conf 最後加入這行,這個 IP 是中縣網的 DNSv6
nameserver      2001:288:5400::1
nameserver      2001:288:5400::2

資料來源:http://note.tc.edu.tw/462.html

IPV6設定

CentOS IP設定

若只有一張網路卡,則網路設定檔位於
  /etc/sysconfig/netwotk-scripts/ifcfg-eth0
通常系統安裝完成預設為DHCP模式,以下為設定檔內容範例:
DEVICE="eth0"//網路卡代號
BOOTPROTO="dhcp"  //若為固定IP則為BOOTPROTO="none"
HWADDR="00:0C:29:73:E4:76"
IPV6INIT="yes"//是否使用ipv6
NM_CONTROLLED="yes" //網管軟體相關
ONBOOT="yes" //安裝完成網路預設為不啟動,ONBOOT="no",用以避免駭客入侵
TYPE="Ethernet"
UUID="b5f711d7-743a-44ae-baae-10dffe1f1d5e"
備註:指令啟用/關閉網路卡
         啟用:ifup 網路卡代號 或
                  ifup 網路卡代號 up
         關閉:ifup 網路卡代號 down

若須設定固定IP,假設條件如下:
            IP:192.168.2.168
            網路遮罩:255.255.255.0
            預設閘道:192.168.2.1
            DNS伺服器:168.95.1.1
                              8.8.8.8
則檔案修改如下:
DEVICE="eth0"
BOOTPROTO="none"
HWADDR="00:0C:29:73:E4:76"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="b5f711d7-743a-44ae-baae-10dffe1f1d5e"
IPADDR=192.168.2.168
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
DNS1=168.95.1.1
DNS2=8.8.8.8
修改存檔後重新啟動網路設定
service network restart
/etc/init.d/network restart



資料來源:http://kirby86a.pixnet.net/blog/post/98811821-centos-6.4%E5%BF%AB%E9%80%9F%E8%A8%AD%E5%AE%9A%E5%9B%BA%E5%AE%9Aip

CentOS DNS安裝設定參考

在CentOS5系統中,IPv6 DNS Server的修正與設定,算是複雜度比較高的項目之一。以下的文件整理,僅針對已建立完成的DNS Server作修正,因為DNS Server本身的複雜度就很高,若參考完本整理文件,也許會抓不著頭緒,敬請參考這幾年的研習講義,再來看這篇整理文件,也許就會瞭解比較多一點!
注意:這個文件僅僅是修正的整理筆記,您將無法獲得完整的操作資訊!
照例,我還是喜歡用快速檢測法來看看,我們家的DNS Server到底有沒有開啟IPv6的功能。
netstat -an | grep :53
tcp        0      0 163.32.225.1:53         0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
udp        0      0 163.32.225.1:53         0.0.0.0:*
udp        0      0 127.0.0.1:53            0.0.0.0:*
看到這四行連線的狀態,就知道果然是還沒有開啟IPv6的功能。
首先,我們要先確認一下,目前bind的版本是否支援IPv6功能,若不支援,就要昇級版本了!
#  rpm  -qa  |  grep   bind
ypbind-1.19-12.el5
bind-libs-9.3.6-4.P1.el5_4.2
bind-9.3.6-4.P1.el5_4.2
bind-utils-9.3.6-4.P1.el5_4.2
bind-chroot-9.3.6-4.P1.el5_4.2
版本號碼是 9.3.6,還好是支援IPv6的。
(補充說明:bind是在4.9.5 及 8.1 版以後,就支援IPv6的AAAA記錄;9版以後,更支援一些進階的設定方式。)
在修改設定檔之前,要先將這台主機設定成IPv4/IPv6的的網路環境,並使用固定IPv6位址,完成後,再來修定named的設定檔。
第二個重點,要先蒐集並確認下列幾項IP資料:
DNS IPv6 IP ==>2001:288:82xx:1::1/64
校內網段==> 2001:288:82xx:1::/64 , 2001:288:82xx:5::/64 , 2001:288:82xx:6::/64
上層DNS IP ==> 163.28.136.14 , 2001:288:8201:1::14 , 163.28.136.2 , 2001:288:8201:1::2 , 163.28.136.10 , 2001:288:8201:1::10
接下來我們就依照設定檔的順序,一一地來修改DNS的設定檔,讓DNS Server可以支援IPv6功能。
1.named.conf的修定:設定檔在 /var/named/chroot/etc/named.conf
1-1.ACL描述部份:
1-1-1.acl secondaries 描述中,新增三筆上層DNS主機的IPv6位址。
acl secondaries {
localhost;
163.28.136.14/32;
163.28.136.10/32;
163.28.136.2/32;

2001:288:8201:1::14/128;
2001:288:8201:1::2/128;
2001:288:8201:1::10/128;

};
1-1-2.trusted 描述中,新增校內所有IPv6網段。
acl trusted {
localnets;
163.32.225.0/24;
192.168.100.0/24;
192.168.101.0/24;

2001:288:82xx:1::/64;
2001:288:82xx:5::/64;
2001:288:82xx:6::/64;

};
1-2.option描述中,新增IPv6的功能:在 allow-transfer 描述之前,新增下列兩行,以同時開啟IPv4/IPv6 DNS功能。
listen-on {any; };
listen-on-v6 {any; };
2.新增IPv6反解表(zone)設定:為求完整的IPv6正反解環境,必須在設定檔裡新增學校IPv6網段的反解表設定。
這個設定檔的位置,因各校設定方式而異;在named.conf中有設定view描述的,可能會用include方式引入類似named.zone.xx的zone設定檔,或沒設view描述的,就直接放在named.conf檔中。)
(檔案位置:/var/named/chroot/etc/named.conf 或 /var/named/chroot/etc/named.zone.xx)
zone “[domain].kh.edu.tw"{
type master;
file “master/named.[domain].in";
};
zone “???.32.163.in-addr.arpa"{
type master;
file “master/named.???.arpa.in";
};
zone “???.168.192.in-addr.arpa"{
type master;
file “master/named.nat???.arpa";
};
zone “???.168.192.in-addr.arpa"{
type master;
file “master/named.nat???.arpa";
};

zone “x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa" {
type master;
file “master/named.xxxxip6.arpa";
};
3.在原有正解表中,加入IPv6的AAAA紀錄。
(檔案位置:/var/named/chroot/var/named/master/named.[domain].xx)
$TTL          86400
@        IN    SOA    [domain].kh.edu.tw.    root. [domain].kh.edu.tw. (
2001101201 ; serial
1H ; refresh
15 ; retry
14D ; expire
12H ; Minimum
)
@        IN    MX    5    mail.[domain].kh.edu.tw.
@        IN    NS    [domain].kh.edu.tw.
@        IN    NS    dns.[domain].kh.edu.tw.
@        IN    A    163.32.???.1
@        IN    AAAA   2001:288:82xx:1::1
dns        IN    CNAME    [domain].kh.edu.tw.
dns.ipv6    IN    AAAA    2001:288:82xx:1::1
proxy        IN    A    192.168.???.2
mail        IN    A    163.32.???.3
IN    AAAA  2001:288:82xx:1::4
IN    MX    0    mail.[domain].kh.edu.tw.
www        IN    A    163.32.???.4
IN    AAAA    2001:288:82xx:1::6
www.ipv6   IN    AAAA    2001:288:82xx:1::6

ftp        IN    CNAME    www
vlmcs._tcp     IN      SRV     0 0 1688        ap24.kh.edu.tw.
4.新增一個IPv6反解表檔案:
(檔案位置:/var/named/chroot/var/named/master/named.xxxxip6.arpa)
; IPv6 reverse lookup zone for 2001:288:82xx::/48
@               IN      SOA     dns.[domain].kh.edu.tw.     root.dns.[domain].kh.edu.tw. (
2010042101 ; serial
28800 ; refresh
7200 ; retry
129600 ; expire
86400 ; default_ttl
)
@               IN      NS      dns.[domain].kh.edu.tw.
; for 2001:288:82xx::/48
$ORIGIN x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0         IN      PTR     [domain].kh.edu.tw.
; for 2001:288:82xx:1::/64
$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
1.0.0.0         IN      PTR     dns.[domain].kh.edu.tw.
4.0.0.0         IN      PTR     mail.[domain].kh.edu.tw.
; for 2001:288:82xx:5::/64
$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.5.0.0.0.x.x.2.8.8.8.2.0.1.0.0.2.ip6.arpa.
6.0.0.0         IN      PTR     blog.[domain].kh.edu.tw.
7.0.0.0         IN      PTR     student.[domain].kh.edu.tw.
1.5.0.0         IN      PTR     sql.[domain].kh.edu.tw.
5.重新下載named.cache檔案:下載DNS 13個Root的主機紀錄檔,以更新原有IPv4/IPv6正反解主機狀態。
#  cd   /var/named/chroot/var/named/master/
#  wget ftp://ftp.rs.internic.net/domain/named.cache
#  cp  -f  named.cache   root.cache
6.重新啟動DNS Service:
#  service   named   restart
7.記得檢查IPv6的防火牆設定,tcp/udp 53 port若沒有開,請重新設定防火牆,並重新啟動。
service  ip6tables  status
表格: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    RH-Firewall-1-INPUT  all      ::/0                 ::/0
Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    RH-Firewall-1-INPUT  all      ::/0                 ::/0
Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
Chain RH-Firewall-1-INPUT (2 references)
num  target     prot opt source               destination
1    ACCEPT     all      ::/0                 ::/0
2    ACCEPT     icmpv6    ::/0                 ::/0
3    ACCEPT     esp      ::/0                 ::/0
4    ACCEPT     ah       ::/0                 ::/0
5    ACCEPT     udp      ::/0                 ff02::fb/128       udp dpt:5353
6    ACCEPT     udp      ::/0                 ::/0               udp dpt:631
7    ACCEPT     tcp      ::/0                 ::/0               tcp dpt:631
8    ACCEPT     udp      ::/0                 ::/0               udp dpts:32768:61000
9    ACCEPT     tcp      ::/0                 ::/0               tcp dpts:32768:61000 flags:!0×16/0×02

10   ACCEPT     tcp      ::/0                 ::/0               tcp dpt:53
11   ACCEPT     udp      ::/0                 ::/0               udp dpt:53

12   ACCEPT     tcp      ::/0                 ::/0               tcp dpt:22
13   REJECT     all      ::/0                 ::/0               reject-with icmp6-adm-prohibited
8.再用快速檢查法,查看一下DNS Service是否開啟IPv6功能:
#  netstat   -an | grep   :53
tcp        0      0 163.32.225.1:53         0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN

tcp        0      0 :::53                   :::*                    LISTEN
udp        0      0 163.32.225.1:53         0.0.0.0:*
udp        0      0 127.0.0.1:53            0.0.0.0:*

udp        0      0 :::53                   :::*
當您看到有 :::53 的狀態,就表示您的DNS Service已經支援IPv6功能了!


資料來源:http://blog.hmes.kh.edu.tw/wordpress/jang/2010/04/22/ipv6-dns-server%E4%BF%AE%E6%AD%A3%E8%88%87%E8%A8%AD%E5%AE%9A/

DNS反解設定


台中市IPv6 DNS反解設定--Bind9
台中市的IPv6 反解已於4/1全部設定完畢,學校端只要依照下面的範例設定即可設定IPv6的反解,接下來以豐南國中作為設定的範例:
豐南國中設定參數:
  name server(NS): dns.fnjh.tc.edu.tw.
  manager email: admin.dns.fnjh.tc.edu.tw.
  IPv6 網段: 2001:288:542F::/48
  反解區域: F.2.4.5.8.8.2.0.1.0.0.2.ip6.arpa
修改 named.conf,加入設定檔的位置:
zone "F.2.4.5.8.8.2.0.1.0.0.2.ip6.arpa" {
       type master;
       file "../master/2001.288.542F.rev";
};
上面的檔案路徑請依貴伺服器狀態設定,反解檔設定名稱為 2001.288.542F.rev
2001.288.542F.rev 內容為:
$ttl 38400
@   IN  
SOA dns.fnjh.tc.edu.tw. admin.dns.fnjh.tc.edu.tw. (
        1165291452
        10800
        3600
        604800
        38400 )
@   IN  
NS  dns.fnjh.tc.edu.tw.
; 2001:288:542F:0:0:0:0:X
$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.F.2.4.5.8.8.2.0.1.0.0.2.ip6.arpa.
1.0.0.0     IN  PTR dns.fnjh.tc.edu.tw.
; 以下學校依自己狀況設定
2.0.0.0     IN  PTR www.fnjh.tc.edu.tw.
0.1.0.0     IN  
PTR rest.fnkj.tc.edu.tw.
重啟 named 並測試:
# dig -x 2001:288:542F::1

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -x 2001:288:542F::1
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30073
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.f.2.4.5.8.8.2.0.1.0.0.2.ip6.arpa. IN PTR


;; ANSWER SECTION:
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.f.2.4.5.8.8.2.0.1.0.0.2.ip6.arpa. 38400 IN PTR
 dns.fnjh.tc.edu.tw.

;; AUTHORITY SECTION:
f.2.4.5.8.8.2.0.1.0.0.2.ip6.arpa. 38400 IN NS   dns.fnjh.tc.edu.tw.

;; ADDITIONAL SECTION:
dns.fnjh.tc.edu.tw.     15918   IN      A       163.17.43.1

;; Query time: 3 msec
;; SERVER: 163.17.40.3#53(163.17.40.3)
;; WHEN: Mon Apr  9 10:28:09 2012
;; MSG SIZE  rcvd: 152

如果看到 ANSWER 有顯示正確的內容,代表設定正確了!


資料來源:http://note.tc.edu.tw/755.html

CentOS6 DNS 安裝

[A] Primary(Master) DNS Server Details:

Operating System     : CentOS 6.5 32 bit (Minimal Server)
Hostname             : masterdns.ostechnix.com
IP Address           : 192.168.1.200/24

[B] Secondary(Slave) DNS Server Details:

Operating System     : CentOS 6.5 32 bit (Minimal Server)
Hostname             : slavedns.ostechnix.com
IP Address           : 192.168.1.201/24  

Setup Primary(Master) DNS Server

[root@masterdns ~]# yum install bind* -y

1. Configure DNS Server

The main configuration of the DNS will look like below. Edit and add the entries below which were marked as bold in this configuration files.
[root@masterdns ~]# vi /etc/named.conf 
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.1.200;};                      ## Master DNS IP ##
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query     { localhost; 192.168.1.0/24; };                      ## IP Range ##
allow-transfer{ localhost; 192.168.1.201; };                        ## Slave DNS IP ##  
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
zone "." IN {
type hint;
file "named.ca";
};
zone"ostechnix.com" IN {
type master;
file "fwd.ostechnix.com";
allow-update { none; };
};
zone"1.168.192.in-addr.arpa" IN {
type master;
file "rev.ostechnix.com";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

2. Create Zone files

Now we should create forward and reverse zone files which we mentioned in the‘/etc/named.conf file.

[A] Create Forward Zone

Create fwd.ostechnix.com file in the ‘/var/named’ directory and add the entries for forward zone as shown below.
[root@masterdns ~]# vi /var/named/fwd.ostechnix.com 
$TTL 86400
@   IN  SOA     masterdns.ostechnix.com. root.ostechnix.com. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
@IN  NS      masterdns.ostechnix.com.
@IN  NS     slavedns.ostechnix.com.masterdns     IN  A    192.168.1.200
slavedns     IN  A   192.168.1.201

[B] Create Reverse Zone

Create rev.ostechnix.com file in the ‘/var/named’ directory and add the entries for reverse zone as shown below.
[root@masterdns ~]# vi /var/named/rev.ostechnix.com 
$TTL 86400
@   IN  SOA     masterdns.ostechnix.com. root.ostechnix.com. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
@IN  NS      masterdns.ostechnix.com.
@IN  NS      slavedns.ostechnix.com.
masterdnsIN  A   192.168.1.200
slavedns IN  A   192.168.1.201
200       IN  PTR     masterdns.ostechnix.com.
201      IN  PTR    slavedns.ostechnix.com.

3. Start the bind service

[root@masterdns ~]# service named start
Generating /etc/rndc.key:                                  [  OK  ]
Starting named:                                            [  OK  ]
[root@masterdns ~]# chkconfig named on

4. Allow DNS Server through iptables

Add the lines shown in bold letters in ‘/etc/sysconfig/iptables’ file. This will allow all clients to access the DNS server.
[root@masterdns ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

5. Restart iptables to save the changes

[root@masterdns ~]# service iptables restart
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]

6. Test syntax errors of DNS configuration and zone files

[A] Check DNS Config file

[root@masterdns ~]# named-checkconf /etc/named.conf 
[root@masterdns ~]# named-checkconf /etc/named.rfc1912.zones

[B] Check zone files

[root@masterdns ~]# named-checkzone ostechnix.com /var/named/fwd.ostechnix.com 
zone ostechnix.com/IN: loaded serial 2011071001
OK
[root@masterdns ~]# named-checkzone ostechnix.com /var/named/rev.ostechnix.com 
zone ostechnix.com/IN: loaded serial 2011071001
OK
[root@masterdns ~]#

7. Test DNS Server

Method A:

[root@masterdns ~]# dig masterdns.ostechnix.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> masterdns.ostechnix.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11496
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;masterdns.ostechnix.com.INA
;; ANSWER SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
;; AUTHORITY SECTION:
ostechnix.com.86400INNSmasterdns.ostechnix.com.
ostechnix.com.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 5 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar  3 12:48:35 2013
;; MSG SIZE  rcvd: 110

Method B:

[root@masterdns ~]# dig -x 192.168.1.200
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> -x 192.168.1.200
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40891
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;200.1.168.192.in-addr.arpa.INPTR
;; ANSWER SECTION:
200.1.168.192.in-addr.arpa. 86400 INPTRmasterdns.ostechnix.com.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa.86400INNSmasterdns.ostechnix.com.
1.168.192.in-addr.arpa.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 6 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar  3 12:49:53 2013
;; MSG SIZE  rcvd: 150

Method C:

[root@masterdns ~]# nslookup masterdns
Server:192.168.1.200
Address:192.168.1.200#53
Name:masterdns.ostechnix.com
Address: 192.168.1.200
Thats it. Now the Primary DNS server is ready

Setup Secondary(Slave) DNS Server

[root@slavedns ~]# yum install bind* -y

1. Configure Slave DNS Server

Open the main configuration file ‘/etc/named.conf and add the lines as shown in bold letters.
[root@slavedns ~]# vi /etc/named.conf 
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.1.201; };                    ## Slve DNS IP ##      
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query     { localhost; 192.168.1.0/24; };                     ## IP Range ##   
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
zone "." IN {
type hint;
file "named.ca";
};
zone"ostechnix.com" IN {
type slave;
file "slaves/ostechnix.fwd";
masters { 192.168.1.200; };
};
zone"1.168.192.in-addr.arpa" IN {
type slave;
file "slaves/ostechnix.rev";
masters { 192.168.1.200; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

2. Start the DNS Service

[root@slavedns ~]# service named start
Generating /etc/rndc.key:                                  [  OK  ]
Starting named:                                            [  OK  ]
[root@slavedns ~]# chkconfig named on
Now the forward and reverse zones are automatically replicated from Master DNS server to Slave DNS server.
To verify, goto DNS database location(i.e ‘/var/named/slaves’) and use command ‘ls’.
[root@slavedns ~]# cd /var/named/slaves/
[root@slavedns slaves]# ls
ostechnix.fwd  ostechnix.rev
The forward and reverse zones are automatically replicated from Master DNS. Now check the zone files whether the correct zone files are replicated or not.

[A] Check Forward zone:

[root@slavedns slaves]# cat ostechnix.fwd 
$ORIGIN .
$TTL 86400; 1 day
ostechnix.comIN SOAmasterdns.ostechnix.com. root.ostechnix.com. (
2011071001 ; serial
3600       ; refresh (1 hour)
1800       ; retry (30 minutes)
604800     ; expire (1 week)
86400      ; minimum (1 day)
)
NSmasterdns.ostechnix.com.
NSslavedns.ostechnix.com.
$ORIGIN ostechnix.com.
masterdnsA192.168.1.200
slavedns A192.168.1.201

[B] Check Reverse zone:

[root@slavedns slaves]# cat ostechnix.rev 
$ORIGIN .
$TTL 86400; 1 day
1.168.192.in-addr.arpaIN SOAmasterdns.ostechnix.com. root.ostechnix.com. (
2011071001 ; serial
3600       ; refresh (1 hour)
1800       ; retry (30 minutes)
604800     ; expire (1 week)
86400      ; minimum (1 day)
)
NSmasterdns.ostechnix.com.
NSslavedns.ostechnix.com.
$ORIGIN 1.168.192.in-addr.arpa.
200PTRmasterdns.ostechnix.com.
201PTRslavedns.ostechnix.com.
masterdnsA192.168.1.200
slavedns A192.168.1.201

3. Add the DNS Server details to all systems

[root@slavedns ~]# vi /etc/resolv.conf 
# Generated by NetworkManager
search ostechnix.com
nameserver 192.168.1.200
nameserver 192.168.1.201
nameserver 8.8.8.8

4. Test DNS Server

Method A:

[root@slavedns ~]# dig slavedns.ostechnix.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> slavedns.ostechnix.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39096
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;slavedns.ostechnix.com.INA
;; ANSWER SECTION:
slavedns.ostechnix.com.86400INA192.168.1.201
;; AUTHORITY SECTION:
ostechnix.com.86400INNSmasterdns.ostechnix.com.
ostechnix.com.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
;; Query time: 7 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar  3 13:00:17 2013
;; MSG SIZE  rcvd: 110

Method B:

[root@slavedns ~]# dig masterdns.ostechnix.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> masterdns.ostechnix.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12825
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
;; QUESTION SECTION:
;masterdns.ostechnix.com.INA
;; ANSWER SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
;; AUTHORITY SECTION:
ostechnix.com.86400INNSmasterdns.ostechnix.com.
ostechnix.com.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 13 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar  3 13:01:02 2013
;; MSG SIZE  rcvd: 110

Method C:

[root@slavedns ~]# nslookup slavedns
Server:192.168.1.200
Address:192.168.1.200#53
Name:slavedns.ostechnix.com
Address: 192.168.1.201

Method D:

[root@slavedns ~]# nslookup masterdns
Server:192.168.1.200
Address:192.168.1.200#53
Name:masterdns.ostechnix.com
Address: 192.168.1.200

Method E:

[root@slavedns ~]# dig -x 192.168.1.201
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> -x 192.168.1.201
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56991
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;201.1.168.192.in-addr.arpa.INPTR
;; ANSWER SECTION:
201.1.168.192.in-addr.arpa. 86400 INPTRslavedns.ostechnix.com.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa.86400INNSmasterdns.ostechnix.com.
1.168.192.in-addr.arpa.86400INNSslavedns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 6 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar  3 13:03:39 2013
;; MSG SIZE  rcvd: 150

Method F:

[root@slavedns ~]# dig -x 192.168.1.200
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6 <<>> -x 192.168.1.200
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42968
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;200.1.168.192.in-addr.arpa.INPTR
;; ANSWER SECTION:
200.1.168.192.in-addr.arpa. 86400 INPTRmasterdns.ostechnix.com.
;; AUTHORITY SECTION:
1.168.192.in-addr.arpa.86400INNSslavedns.ostechnix.com.
1.168.192.in-addr.arpa.86400INNSmasterdns.ostechnix.com.
;; ADDITIONAL SECTION:
masterdns.ostechnix.com. 86400INA192.168.1.200
slavedns.ostechnix.com.86400INA192.168.1.201
;; Query time: 4 msec
;; SERVER: 192.168.1.200#53(192.168.1.200)
;; WHEN: Sun Mar  3 13:04:15 2013
;; MSG SIZE  rcvd: 150
資料來源:http://ostechnix.wordpress.com/2013/12/15/setup-dns-server-step-by-step-in-centos-6-3-rhel-6-3-scientific-linux-6-3-3/

2014年6月20日 星期五

WIN7 IE9 Adobe flash player 14 安裝時ActiveX無法註冊解決方法

在命令中輸入regedit叫出註冊碼
1.找到HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayer\SafeVersions
將底下的子雞碼全刪除
2.移除舊版Adobe flash player
3.重開機
4.下載Adobe flash player : http://rghost.net/56286882
5.安裝install_flash_player


2014年4月21日 星期一

Adobe Flash Player 無法安裝(錯誤:註冊失敗)及Adobe Flash Player 13 在IE無法安裝解決


解決辦法:
1. 在 Microsoft Download Center下載 SubInACL

2. 安裝 SubInACL

3. 下載 reset_fp10.zip

(
目前版本為 Flash10.1.102.64 以後可能會變,如果找不到請至原文網頁最底下找)。

4. 解壓縮裡面的檔案 reset_fp10.cmd
到 C:\Program Files\Windows Resource Kits\Tools\ 目錄下。
(
重要:請確認 subinacl.exe 與 reset_fp10.cmd 在同一目錄之下 C:\Program Files\Windows Resource Kits\Tools\)

5. 執行 reset_fp10.cmd
,會開啟「命令提視字元」視窗,並執行修復工作。

6. 結束時,會看到「請按任意鍵繼續...」之類的提示訊息。

7. 打開 IE,重新安裝 Flash Player 試試看。


如果還是不行
那就再另外找辦法吧,至少我的問題解掉了 XD

資料來源:http://brian6724.pixnet.net/blog/post/28040253-%5b%e5%b0%8f%e6%8a%80%e5%b7%a7%5d-%e8%a7%a3%e6%b1%ba-flash-player-%e7%84%a1%e6%b3%95%e5%9c%a8-ie-%e4%b8%8a%e5%ae%89%e8%a3%9d-%28acti

PS:
Adobe Flash Player 13無法再IE安裝,可以上軟體王下載IE安裝離線版(plugin-17MB),即可解決無上YOUTUBE無法播放Flash的問題。

2014年4月2日 星期三

Java 7因安全性關係無法在IE上執行

解決

Adding a URL to the Exception Site list

  • Go to the Java Control Panel (On Windows, Click Start and then Configure Java)
  • Click on the Security tab
  • Click on the Edit Site List button
  • Click the Add in the Exception Site List window
資料來源:Java

瀏覽器安裝失敗 ie無法開啟新視窗 瀏覽器錯誤 無法執行javascript ie錯誤

瀏覽器安裝失敗 ie無法開啟新視窗 瀏覽器錯誤 無法執行javascript ie錯誤

這各批次檔專門處理瀏覽器安裝引擎失敗、IE不能打開新視窗或連結等各種莫名其妙的問題的解決方法,瀏覽器無法執行JavaScript(瀏覽器 無法使用 java script)

簡單的說有瀏覽器問題,就使用看看,或許可以幫你解決問題
請將虛線以下文字剪下,存成 Fix-IE.bat ,然後執行它,試試看~ (參考)

— 由此虛線以下文字剪下,存成 Fix-IE.bat ——–

@echo on
echo ==================================
echo 安裝引擎失敗、IE不能打開新視窗或連結等各種莫名其妙的問題的解決方法.
echo 本處理程式是安全的,但是往往能解決一下因 DLL 註冊失效造成的問題.
echo ==================================
echo.
echo 執行中,大約需要幾分鐘,完成後自動退出.如果出現提示框,確定就可以了.
regsvr32 setupwbv.dll /s
regsvr32 wininet.dll /s
regsvr32 comcat.dll /s
regsvr32 shdoc401.dll /s
regsvr32 shdoc401.dll /s /i
regsvr32 asctrls.ocx /s
regsvr32 oleaut32.dll /s
regsvr32 shdocvw.dll /s /I
regsvr32 shdocvw.dll /s
regsvr32 browseui.dll /s
regsvr32 browseui.dll /s /I
regsvr32 msrating.dll /s
regsvr32 mlang.dll /s
regsvr32 hlink.dll /s
regsvr32 mshtml.dll /s
regsvr32 mshtmled.dll /s
regsvr32 urlmon.dll /s
regsvr32 plugin.ocx /s
regsvr32 sendmail.dll /s
regsvr32 comctl32.dll /s /i
regsvr32 inetcpl.cpl /i
regsvr32 mshtml.dll /s /i
regsvr32 scrobj.dll /s
regsvr32 mmefxe.ocx /s
regsvr32 proctexe.ocx /s
regsvr32 corpol.dll /s
regsvr32 jscript.dll /s
regsvr32 msxml.dll /s
regsvr32 imgutil.dll /s
regsvr32 thumbvw.dll /s
regsvr32 cryptext.dll /s
regsvr32 rsabase.dll /s
regsvr32 triedit.dll /s
regsvr32 dhtmled.ocx /s
regsvr32 inseng.dll /s
regsvr32 iesetup.dll /s /i
regsvr32 hmmapi.dll /s
regsvr32 cryptdlg.dll /s
regsvr32 actxprxy.dll /s
regsvr32 dispex.dll /s
regsvr32 occache.dll /s
regsvr32 occache.dll /s /i
regsvr32 iepeers.dll /s
regsvr32 wininet.dll /s /i
regsvr32 urlmon.dll /s /i
regsvr32 digest.dll /s /i
regsvr32 cdfview.dll /s
regsvr32 webcheck.dll /s
regsvr32 mobsync.dll /s
regsvr32 pngfilt.dll /s
regsvr32 licmgr10.dll /s
regsvr32 icmfilter.dll /s
regsvr32 hhctrl.ocx /s
regsvr32 inetcfg.dll /s
regsvr32 trialoc.dll /s
regsvr32 tdc.ocx /s
regsvr32 MSR2C.dll /s
regsvr32 msident.dll /s
regsvr32 msieftp.dll /s
regsvr32 xmsconf.ocx /s
regsvr32 ils.dll /s
regsvr32 msoeacct.dll /s
regsvr32 wab32.dll /s
regsvr32 wabimp.dll /s
regsvr32 wabfind.dll /s
regsvr32 oemiglib.dll /s
regsvr32 directdb.dll /s
regsvr32 inetcomm.dll /s
regsvr32 msoe.dll /s
regsvr32 oeimport.dll /s
regsvr32 msdxm.ocx /s
regsvr32 dxmasf.dll /s
regsvr32 laprxy.dll /s
regsvr32 l3codecx.ax /s
regsvr32 acelpdec.ax /s
regsvr32 mpg4ds32.ax /s
regsvr32 voxmsdec.ax /s
regsvr32 danim.dll /s
regsvr32 Daxctle.ocx /s
regsvr32 lmrt.dll /s
regsvr32 datime.dll /s
regsvr32 dxtrans.dll /s
regsvr32 dxtmsft.dll /s
regsvr32 vgx.dll /s
regsvr32 WEBPOST.dll /s
regsvr32 WPWIZdll /s.dll /s
regsvr32 POSTWPP.dll /s
regsvr32 CRSWPP.dll /s
regsvr32 FTPWPP.dll /s
regsvr32 FPWPP.dll /s
regsvr32 FLUPL.ocx /s
regsvr32 wshom.ocx /s
regsvr32 wshext.dll /s
regsvr32 vbscript.dll /s
regsvr32 scrrun.dll /s mstinit.exe /setup
regsvr32 msnsspc.dll /s /SspcCreateSspiReg
regsvr32 msapsspc.dll /s /SspcCreateSspiReg
echo ==================================
echo 執行完成!希望可以解決你的問題哦~不行的話另想辦法囉!.
pause

或直接下載 Fix-IE.bat
http://www.itmaster.tw/fix-ie.bat


資料來源:IT達人

2014年2月11日 星期二

SFS3重新架設



1.

vi /etc/sysconfig/i18n
LANG="zh_TW.UTF-8" 改為 LANG="zh_TW.Big5"

2.
# vi /etc/httpd/conf/httpd.conf

找到  AddDefaultCharset UTF-8 改成 AddDefaultCharset BIG5

3.
修改 # vi /etc/php.ini
;default_charset = "
iso-8859-1" 修改為 default_charset = "big5" ( ; 記得拿掉)

magic_quotes_gpc = Off 修改為 magic_quotes_gpc = On (減少繁體中文字特殊字的問題)

display_errors = Off 修改為 display_errors = On (php有錯時可以出現偵錯訊息以供參考)

;error_reporting = E_ALL & ~E_NOTICE 修改為 error_reporting = E_ALL & ~E_NOTICE (;拿掉)

error_reporting = E_ALL 修改為 ;error_reporting = E_ALL (加上;)

放寬 memory_limit,建議改為memory_limit = 64M以上 (CentOS 5.5 內預設為128M,所以不改也可)

放寬 max_execution_time,建議改為max_execution_time = 300

確認 register_globals = Off ( CentOS 5.5 內預設為Off )

確認short_open_tag = On (CnetOS 6.5 PHP5.3.3.27中預設為Off)

post_max_size = 20M

upload_max_filesize = 4M

4.
因需更新的不多,可以先執行 # yum update

再順便安裝 # yum -y install php mysql mysql-server php-mysql php-gd php-mbstring  php-cli php-common

安裝相關相依套件

# yum -y install http*

# yum -y install php*

# yum -y install msql*

5.
接下準備安裝phpMyAdmin
# wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/2.11.10/phpMyAdmin-2.11.10-all-languages.tar.gz

# tar zxvf phpMyAdmin-2.11.10-all-languages.tar.gz
# mv phpMyAdmin-2.11.10-all-languages phpMyAdmin
(安全性考量,名稱最好不要用phpMyAdmin)
# /phpMyAdmin/libraries/config.default.php 複製(改名)到 /phpMyAdmin/config.inc.php 下
# vi config.inc.php
$cfg['Servers'][$i]['auth_type'] = '
config'; // Authentication method (config, http or cookie based)?
改為
$cfg['Servers'][$i]['auth_type'] =
'http'; // Authentication method (config, http or cookie based)?

phpMyAdmin2.11.11.3無法進入控制網頁的話,換成phpMyAdmin 3.3.10
# cd /var/www/html/phpMyAdmin
# cp config.example.inc.php config.inc.php
# 修改Auth_Type = http
# 修改AllowNoPassword = true(允許無密碼登入,新建立MYSQL尚未建立root的密碼)
登入phpMyAdmin修改完root,新建sfs3的管理者及sfs3的資料庫再把AllowNoPassword 值修改為false
6.


啟動http mysql

#service httpd start

#service mysqld start

修改 mysql root 的密碼 (用phpMyadmin修改即可)
待會兒安裝學務系統,一定會用到!

7.
準備安裝學務系統了,
# wget http://sfscvs.tcc.edu.tw/sfs_stable.tar.gz (
下載最新版的SFS3 )
# tar zxvf sfs_stable.tar.gz (
解開sfs_stable.tar.gz)
# chmod 711 setup.sh
# ./setup.sh

使用瀏灠器執行安裝程式:http://xxx.xx.xx.xx/sfs3/install.php
安裝畫面中,相關的設定則需依各自的需求填入參數.

8.
修改 include/config.php 的權限成唯讀,確保您系統不會被竄改 # chmod 644 include/config.php

9.
設定上傳目錄的alias:在apache 在設定檔 httpd.conf最一行下面,
加入底下資料
# vi /etc/httpd/conf/httpd.conf

Alias /upfiles/ '/var/www/html/sfs3/data/'
< Directory '/var/www/html/sfs3/data/'>
Options None
AllowOverride None
Order allow,deny
Allow from all
< /Directory>

10.
登入剛安裝好的學務系統,首次使用預設的帳號:1001、密碼:demo

  這步驟一定要做,登入後,隨便晃晃便可退出來;看似沒什麼作用,但卻關係到稍後原機學務系統的資料庫倒入後,能否成功的瀏覽接已受原資料的新學務系統!

  之前,曾在此吃了大虧,剛安裝完SFS3,馬上把原機資料庫倒入,以為大功告成,結果連SFS3的首頁都看不到,只好鼻子摸摸,再重裝一次學務系統

11.
首先,清空SFS3資料庫下的所有資料表,

接著倒入原學務系統的資料庫
# mysql sfs3 < xxxxxx.sql -uroot –p

(或是 #mysql –uroot –p sfs3 < xxx.sql)

 

 

 

 

資料來源:http://163.17.90.135/plog/post/2/64

CentOS6.5移植問題小記:
若出現無畫面,就降SQL跟SFS3資料夾移除重開機,再重新還原一次,先不更改SFS3的conjfig.php中的網址位置,先測試登陸是否可以看到教務的連結,再進行更改config.php的網址更改!

 

 

附記:

php的版本更新

 

升級請看以下的指令:

-----------------------------------------------------------------------

#cd /root

#rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm

安裝PHP

#yum --enablerepo=webtatic install php

升級PHP

#yum --enablerepo=webtatic update php

如果不能安裝或升級時,請改用下列指令
#yum --disablerepo=* --enablerepo=webtatic update php

下列指令也是安裝php,但指定不要5.3.x版的

#yum --disablerepo=* --enablerepo=webtatic --exclude=php*5.3* install php

 

 

 

資料來源:http://blog.smps.tp.edu.tw/~kcodavid/index.php?load=read&id=564



遠端ftp備份:
至SFS3官網下載99學年度台中縣講義,複製FTP備份shell,修改ftp部分指令為:

ftp -n "$host" << EOF
user $user $password
cd $replace_dir
bin
put $targetfile1
put $targetfile2
put $sqlfilename.zip
bye
EOF


SFS3自動更新:
SFS3官網下載99學年度台中縣講義,複製自動更新shell進行修改。