pfsense 網頁multi-home備援建置 · pfsense 網頁multi-home備援建置 游子興...
TRANSCRIPT
![Page 2: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/2.jpg)
臺大區網網頁備援建置
臺大連外網路為 Multi-Home 架構
建構TANet與臺大網路互為備援之區網網頁
TANet 斷線時仍可由臺大網路在網頁公告事項
2
台大連外網路
11/16 凌晨區網斷線近 3小時
![Page 3: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/3.jpg)
NAT MODE MULTI-WAN WEB SERVER
3
![Page 4: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/4.jpg)
網頁備援運作架構
4
TANet
pfsense
TANET
163.28.16.45/24
163.28.16.254/24
LAN
10.1.1.1/24
NTU
NTU
140.112.2.208/26
140.112.2.254/26
Public IP Public IP
Private IP
台大區網
Web Server
IP:10.1.1.2
www.ntu.tp1rc.edu.tw
![Page 5: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/5.jpg)
NAT & Multi-WAN
5
TANet
pfsense
163.28.16.45
LAN
10.1.1.1/24
NTU
140.112.2.208
(default)
台大區網
Web Server
IP:10.1.1.2
www.ntu.tp1rc.edu.tw
140.112.2.208
163.2816.45
Rsyslog Server 163.28.16.52 syslog nsupdate
dns2.ntu.tp1rc.edu.tw 163.28.16.46
TANet
X
TANet
nsupdate
主動偵測 From Internet
Cacti/The Dude
www.ntu.tp1rc.edu.tw
![Page 6: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/6.jpg)
Interfaces > NTU
6
![Page 7: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/7.jpg)
Interfaces > TANET
7
![Page 8: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/8.jpg)
System > Routing > Gateways
8
![Page 9: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/9.jpg)
System > Routing > Gateway Groups
9
![Page 10: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/10.jpg)
Firewall > Rules > LAN
LAN to any 全部開放
Gateway= GW_GROUP
10
![Page 11: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/11.jpg)
Firewall > NAT > Port Forward
11
![Page 12: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/12.jpg)
Status > Gateways
12
![Page 13: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/13.jpg)
13
![Page 14: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/14.jpg)
Status > Gateways
14
![Page 15: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/15.jpg)
15
![Page 16: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/16.jpg)
Status > System Logs > System > Gateways
16
![Page 17: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/17.jpg)
Status > System Logs > System > General
17
![Page 18: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/18.jpg)
Status > System Logs > Settings
18
![Page 19: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/19.jpg)
NAT & Multi-WAN
19
TANet
pfsense
163.28.16.45
LAN
10.1.1.1/24
NTU
140.112.2.208
(default)
Web Server
IP:10.1.1.2
www.ntu.tp1rc.edu.tw
NTU IP
140.112.2.208
163.2816.45
Rsyslog Server 163.28.16.52 syslog nsupdate
dns2.ntu.tp1rc.edu.tw 163.28.16.46
TANet
X
TANet
![Page 20: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/20.jpg)
/etc/rsyslog.conf # Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
module(load="omprog")
if ($msg contains "NTUGW is down") then {
action(type="omprog" binary="/usr/bin/nsupdate -v /root/nsupdate_tp1rc.txt")
} else if ($msg contains "NTUGW is available now") then {
action(type="omprog" binary="/usr/bin/nsupdate -v /root/nsupdate_ntu.txt")}
20
![Page 21: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/21.jpg)
21
Packet loss
![Page 22: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/22.jpg)
NAT & Multi-WAN
22
ntu.tp1rc.edu.tw
dns2.ntu.tp1rc.edu.tw 163.28.16.46
NS record NS record
www.ntu.tp1rc.edu.tw
www.ntu.tp1rc.edu.tw
dns.ntu.tp1rc.edu.tw 140.112.2.238
A record A record
NTU IP TANet IP
140.112.2.208
163.2816.45
140.112.2.208
163.2816.45 nsupdate
![Page 23: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/23.jpg)
Zone file for tp1rc.edu.tw
Named record
$ORIGIN tp1rc.edu.tw.
@ IN SOA dns.ntu.edu.tw. madeline.ntu.edu.tw (
…
ntu IN NS dns.ntu.tp1rc.edu.tw.
IN NS dns2.ntu.tp1rc.edu.tw.
dns.ntu IN A 140.112.2.238
dns2.ntu IN A 163.28.16.46
23
![Page 24: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/24.jpg)
Config file for ntu.tp1rc.edu.tw
zone "ntu.tp1rc.edu.tw"{
type master;
file "named.ntu";
allow-update { 163.28.16.0/24; };
};
24
![Page 25: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/25.jpg)
Zone file for ntu.tp1rc.edu.tw
$TTL 120 ; 2 minutes
@ IN SOA dns.ntu.tp1rc.edu.tw. root.mail.ntu.tp1rc.edu.tw.
( 2017102101 ; serial
1D ; refresh 1H ; retry
1W ; expire
3H ) ; minimum
IN NS dns.ntu.tp1rc.edu.tw.
IN NS dns2.ntu.tp1rc.edu.tw.
dns IN A 140.112.2.238
dns2 IN A 163.28.16.46
www IN A 140.112.2.208
25
![Page 26: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/26.jpg)
nsupdate
nsupdate -v /root/nsupdate_tp1rc.txt
nsupdate_tp1rc.txt
server 140.112.2.238
update delete www.ntu.tp1rc.edu.tw A
update add www.ntu.tp1rc.edu.tw 120 A 163.28.16.45
send
server 163.28.16.46
update delete www.ntu.tp1rc.edu.tw A
update add www.ntu.tp1rc.edu.tw 120 A 163.28.16.45
send
26
![Page 27: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/27.jpg)
nsupdate
nsupdate -v /root/nsupdate_ntu.txt
nsupdate_ntu.txt
server 140.112.2.238
update delete www.ntu.tp1rc.edu.tw A
update add www.ntu.tp1rc.edu.tw 120 A 140.112.2.208
send
server 163.28.16.46
update delete www.ntu.tp1rc.edu.tw A
update add www.ntu.tp1rc.edu.tw 120 A 140.112.2.208
send
27
![Page 28: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/28.jpg)
28
![Page 29: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/29.jpg)
index.html
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0; url=http://www.ntu.tp1rc.edu.tw/index.php">
</head>
</html>
29
![Page 30: pfSense 網頁multi-home備援建置 · pfSense 網頁multi-home備援建置 游子興 台大計中網路組 davisyou@ntu.edu.tw 02-33665008 1](https://reader030.vdocuments.mx/reader030/viewer/2022040607/5eb8bfe205b92e7cf84740cf/html5/thumbnails/30.jpg)
簡報完畢 謝謝
30