Primeiras configurações
Por default o usuário e root e sem senha
Para configurar um senha de acesso
Primeiras configurações
Por default o usuário e root e sem senha
Para configurar um senha de acesso
cli> configure
[edit]
root@#
root# set system root-authentication plain-text-password
New password:
Retype new password:
root@teste# set system host-name ROUTER-SP
[edit]
root@teste# commit
commit complete
encriptar a senha
set system root-authentication encrypted-password encrypted-password
Listando as interfaces
root@ROUTER-SP> show interfaces
Physical interface: cbp0, Enabled, Physical link is Up
Interface index: 132, SNMP ifIndex: 501
Type: Ethernet, Link-level type: Ethernet, MTU: 1514
Device flags : Present Running
Interface flags: SNMP-Traps
Link type : Full-Duplex
Link flags : None
Current address: 00:05:86:71:0e:11, Hardware address: 00:05:86:71:0e:11
Last flapped : Never
Input packets : 0
Output packets: 0
Physical interface: em0, Enabled, Physical link is Up
Interface index: 8, SNMP ifIndex: 17
Type: Ethernet, Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps
Device flags : Present Running
Interface flags: SNMP-Traps
Link type : Full-Duplex
Link flags : None
Current address: 50:00:00:02:00:00, Hardware address: 50:00:00:02:00:00
Last flapped : 2021-08-22 23:53:31 UTC (00:17:28 ago)
Input packets : 0
Output packets: 0
Configurando interfaces
root@ROUTER-SP# set interfaces em0 unit 0 family inet address 192.168.1.1/30
root@ROUTER-SP# show interfaces em0
unit 0 {
family inet {
address 192.168.1.1/30;
}
}
[edit]
root@ROUTER-PR# show interfaces
em0 {
unit 0 {
family inet {
address 192.168.1.2/32;
}
}
}
[edit]
root@ROUTER-PR#
root@ROUTER-PR> show interfaces terse
Interface Admin Link Proto Local Remote
cbp0 up up
demux0 up up
dsc up up
em0 up up
em0.0 up up inet 192.168.1.2 --> 0/0
em1 up up
em2 up up
root@ROUTER-SP> ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0.815 ms
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.976 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=1.083 ms
64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=1.009 ms
^C
--- 192.168.1.2 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.815/0.971/1.083/0.098 ms
CRIANDO USUARIO E HABILITANDO TELNET SSH E FTP
root@ROUTER-PR# edit system login user admin
[edit system login user admin]
root@ROUTER-PR# set ?
Possible completions:
+ apply-groups Groups from which to inherit configuration data
+ apply-groups-except Don't inherit configuration data from these groups
> authentication Authentication method
class Login class
full-name Full name
uid User identifier (uid) (100..64000)
[edit system login user admin]
root@ROUTER-PR# set uid ?
Possible completions:
<uid> User identifier (uid) (100..64000)
[edit system login user admin]
root@ROUTER-PR# set uid 100
[edit system login user admin]
root@ROUTER-PR# set class ?
Possible completions:
<class> Login class
operator permissions [ clear network reset trace view ]
read-only permissions [ view ]
super-user permissions [ all ]
unauthorized permissions [ none ]
[edit system login user admin]
root@ROUTER-PR# set class super-user
[edit system login user admin]
root@ROUTER-PR# show
## Last changed: 2021-08-23 00:32:55 UTC
version 12.1R1.9;
system {
host-name ROUTER-PR;
root-authentication {
encrypted-password encrypted-password; ## SECRET-DATA
}
login {
user admin {
full-name ADMINISTRADOR;
uid 100;
class super-user;
services {
ftp;
ssh;
telnet;
CRIANDO SENHA PARA O ADMIN VIA LOCAL DATABASE
root@ROUTER-PR# set system login user admin authentication ?
Possible completions:
+ apply-groups Groups from which to inherit configuration data
+ apply-groups-except Don't inherit configuration data from these groups
encrypted-password Encrypted password string
load-key-file File (URL) containing one or more ssh keys
plain-text-password Prompt for plain text password (autoencrypted)
> ssh-dsa Secure shell (ssh) DSA public key string
> ssh-rsa Secure shell (ssh) RSA public key string
[edit]
root@ROUTER-PR# ...dmin authentication plain-text-password
New password:
Retype new password:
[edit]
root@ROUTER-PR#
Testando acesso
root@ROUTER-SP> ssh admin@192.168.1.2
admin@192.168.1.2's password:
--- JUNOS 12.1R1.9 built 2012-03-24 12:52:33 UTC
admin@ROUTER-PR> exit
Connection to 192.168.1.2 closed.
root@ROUTER-SP> ssh admin@192.168.1.2
admin@192.168.1.2's password:
CONFIGURANDO BGP P2P
root@ROUTER-SP> show configuration protocols | display set
set protocols bgp group EXTERNOS type external
set protocols bgp group EXTERNOS log-updown
set protocols bgp group EXTERNOS peer-as 2
set protocols bgp group EXTERNOS local-as 1
set protocols bgp group EXTERNOS neighbor 192.168.1.2 peer-as 2
root@ROUTER-PR> show configuration protocols | display set
set protocols bgp group EXTERNOS type external
set protocols bgp group EXTERNOS peer-as 1
set protocols bgp group EXTERNOS local-as 2
set protocols bgp group EXTERNOS neighbor 192.168.1.1 peer-as 1
root@ROUTER-PR> show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0 0 0 0 0 0 0
Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.1.1 1 7 8 0 0 2:31 0/0/0/0 0/0/0/0
root@ROUTER-PR> show bgp neighbor
Peer: 192.168.1.1+179 AS 1 Local: 192.168.1.2+57135 AS 2
Type: External State: Established Flags: <Sync>
Last State: OpenConfirm Last Event: RecvKeepAlive
Last Error: None
Options: <Preference PeerAS LocalAS Refresh>
Holdtime: 90 Preference: 170 Local AS: 2 Local System AS: 2
Number of flaps: 0
Peer ID: 192.168.1.1 Local ID: 192.168.1.2 Active Holdtime: 90
OSPF CONFIGURAÇÃO
Na configuração basica basta setar a interface por onde sera propagado os hellos do ospf
root@ROUTER-PR> show configuration protocols | display set
set protocols ospf area 0.0.0.0 interface em0.0
root@ROUTER-SP> show configuration protocols | display set
set protocols ospf area 0.0.0.0 interface em0.0
root@ROUTER-PR> show ospf neighbor
Address Interface State ID Pri Dead
192.168.1.1 em0.0 Full 192.168.1.1 128 36
root@ROUTER-PR> show ospf database
OSPF database, Area 0.0.0.0
Type ID Adv Rtr Seq Age Opt Cksum Len
Router 192.168.1.1 192.168.1.1 0x80000004 305 0x22 0xee93 36
Router *192.168.1.2 192.168.1.2 0x80000003 304 0x22 0xee91 36
Network 192.168.1.1 192.168.1.1 0x80000001 305 0x22 0xa4e9 32