whether I can regard the mx480 as two independent routers?
Yes, these can be considered as two logical routers.
The Routing Protocol Daemon (RPD) typically runs a single instance for all protocols. Each logical-system
creates its own instance of RPD in addition to the default.
See next answer for more details.
but you know they're only one config file(I am editing), whether the r1 and r2 use the same config file? if is, why they're set two instances, use one and use two they are take same function?
Technically speaking, yes, it's one configuration file. However, there are a couple ways to manage it.
You as the main user are currently operate the CLI from the global view, so you see everything. However, you can set the CLI to only use a particular logical-system and therefore expose only the relevant parts with the set cli logical-system
command (operational mode, not configuration mode) and it'll drop you into a logical system specific prompt for easier configuration and operation.
root@HOST1> set cli logical-system LSYS1
Logical system: LSYS1
root@HOST1:LSYS1> show configuration
interfaces {
lo0 {
unit 1 {
family inet {
address 11.11.11.11/32;
}
}
}
}
protocols {
ospf {
area 0.0.0.1 {
interface lo0.1 {
passive;
}
}
}
}
root@HOST1:LSYS1> clear cli logical-system
Cleared default logical system
root@HOST1>
There are some limitations, for example someone who can operate the default logical system has to assign certain items (like interfaces) to the logical systems. Someone who can operate only that particular logical system, can do whatever they wish with the resources they have been assigned.
As one final example, the following configurations will achieve the same result. Again, notice the prompts.
Option 1
root@HOST1# set logical-systems LSYS2 protocols ospf area 2 interface lo0.2 passive
Option 2
root@HOST1> set cli logical-system LSYS2
Logical system: LSYS2
root@HOST1:LSYS2> configure
Entering configuration mode
[edit]
root@HOST1:LSYS2# set protocols ospf area 2 interface lo0.2 passive