失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 不同网段通过静态路由实现互通(强烈推荐)

不同网段通过静态路由实现互通(强烈推荐)

时间:2020-06-15 12:28:43

相关推荐

不同网段通过静态路由实现互通(强烈推荐)

实验拓扑图如下:

只贴出PC1到S5700链路的配置代码!

一、华为交换机S5700配置

1.新建VLAN66

<Huawei>system-view Enter system view, return user view with Ctrl+Z.[Huawei]sysname LSW4[LSW4]vlan 66//新建管理VLAN[LSW4-vlan66]quit[LSW4]interface Vlanif 66//配置IP地址[LSW4-Vlanif66]ip address 10.1.14.2 30[LSW4-Vlanif66]quit

2.配置g0/0/1端口

[LSW4]interface GigabitEthernet 0/0/1[LSW4-GigabitEthernet0/0/1]port link-type trunk[LSW4-GigabitEthernet0/0/1]port trunk allow-pass vlan 66[LSW4-GigabitEthernet0/0/1]quit

3.配置一条静态路由

[LSW4]ip route-static 10.1.1.0 255.255.255.0 10.1.14.1

4.保存

<LSW4>save

二、华为交换机S3700配置

1.新建VLAN 66 10

<Huawei>system-view Enter system view, return user view with Ctrl+Z.[Huawei]sysname LSW1[LSW1]vlan 66[LSW1-vlan66]quit[LSW1]interface Vlanif 66[LSW1-Vlanif66]ip address 10.1.14.1 30 //配置IP地址[LSW1-Vlanif66]quit [LSW1]vlan 10[LSW1-vlan10]quit[LSW1]interface Vlanif 10[LSW1-Vlanif10]ip address 10.1.1.254 24 //配置IP地址[LSW1-Vlanif10]quit

2.配置e0/0/1、e0/0/2端口

[LSW1]interface Ethernet 0/0/1[LSW1-Ethernet0/0/1]port link-type trunk[LSW1-Ethernet0/0/1]port trunk allow-pass vlan 66[LSW1-Ethernet0/0/1]quit[LSW1]interface Ethernet 0/0/2[LSW1-Ethernet0/0/1]port link-type access[LSW1-Ethernet0/0/1]port default vlan 10

3.配置IP缺省路由

[LSW1]ip route-static 0.0.0.0 0.0.0.0 10.1.14.2

4.保存

<LSW1>save

三、配置电脑

1.设置电脑PC1的IP为同一网段、子网掩码。默认网关:

IP地址:10.1.1.1

子网掩码:255.255.255.0

默认网关:10.1.1.254

2.ping 10.1.14.2就是交换机S5700 VLAN66的IP,直到ping通。

//=============================================================================

附件1:S3700-LSW1配置文件

#sysname LSW1#vlan batch 10 66#cluster enablentdp enablendp enable#drop illegal-mac alarm#diffserv domain default#drop-profile default#aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password simple adminlocal-user admin service-type http#interface Vlanif1#interface Vlanif10ip address 10.1.1.254 255.255.255.0 #interface Vlanif66ip address 10.1.14.1 255.255.255.252 #interface MEth0/0/1#interface Ethernet0/0/1port link-type trunkport trunk allow-pass vlan 66#interface Ethernet0/0/2port link-type accessport default vlan 10#interface Ethernet0/0/3#interface Ethernet0/0/4#interface Ethernet0/0/5#interface Ethernet0/0/6#interface Ethernet0/0/7#interface Ethernet0/0/8#interface Ethernet0/0/9#interface Ethernet0/0/10#interface Ethernet0/0/11#interface Ethernet0/0/12#interface Ethernet0/0/13#interface Ethernet0/0/14#interface Ethernet0/0/15#interface Ethernet0/0/16#interface Ethernet0/0/17#interface Ethernet0/0/18#interface Ethernet0/0/19#interface Ethernet0/0/20#interface Ethernet0/0/21#interface Ethernet0/0/22#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/2#interface NULL0#ip route-static 0.0.0.0 0.0.0.0 10.1.14.2#user-interface con 0user-interface vty 0 4#return

附件2:S3700-LSW2配置文件

#sysname LSW2#vlan batch 20 88#cluster enablentdp enablendp enable#drop illegal-mac alarm#diffserv domain default#drop-profile default#aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password simple adminlocal-user admin service-type http#interface Vlanif1#interface Vlanif20ip address 10.1.2.254 255.255.255.0 #interface Vlanif88ip address 10.1.24.1 255.255.255.252 #interface MEth0/0/1#interface Ethernet0/0/1port link-type trunkport trunk allow-pass vlan 88#interface Ethernet0/0/2port link-type accessport default vlan 20#interface Ethernet0/0/3#interface Ethernet0/0/4#interface Ethernet0/0/5#interface Ethernet0/0/6#interface Ethernet0/0/7#interface Ethernet0/0/8#interface Ethernet0/0/9#interface Ethernet0/0/10#interface Ethernet0/0/11#interface Ethernet0/0/12#interface Ethernet0/0/13#interface Ethernet0/0/14#interface Ethernet0/0/15#interface Ethernet0/0/16#interface Ethernet0/0/17#interface Ethernet0/0/18#interface Ethernet0/0/19#interface Ethernet0/0/20#interface Ethernet0/0/21#interface Ethernet0/0/22#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/2#interface NULL0#ip route-static 0.0.0.0 0.0.0.0 10.1.24.2#user-interface con 0user-interface vty 0 4#return

附件3:S3700-LSW3配置文件

#sysname LSW3#vlan batch 30 99#cluster enablentdp enablendp enable#drop illegal-mac alarm#diffserv domain default#drop-profile default#aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password simple adminlocal-user admin service-type http#interface Vlanif1#interface Vlanif30ip address 10.1.3.254 255.255.255.0 #interface Vlanif99ip address 10.1.34.1 255.255.255.252 #interface MEth0/0/1#interface Ethernet0/0/1port link-type trunkport trunk allow-pass vlan 99#interface Ethernet0/0/2port link-type accessport default vlan 30#interface Ethernet0/0/3#interface Ethernet0/0/4#interface Ethernet0/0/5#interface Ethernet0/0/6#interface Ethernet0/0/7#interface Ethernet0/0/8#interface Ethernet0/0/9#interface Ethernet0/0/10#interface Ethernet0/0/11#interface Ethernet0/0/12#interface Ethernet0/0/13#interface Ethernet0/0/14#interface Ethernet0/0/15#interface Ethernet0/0/16#interface Ethernet0/0/17#interface Ethernet0/0/18#interface Ethernet0/0/19#interface Ethernet0/0/20#interface Ethernet0/0/21#interface Ethernet0/0/22#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/2#interface NULL0#ip route-static 0.0.0.0 0.0.0.0 10.1.34.2#user-interface con 0user-interface vty 0 4#return

附件4:S5700-LSW4配置文件

#sysname LSW4#vlan batch 66 88 99#cluster enablentdp enablendp enable#drop illegal-mac alarm#diffserv domain default#drop-profile default#aaa authentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain default domain default_admin local-user admin password simple adminlocal-user admin service-type http#interface Vlanif1#interface Vlanif66ip address 10.1.14.2 255.255.255.252 #interface Vlanif88ip address 10.1.24.2 255.255.255.252 #interface Vlanif99ip address 10.1.34.2 255.255.255.252 #interface MEth0/0/1#interface GigabitEthernet0/0/1port link-type trunkport trunk allow-pass vlan 66#interface GigabitEthernet0/0/2port link-type trunkport trunk allow-pass vlan 88#interface GigabitEthernet0/0/3port link-type trunkport trunk allow-pass vlan 99#interface GigabitEthernet0/0/4#interface GigabitEthernet0/0/5#interface GigabitEthernet0/0/6#interface GigabitEthernet0/0/7#interface GigabitEthernet0/0/8#interface GigabitEthernet0/0/9#interface GigabitEthernet0/0/10#interface GigabitEthernet0/0/11#interface GigabitEthernet0/0/12#interface GigabitEthernet0/0/13#interface GigabitEthernet0/0/14#interface GigabitEthernet0/0/15#interface GigabitEthernet0/0/16#interface GigabitEthernet0/0/17#interface GigabitEthernet0/0/18#interface GigabitEthernet0/0/19#interface GigabitEthernet0/0/20#interface GigabitEthernet0/0/21#interface GigabitEthernet0/0/22#interface GigabitEthernet0/0/23#interface GigabitEthernet0/0/24#interface NULL0#ip route-static 10.1.1.0 255.255.255.0 10.1.14.1ip route-static 10.1.2.0 255.255.255.0 10.1.24.1ip route-static 10.1.3.0 255.255.255.0 10.1.34.1#user-interface con 0user-interface vty 0 4#return

欢迎关注公众号,方便学习交流

如果觉得《不同网段通过静态路由实现互通(强烈推荐)》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。