341的实验手册lab5为例,因为物理接口有限所以只实现了方框中的部分,配置如下:
root> show configuration
## Last commit: 2008-01-31 18:26:55 UTC by root
version 8.5R1.14;
system {
root-authentication {
encrypted-password "$1$6GaVe1N1$.P2ARqZFVR5T8p5DgEKjC2"; ## SECRET-DATA
}
services {
web-management {
http {
port 80;
}
}
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
logical-routers {
HongKong {
interfaces {
fxp1 {
unit 3 {
vlan-id 3;
family inet {
address 10.222.4.1/24;
}
}
}
lo0 {
unit 16 {
family inet {
address 192.168.16.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.16.1;
peer-as 65001;
local-as 65001;
neighbor 192.168.20.1;
}
}
ospf {
area 0.0.0.0 {
interface fxp1.3;
interface lo0.16;
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
London {
interfaces {
fxp1 {
unit 1 {
vlan-id 1;
family inet {
address 172.16.1.3/24;
}
}
}
fxp2 {
unit 2 {
vlan-id 2;
family inet {
address 10.222.2.2/24;
}
}
}
lo0 {
unit 36 {
family inet {
address 192.168.36.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.36.1;
peer-as 65000;
local-as 65000;
neighbor 192.168.24.1;
}
group ext {
type external;
local-as 65000;
neighbor 172.16.1.9 {
peer-as 65420;
}
}
}
ospf {
area 0.0.0.0 {
interface fxp2.2;
interface lo0.36;
interface fxp1.1 {
passive;
}
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
SanJose {
interfaces {
fxp2 {
unit 1 {
vlan-id 1;
family inet {
address 172.16.1.6/24;
}
}
unit 3 {
vlan-id 3;
family inet {
address 10.222.4.2/24;
}
}
}
lo0 {
unit 20 {
family inet {
address 192.168.20.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.20.1;
peer-as 65001;
local-as 65001;
neighbor 192.168.16.1;
}
group ext {
type external;
local-as 65001;
neighbor 172.16.1.9 {
peer-as 65420;
}
}
}
ospf {
area 0.0.0.0 {
interface fxp2.3;
interface lo0.20;
interface fxp2.1 {
passive;
}
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
Sydney {
interfaces {
fxp3 {
unit 1 {
vlan-id 1;
family inet {
address 172.16.1.9/24;
}
}
}
lo0 {
unit 69 {
family inet {
address 192.168.69.1/32;
}
}
}
}
protocols {
bgp {
export direct;
group ext {
type external;
local-as 65420;
neighbor 172.16.1.3 {
peer-as 65000;
}
neighbor 172.16.1.6 {
peer-as 65001;
}
}
}
}
policy-options {
policy-statement direct {
from protocol direct;
then accept;
}
}
}
Tokyo {
interfaces {
fxp1 {
unit 2 {
vlan-id 2;
family inet {
address 10.222.2.1/24;
}
}
}
lo0 {
unit 24 {
family inet {
address 192.168.24.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.24.1;
peer-as 65000;
local-as 65000;
neighbor 192.168.36.1;
}
}
ospf {
area 0.0.0.0 {
interface fxp1.2;
interface lo0.24;
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
}
interfaces {
fxp0 {
unit 0 {
family inet {
address 10.0.0.101/24;
}
}
}
fxp1 {
vlan-tagging;
}
fxp2 {
vlan-tagging;
}
fxp3 {
vlan-tagging;
}
}
root> show configuration
## Last commit: 2008-01-31 18:26:55 UTC by root
version 8.5R1.14;
system {
root-authentication {
encrypted-password "$1$6GaVe1N1$.P2ARqZFVR5T8p5DgEKjC2"; ## SECRET-DATA
}
services {
web-management {
http {
port 80;
}
}
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
logical-routers {
HongKong {
interfaces {
fxp1 {
unit 3 {
vlan-id 3;
family inet {
address 10.222.4.1/24;
}
}
}
lo0 {
unit 16 {
family inet {
address 192.168.16.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.16.1;
peer-as 65001;
local-as 65001;
neighbor 192.168.20.1;
}
}
ospf {
area 0.0.0.0 {
interface fxp1.3;
interface lo0.16;
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
London {
interfaces {
fxp1 {
unit 1 {
vlan-id 1;
family inet {
address 172.16.1.3/24;
}
}
}
fxp2 {
unit 2 {
vlan-id 2;
family inet {
address 10.222.2.2/24;
}
}
}
lo0 {
unit 36 {
family inet {
address 192.168.36.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.36.1;
peer-as 65000;
local-as 65000;
neighbor 192.168.24.1;
}
group ext {
type external;
local-as 65000;
neighbor 172.16.1.9 {
peer-as 65420;
}
}
}
ospf {
area 0.0.0.0 {
interface fxp2.2;
interface lo0.36;
interface fxp1.1 {
passive;
}
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
SanJose {
interfaces {
fxp2 {
unit 1 {
vlan-id 1;
family inet {
address 172.16.1.6/24;
}
}
unit 3 {
vlan-id 3;
family inet {
address 10.222.4.2/24;
}
}
}
lo0 {
unit 20 {
family inet {
address 192.168.20.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.20.1;
peer-as 65001;
local-as 65001;
neighbor 192.168.16.1;
}
group ext {
type external;
local-as 65001;
neighbor 172.16.1.9 {
peer-as 65420;
}
}
}
ospf {
area 0.0.0.0 {
interface fxp2.3;
interface lo0.20;
interface fxp2.1 {
passive;
}
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
Sydney {
interfaces {
fxp3 {
unit 1 {
vlan-id 1;
family inet {
address 172.16.1.9/24;
}
}
}
lo0 {
unit 69 {
family inet {
address 192.168.69.1/32;
}
}
}
}
protocols {
bgp {
export direct;
group ext {
type external;
local-as 65420;
neighbor 172.16.1.3 {
peer-as 65000;
}
neighbor 172.16.1.6 {
peer-as 65001;
}
}
}
}
policy-options {
policy-statement direct {
from protocol direct;
then accept;
}
}
}
Tokyo {
interfaces {
fxp1 {
unit 2 {
vlan-id 2;
family inet {
address 10.222.2.1/24;
}
}
}
lo0 {
unit 24 {
family inet {
address 192.168.24.1/32;
}
}
}
}
protocols {
bgp {
export direct-ospf;
group bgp {
local-address 192.168.24.1;
peer-as 65000;
local-as 65000;
neighbor 192.168.36.1;
}
}
ospf {
area 0.0.0.0 {
interface fxp1.2;
interface lo0.24;
}
}
}
policy-options {
policy-statement direct-ospf {
from protocol [ direct ospf ];
then accept;
}
}
}
}
interfaces {
fxp0 {
unit 0 {
family inet {
address 10.0.0.101/24;
}
}
}
fxp1 {
vlan-tagging;
}
fxp2 {
vlan-tagging;
}
fxp3 {
vlan-tagging;
}
}
附件
-
bgp.jpg
(147.72 KB)
-
2008-1-31 18:43
-
-
-
root> show configuration | display set
set version 8.5R1.14
set system root-authentication encrypted-password "$1$6GaVe1N1$.P2ARqZFVR5T8p5DgEKjC2"
set system services web-management http port 80
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set logical-routers HongKong interfaces fxp1 unit 3 vlan-id 3
set logical-routers HongKong interfaces fxp1 unit 3 family inet address 10.222.4.1/24
set logical-routers HongKong interfaces lo0 unit 16 family inet address 192.168.16.1/32
set logical-routers HongKong protocols bgp export direct-ospf
set logical-routers HongKong protocols bgp group bgp local-address 192.168.16.1
set logical-routers HongKong protocols bgp group bgp peer-as 65001
set logical-routers HongKong protocols bgp group bgp local-as 65001
set logical-routers HongKong protocols bgp group bgp neighbor 192.168.20.1
set logical-routers HongKong protocols ospf area 0.0.0.0 interface fxp1.3
set logical-routers HongKong protocols ospf area 0.0.0.0 interface lo0.16
set logical-routers HongKong policy-options policy-statement direct-ospf from protocol direct
set logical-routers HongKong policy-options policy-statement direct-ospf from protocol ospf
set logical-routers HongKong policy-options policy-statement direct-ospf then accept
set logical-routers London interfaces fxp1 unit 1 vlan-id 1
set logical-routers London interfaces fxp1 unit 1 family inet address 172.16.1.3/24
set logical-routers London interfaces fxp2 unit 2 vlan-id 2
set logical-routers London interfaces fxp2 unit 2 family inet address 10.222.2.2/24
set logical-routers London interfaces lo0 unit 36 family inet address 192.168.36.1/32
set logical-routers London protocols bgp export direct-ospf
set logical-routers London protocols bgp group bgp local-address 192.168.36.1
set logical-routers London protocols bgp group bgp peer-as 65000
set logical-routers London protocols bgp group bgp local-as 65000
set logical-routers London protocols bgp group bgp neighbor 192.168.24.1
set logical-routers London protocols bgp group ext type external
set logical-routers London protocols bgp group ext local-as 65000
set logical-routers London protocols bgp group ext neighbor 172.16.1.9 peer-as 65420
set logical-routers London protocols ospf area 0.0.0.0 interface fxp2.2
set logical-routers London protocols ospf area 0.0.0.0 interface lo0.36
set logical-routers London protocols ospf area 0.0.0.0 interface fxp1.1 passive
set logical-routers London policy-options policy-statement direct-ospf from protocol direct
set logical-routers London policy-options policy-statement direct-ospf from protocol ospf
set logical-routers London policy-options policy-statement direct-ospf then accept
set logical-routers SanJose interfaces fxp2 unit 1 vlan-id 1
set logical-routers SanJose interfaces fxp2 unit 1 family inet address 172.16.1.6/24
set logical-routers SanJose interfaces fxp2 unit 3 vlan-id 3
set logical-routers SanJose interfaces fxp2 unit 3 family inet address 10.222.4.2/24
set logical-routers SanJose interfaces lo0 unit 20 family inet address 192.168.20.1/32
set logical-routers SanJose protocols bgp export direct-ospf
set logical-routers SanJose protocols bgp group bgp local-address 192.168.20.1
set logical-routers SanJose protocols bgp group bgp peer-as 65001
set logical-routers SanJose protocols bgp group bgp local-as 65001
set logical-routers SanJose protocols bgp group bgp neighbor 192.168.16.1
set logical-routers SanJose protocols bgp group ext type external
set logical-routers SanJose protocols bgp group ext local-as 65001
set logical-routers SanJose protocols bgp group ext neighbor 172.16.1.9 peer-as 65420
set logical-routers SanJose protocols ospf area 0.0.0.0 interface fxp2.3
set logical-routers SanJose protocols ospf area 0.0.0.0 interface lo0.20
set logical-routers SanJose protocols ospf area 0.0.0.0 interface fxp2.1 passive
set logical-routers SanJose policy-options policy-statement direct-ospf from protocol direct
set logical-routers SanJose policy-options policy-statement direct-ospf from protocol ospf
set logical-routers SanJose policy-options policy-statement direct-ospf then accept
set logical-routers Sydney interfaces fxp3 unit 1 vlan-id 1
set logical-routers Sydney interfaces fxp3 unit 1 family inet address 172.16.1.9/24
set logical-routers Sydney interfaces lo0 unit 69 family inet address 192.168.69.1/32
set logical-routers Sydney protocols bgp export direct
set logical-routers Sydney protocols bgp group ext type external
set logical-routers Sydney protocols bgp group ext local-as 65420
set logical-routers Sydney protocols bgp group ext neighbor 172.16.1.3 peer-as 65000
set logical-routers Sydney protocols bgp group ext neighbor 172.16.1.6 peer-as 65001
set logical-routers Sydney policy-options policy-statement direct from protocol direct
set logical-routers Sydney policy-options policy-statement direct then accept
set logical-routers Tokyo interfaces fxp1 unit 2 vlan-id 2
set logical-routers Tokyo interfaces fxp1 unit 2 family inet address 10.222.2.1/24
set logical-routers Tokyo interfaces lo0 unit 24 family inet address 192.168.24.1/32
set logical-routers Tokyo protocols bgp export direct-ospf
set logical-routers Tokyo protocols bgp group bgp local-address 192.168.24.1
set logical-routers Tokyo protocols bgp group bgp peer-as 65000
set logical-routers Tokyo protocols bgp group bgp local-as 65000
set logical-routers Tokyo protocols bgp group bgp neighbor 192.168.36.1
set logical-routers Tokyo protocols ospf area 0.0.0.0 interface fxp1.2
set logical-routers Tokyo protocols ospf area 0.0.0.0 interface lo0.24
set logical-routers Tokyo policy-options policy-statement direct-ospf from protocol direct
set logical-routers Tokyo policy-options policy-statement direct-ospf from protocol ospf
set logical-routers Tokyo policy-options policy-statement direct-ospf then accept
set interfaces fxp0 unit 0 family inet address 10.0.0.101/24
set interfaces fxp1 vlan-tagging
set interfaces fxp2 vlan-tagging
set interfaces fxp3 vlan-tagging
转载于:https://blog.51cto.com/shanliren/137663