LINUX 静态路由和动态路由简单应用(zebra)

 

、RPM包安装
# rpm -ivh zebra-0.93a-3.i386.rpm
 Router1:
 1、

 2、zebra路由配置[静态路由、RIPv2、OSPF任选其一即可]
 1> 添加telnet初始密码
 # vi /etc/zebra/zebra.conf
 hostname Router1
 password 123456
 enable password 123456
 # telnet 127.0.0.1 2601
 password:
 localhost>enable
 localhost#conf t
 localhost(config)#hostname Router1
 Router1(config)#password zebra //修改telnet访问密码
 Router1(config)#enable password secret //修改进入特权模式密码
 Router1(config)#service password-encryption //加密配置文件中的密码
 Router1(config)#interface eth0
 Router1(config-if)#ip address 192.168.3.1/24 //修改IP地址,仅为保存配置使用,否则可省略
 Router1(config-if)#no shut
 Router1(config-if)#exit
 Router1(config)#interface eth1
 Router1(config-if)#ip address 192.168.2.1/24
 Router1(config-if)#no shut
 Router1(config-if)#end
 Router1#exit

 3> 静态路由配置
 # telnet 127.0.0.1 2601
 password:
 Router1>enable
 Router1#conf t
 Router1(config)#ip route 192.168.3.0/24 192.168.2.1 

 Router1(config)#end
 Router1#exit
 4> RIP v2配置
 # telnet 127.0.0.1 2602
 password:
 Router1>enable
 Router1#conf t
 Router1(config)#router rip
 Router1(config-router)#version 2
 Router1(config-router)#network 192.168.3.0/24
 Router1(config-router)#network 192.168.2.0/24
 Router1(config-router)#network 192.168.1.0/24
 Router1(config-router)#end
 Router1#exit
5> OSPF配置
 # telnet 127.0.0.1 2604
 password:
 Router1>enable
 Router1#conf t
 Router1(config)#router ospf 
 Router1(config-router)#network 192.168.1.0/24 area 0
 Router1(config-router)#network 192.168.2.0/24 area 0
 Router1(config-router)#network 192.168.3.0/24 area 0
 Router1(config-router)#end
 Router1#exit 3、保存配置信息
 # telnet 127.0.0.1 2601
 password:
 Router1>enable
 Router1#copy run start
Configuration saved to /etc/zebra/zebra.conf
 Router1#exit

你可能感兴趣的:(linux,linux,职场,休闲,动态路由,静态路由,zebra)