OSPF配置

网络拓扑:一台国内服务器A,两台境外服务器B和C

A

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
log syslog all;
debug protocols all;

router id 172.16.0.3

pr

protocol static {
# Bypass addresses here
route 1.0.0.1/32 via "eth0";
}

protocol kernel {
ipv4 {
export all;
}
ipv6 {
export all;
}
}

protocol ospf v2 hkwepc {
ipv4 {
export none;
import where net !~ 172.16.0.0/16;
}
ipv6 {
export none;
import where net !~ fdff:520::/32;
}
area 172.16.4.0 {
interface "hkwepc" {
cost 5;
}
}
}

B - hkwepc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
log syslog all;
debug protocols all;

router id 172.16.4.1;

protocol static {
# blocked addresses here
route 1.0.0.1/32 via "eth0";
route 1.1.1.1/32 via "eth0";
route 8.8.8.8/32 via "eth0";
route 8.8.4.4/32 via "eth0";
}

protocol ospf v2 hkwepc {
ipv4 {
export static;
import none;
}
ipv6 {
export static;
import none;
}
area 172.16.4.0 {
interface "wgcn" {
cost 5;
}
}
}