You are on page 1of 9

------------------------BGP------------------------------------

/interface bridge
add admin-mac=02:99:89:94:57:85 auto-mac=no name=lobridge
/interface vlan
add interface=ether2 name=vlan222 vlan-id=222
/routing bgp instance
set default as=65118 redistribute-static=yes router-id=200.118.0.255
/routing ospf instance
set [ find default=yes ] redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=200.118.0.255
/ip address
add address=172.16.0.1/30 interface=vlan222 network=172.16.0.0
add address=200.118.0.255 interface=lobridge network=200.118.0.255
/ip service
set ftp disabled=no
set www disabled=no
set ssh disabled=no
set api disabled=no
set api-ssl disabled=no
/routing bgp network
add network=200.118.0.0/22 synchronize=no
/routing bgp peer
add in-filter=65218-IN multihop=yes name=65218 nexthop-choice=force-self \
out-filter=65218-OUT remote-address=200.118.2.2 remote-as=65218 ttl=\
default update-source=lobridge
add name=Route-server remote-address=10.58.1.254 remote-as=65000 ttl=default \
update-source=ether1
/routing filter
add chain=65218-IN set-in-nexthop=172.16.0.2
add action=discard chain=65218-IN prefix=!177.218.0.0/22 prefix-length=!22-24
add action=accept chain=65218-OUT set-out-nexthop=200.118.2.1
add action=discard chain=65218-OUT
/routing ospf network
add area=backbone network=200.118.0.255/32
add area=backbone network=172.16.0.0/30
/system identity
set name=BGP
/system scheduler
add name=schedule1 policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=mar/27/2019 start-time=20:57:59
/tool romon
set enabled=yes secrets=12345

----------------PE1-------------------------------------------------------------

/interface bridge
add admin-mac=02:58:EE:68:A1:72 auto-mac=no name=lobridge1
/interface vlan
add interface=ether1 name=vlan222 vlan-id=222
/routing ospf instance
set [ find default=yes ] distribute-default=if-installed-as-type-1 \
redistribute-connected=as-type-1 redistribute-static=as-type-1 router-id=\
10.99.99.1
/ip address
add address=172.16.0.2/30 interface=vlan222 network=172.16.0.0
add address=172.16.0.5/30 interface=ether2 network=172.16.0.4
add address=172.16.0.9/30 interface=ether3 network=172.16.0.8
add address=10.99.99.1 interface=lobridge1 network=10.99.99.1
/ip dhcp-client
add disabled=no interface=ether1
add disabled=no interface=vlan222
/ip route
add distance=1 gateway=172.16.0.1
/mpls ldp
set distribute-for-default-route=yes enabled=yes lsr-id=10.99.99.1 \
transport-address=10.99.99.1
/mpls ldp interface
add interface=lobridge1
add interface=ether2
add interface=ether3
/routing ospf network
add area=backbone network=10.99.99.1/32
add area=backbone network=172.16.0.4/30
add area=backbone network=172.16.0.8/30
add area=backbone network=172.16.0.0/30
/system identity
set name=PE1
/tool romon
set enabled=yes secrets=12345

----------------------PE2--------------------------------------------------

ena
configure terminal
no ip domain lookup
hostname PE2-Cisco
mpls ldp router-id Loopback0
mpls ip default-route

interface Loopback0
ip address 10.99.99.2 255.255.255.255
exit

interface Ethernet0/0
no shutdown
mpls ip
mpls label protocol ldp
ip address 172.16.0.6 255.255.255.252
exit

interface Ethernet0/1
no shutdown
mpls ip
mpls label protocol ldp
ip address 172.16.0.13 255.255.255.252
exit

interface Ethernet0/2
no shutdown
ip address 200.118.2.1 255.255.255.252
exit

router ospf 100


router-id 10.99.99.2
redistribute connected subnets
redistribute static subnets
redistribute bgp 65118 subnets
network 10.99.99.2 0.0.0.0 area 0
network 172.16.0.4 0.0.0.3 area 0
network 172.16.0.12 0.0.0.3 area 0
exit

router bgp 65118


bgp log-neighbor-changes
neighbor 200.118.2.2 remote-as 65218
neighbor 200.118.2.2 default-originate

exit

----------------PE3----------------------------------------------

/interface bridge
add admin-mac=02:B8:C2:38:D5:62 auto-mac=no name=Loopback
/ip ipsec proposal
set [ find default=yes ] disabled=yes
/routing ospf instance
set [ find default=yes ] redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=10.99.99.3
/ip settings
set arp-timeout=1m30s
/ip address
add address=10.99.99.3 interface=Loopback network=10.99.99.3
add address=172.16.0.10/30 interface=ether1 network=172.16.0.8
add address=172.16.0.21/30 interface=ether2 network=172.16.0.20
add address=172.16.0.41/30 interface=ether3 network=172.16.0.40
/ip ipsec policy
set 0 disabled=yes
/mpls ldp
set distribute-for-default-route=yes enabled=yes lsr-id=10.99.99.3 \
transport-address=10.99.99.3
/mpls ldp interface
add interface=ether1
add interface=ether2
add interface=ether3
add interface=Loopback
/routing ospf network
add area=backbone network=10.99.99.3/32
add area=backbone network=172.16.0.8/30
add area=backbone network=172.16.0.20/30
add area=backbone network=172.16.0.40/30
/system identity
set name=PE3
/tool romon
set enabled=yes secrets=12345

--------------------------PE4--------------------------------------------------
/interface bridge
add admin-mac=02:D6:25:BC:26:9F auto-mac=no name=lobridge1
/interface vlan
add interface=ether4 name=vlan222 vlan-id=222
/routing bgp instance
set default as=65000 router-id=10.99.99.4
/routing ospf instance
set [ find default=yes ] redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=10.99.99.4
add disabled=yes distribute-default=always-as-type-1 name=ospf1 \
redistribute-bgp=as-type-1 redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=10.99.99.4 routing-table=internet
/ip address
add address=172.16.0.22/30 interface=ether1 network=172.16.0.20
add address=172.16.0.14/30 interface=ether2 network=172.16.0.12
add address=172.16.0.29/30 interface=ether3 network=172.16.0.28
add address=172.16.0.33/30 interface=vlan222 network=172.16.0.32
add address=10.99.99.4 interface=lobridge1 network=10.99.99.4
add address=172.16.0.37/30 interface=ether5 network=172.16.0.36
/mpls ldp
set distribute-for-default-route=yes enabled=yes lsr-id=10.99.99.4 \
transport-address=10.99.99.4
/mpls ldp interface
add interface=lobridge1
add interface=ether1
add interface=ether2
add interface=ether5
/routing ospf interface
add interface=vlan222 network-type=broadcast
/routing ospf network
add area=backbone network=10.99.99.4/32
add area=backbone network=172.16.0.12/30
add area=backbone network=172.16.0.20/30
add area=backbone network=172.16.0.28/30
add area=backbone network=172.16.0.32/30
add area=backbone network=172.16.0.36/30
/system identity
set name=PE4
/tool romon
set enabled=yes secrets=12345

-------------------------PE5--------------------------------------------------

/interface bridge
add admin-mac=02:65:BA:E6:E1:EE auto-mac=no name=bridge1
/routing ospf instance
set [ find default=yes ] redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=10.99.99.5
/ip address
add address=172.16.0.42/30 interface=ether1 network=172.16.0.40
add address=172.16.0.38/30 interface=ether2 network=172.16.0.36
add address=10.99.99.5 interface=bridge1 network=10.99.99.5
add address=172.16.0.45/30 interface=ether3 network=172.16.0.44
add address=200.118.3.1/30 interface=ether4 network=200.118.3.0
/mpls ldp
set distribute-for-default-route=yes enabled=yes lsr-id=10.99.99.5 \
transport-address=10.99.99.5
/mpls ldp interface
add interface=ether1
add interface=ether2
add interface=bridge1
/routing ospf network
add area=backbone network=10.99.99.5/32
add area=backbone network=172.16.0.36/30
add area=backbone network=172.16.0.40/30
add area=backbone network=172.16.0.44/30
/system identity
set name=PE5
/tool romon
set enabled=yes secrets=12345

-----------------------CE-DMZ---------------------------------------------------

/routing ospf instance


set [ find default=yes ] redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=172.16.0.30
/ip address
add address=172.16.0.30/30 interface=ether1 network=172.16.0.28
add address=10.0.0.2/30 interface=ether2 network=10.0.0.0
/ip service
set telnet disabled=no
set ftp disabled=no
set www disabled=no
set ssh disabled=no
set api disabled=no
set api-ssl disabled=no
/routing ospf network
add area=backbone network=172.16.0.28/30
/system identity
set name=CE-DMZ
/tool romon
set enabled=yes secrets=12345

---------------------------Server-DNS-------------------------------------------

/ip address
add address=10.0.0.1/30 interface=ether1 network=10.0.0.0
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=8.8.8.8 name=www.google.com
add address=8.8.8.8 name=google.com
/ip route
add distance=1 gateway=10.0.0.2
/system identity
set name=Server-DNS
/tool romon
set enabled=yes secrets=12345

---------------------CE-PPPoE-1-----------------------------------------------

/interface bridge
add admin-mac=22:6B:29:5C:5D:00 auto-mac=no name=loopback1
/interface vlan
add interface=ether1 name=vlan222 vlan-id=222
/ip pool
add name=pool-PPP ranges=100.64.0.0/27
/ppp profile
set *0 dns-server=10.0.0.1,1.1.1.1 local-address=172.16.0.34 remote-address=pool-
PPP
/routing ospf area
add area-id=0.0.0.1 default-cost=1 inject-summary-lsas=no name=area1 type=stub
/routing ospf instance
set [ find default=yes ] redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=172.16.0.34
/interface pppoe-server server
add disabled=no interface=ether2 one-session-per-host=yes service-name=pppoe
/ip address
add address=200.118.0.2 interface=loopback1 network=200.118.0.2
add address=172.16.0.34/30 interface=vlan222 network=172.16.0.32
/ip dns
set servers=10.0.0.1
/ip firewall nat
add action=src-nat chain=srcnat out-interface=vlan222 src-address=\
100.64.0.0/27 to-addresses=200.118.0.2
/ip proxy
set enabled=yes
/ip service
set www-ssl disabled=no
/ip socks
set enabled=yes
/ip upnp
set enabled=yes
/ppp secret
add name=cliente-residencial password=teste service=pppoe
/routing filter
add action=discard chain=ospf-in disabled=yes prefix=!0.0.0.0/0
/routing ospf area range
add area=area1 range=100.64.0.0/27
add area=area1 range=220.100.0.150/32
/routing ospf interface
add network-type=broadcast passive=yes
add interface=vlan222 network-type=broadcast
/routing ospf network
add area=backbone network=172.16.0.32/30
add area=area1 network=220.100.0.150/32
add area=area1 network=100.64.0.0/27
/snmp
set enabled=yes
/system identity
set name=CE-PPPoE1
/tool romon
set enabled=yes secrets=12345

----------------------------------OLT-1----------------------------------------

/interface bridge
add name=bridge1
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
add bridge=bridge1 interface=ether6
/system identity
set name=OLT
/tool romon
set enabled=yes secrets=12345

---------------------------CPE-1-------------------------------------------------

/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1 \
password=teste user=cliente-residencial
/ip pool
add name=dhcp_pool0 ranges=192.168.1.2-192.168.1.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=ether2 name=dhcp1
/ip dhcp-client
add disabled=no interface=ether1
add disabled=no interface=ether2
add disabled=no interface=ether4
/ip dhcp-server network
add address=192.168.1.0/24 gateway=192.168.1.1
/ip dns
set servers=10.0.0.1
/system identity
set name=CPE-1
/tool romon
set enabled=yes secrets=12345

--------------------CE-PPPoE-2----------------------------------------

/interface bridge
add admin-mac=02:32:7F:D5:93:3A auto-mac=no name=bridge1
/ip pool
add name=pool-PPP ranges=100.64.0.32/27
/ppp profile
set *0 local-address=172.16.0.46 remote-address=pool-PPP
/routing ospf area
add area-id=0.0.0.1 default-cost=1 inject-summary-lsas=no name=area1 type=stub
/routing ospf instance
set [ find default=yes ] redistribute-connected=as-type-1 \
redistribute-static=as-type-1 router-id=172.16.0.46
/interface pppoe-server server
add disabled=no interface=ether2 one-session-per-host=yes service-name=pppoe
/ip address
add address=200.118.0.150 interface=bridge1 network=200.118.0.150
add address=172.16.0.46/30 interface=ether1 network=172.16.0.44
/ip dhcp-client
add disabled=no interface=ether1
/ip firewall nat
add action=src-nat chain=srcnat out-interface=ether4 src-address=\
100.64.0.32/27 to-addresses=200.118.0.150
/ip socks
set enabled=yes
/ip upnp
set enabled=yes
/ppp secret
add name=privado password=teste service=pppoe
add local-address=172.16.0.46 name=public password=public remote-address=\
200.118.1.130 service=pppoe
/routing ospf area range
add area=area1 range=200.118.0.150/32
add area=area1 range=100.64.0.32/27
/routing ospf network
add area=backbone network=172.16.0.44/30
add area=area1 network=200.118.0.150/32
add area=area1 network=100.64.0.32/27
/system identity
set name=CE-PPPoE-2
/tool romon
set enabled=yes secrets=12345

---------------------OLT-2-----------------------------------------------------

/interface bridge
add name=bridge1
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
/system identity
set name=OLT2
/tool romon
set enabled=yes secrets=12345

----------------CPE-Privado----------------------------------------------

/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1 \
password=teste user=privado
/ip dns
set servers=10.0.0.1
/system identity
set name=CPE-Privado
/tool romon
set enabled=yes secrets=12345

--------------------CPE-Publico------------------------------------------

/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe password=public
user=public
/ip dhcp-client
add disabled=no interface=ether1
/ip dns
set allow-remote-requests=yes servers=192.168.157.1
/ip proxy
set enabled=yes
/ip service
set www-ssl disabled=no
/ip smb
set enabled=yes
/ip socks
set enabled=yes
/ip upnp
set enabled=yes
/snmp
set enabled=yes
/system identity
set name=CPE-publico
/tool romon
set enabled=yes secrets=12345

-------------------------CE-Empresa---------------------------------------------

/ip address
add address=200.118.3.2/30 interface=ether1 network=200.118.3.0
add address=192.168.3.1/24 interface=ether4 network=192.168.3.0
/ip route
add distance=1 gateway=200.118.3.1
/system identity
set name=Empresa
/tool romon
set enabled=yes secrets=12345

---------------------------AS-cliente ----------------------------------

ena
configure terminal
no ip domain lookup
hostname AS-cliente

interface Loopback0
ip address 177.218.0.1 255.255.255.255
exit

interface Ethernet0/0
no shutdown
ip address 200.118.2.2 255.255.255.252
exit

router bgp 65218


bgp log-neighbor-changes
network 177.218.0.0 mask 255.255.248.0
neighbor 200.118.0.255 remote-as 65118
neighbor 200.118.0.255 ebgp-multihop 255
neighbor 200.118.2.1 remote-as 65118
exit

ip route 177.218.0.0 255.255.248.0 Null0

exit
wr
wr

You might also like