本人新手,现配置核心交换机通过vlan分配不同网段,上级为H3C ER8300G2-X路由器,交换机静态ip已经做好,地址为172.16.10.1,ip可分配,但是无法上网,H3C ER8300G2-X路由器需要如何做静态ip才可上外网。
核心交换机配置如下
#
version 7.1.045, Release 1122
#
sysname JiFang_H3C_4520
#
clock timezone Beijing add 08:00:00
clock protocol none
#
telnet server enable
#
irf mac-address persistent timer
irf auto-update enable
undo irf link-delay
irf member 1 priority 1
#
dhcp enable
#
lldp global enable
#
password-recovery enable
#
vlan 1
#
vlan 10
#
vlan 100
description YouXian
#
vlan 110 to 111
#
vlan 200
description WuXian
#
vlan 230
#
vlan 300
description GuangBo
#
vlan 1000
#
dhcp server ip-pool vlan10
gateway-list 192.168.10.1
network 192.168.10.0 mask 255.255.255.0
dns-list 61.134.1.4 218.30.19.40
#
dhcp server ip-pool vlan100
gateway-list 192.168.100.1
network 192.168.100.0 mask 255.255.255.0
dns-list 61.134.1.4 218.30.19.40
#
dhcp server ip-pool vlan110
gateway-list 192.168.110.1
network 192.168.110.0 mask 255.255.255.0
dns-list 61.134.1.4 218.30.19.40
#
dhcp server ip-pool vlan111
gateway-list 192.168.111.1
network 192.168.111.0 mask 255.255.255.0
dns-list 61.134.1.4 218.30.19.40
#
dhcp server ip-pool vlan230
gateway-list 192.168.230.1
network 192.168.230.0 mask 255.255.255.0
dns-list 61.134.1.4 218.30.19.40
#
interface NULL0
#
interface Vlan-interface10
ip address 192.168.10.1 255.255.255.0
#
interface Vlan-interface100
ip address 192.168.100.1 255.255.255.0
#
interface Vlan-interface110
ip address 192.168.110.1 255.255.255.0
#
interface Vlan-interface111
ip address 192.168.111.1 255.255.255.0
#
interface Vlan-interface200
#
interface Vlan-interface230
ip address 192.168.230.1 255.255.255.0
#
interface Vlan-interface300
#
interface Vlan-interface1000
ip address 172.16.10.2 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/2
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/3
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/4
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/5
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/6
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/7
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/8
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/9
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/10
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet1/0/11
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface GigabitEthernet1/0/12
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface GigabitEthernet1/0/13
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface GigabitEthernet1/0/14
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface GigabitEthernet1/0/15
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface GigabitEthernet1/0/16
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface GigabitEthernet1/0/17
port link-mode bridge
port access vlan 230
combo enable copper
#
interface GigabitEthernet1/0/18
port link-mode bridge
description YouXian
port access vlan 230
combo enable copper
#
interface GigabitEthernet1/0/19
port link-mode bridge
description WuXian
port access vlan 300
combo enable copper
#
interface GigabitEthernet1/0/20
port link-mode bridge
description WuXian
port access vlan 300
combo enable copper
#
interface GigabitEthernet1/0/21
port link-mode bridge
description WuXian
port access vlan 200
combo enable copper
#
interface GigabitEthernet1/0/22
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan all
combo enable copper
#
interface GigabitEthernet1/0/23
port link-mode bridge
description WuXian
port access vlan 200
combo enable copper
#
interface GigabitEthernet1/0/24
port link-mode bridge
description GuanLi
port access vlan 1000
combo enable copper
#
interface M-GigabitEthernet0/0/0
#
interface M-GigabitEthernet0/0/1
#
interface Ten-GigabitEthernet1/0/25
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface Ten-GigabitEthernet1/0/26
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface Ten-GigabitEthernet1/0/27
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
interface Ten-GigabitEthernet1/0/28
port link-mode bridge
description GongXiang
port link-type trunk
port trunk permit vlan 1 100 200 300
#
scheduler logfile size 16
#
line class aux
user-role network-admin
#
line class vty
user-role network-operator
#
line aux 0
user-role network-admin
#
line vty 0 4
authentication-mode scheme
user-role network-operator
protocol inbound telnet
#
line vty 5 63
user-role network-operator
#
ip route-static 0.0.0.0 0 172.16.10.1
#
snmp-agent
snmp-agent local-engineid 800063A280AC7409388A4400000001
snmp-agent sys-info version v3
#
radius scheme system
user-name-format without-domain
#
domain system
#
domain default enable system
#
role name level-0
description Predefined level-0 role
#
role name level-1
description Predefined level-1 role
#
role name level-2
description Predefined level-2 role
#
role name level-3
description Predefined level-3 role
#
role name level-4
description Predefined level-4 role
#
role name level-5
description Predefined level-5 role
#
role name level-6
description Predefined level-6 role
#
role name level-7
description Predefined level-7 role
#
role name level-8
description Predefined level-8 role
#
role name level-9
description Predefined level-9 role
#
role name level-10
description Predefined level-10 role
#
role name level-11
description Predefined level-11 role
#
role name level-12
description Predefined level-12 role
#
role name level-13
description Predefined level-13 role
#
role name level-14
description Predefined level-14 role
#
user-group system
#
local-user admin class manage
password hash $h$6$x5ug5hHX6pznwcsc$HVVi3nPdWpfh5ygtgylAkAxGE0yC0N7jSJIawzaLnat9cj8vX8HewrpEVJC+XogfFQTWwEoMkUl5n309PEFyvQ==
service-type telnet terminal http https
authorization-attribute user-role network-admin
authorization-attribute user-role network-operator
#
ip http enable
#
return
(0)
最佳答案
目录
ER G2路由器下联交换机实现多网段上网(交换机作为终端的网关)配置方法 1
本案例适用ER G2路由器结合支持DHCP服务器的交换机实现多网段上网。交换机型号包括:S5560S系列、S5130S系列、S7000E系列、S5500V2系列,S5120V2系列等
将路由器的LAN口与交换机G1/0/1口相连。交换机G1/0/2口接PC2,交换机G1/0/3口接PC3。交换机除默认管理vlan1之外,需新建两个网关地址,分别为vlan2:192.168.2.1、vlan3:192.168.3.1.以及两个DHCP服务器给终端PC分配地址要求终端PC2和PC3可以自动获取到2网段地址和3网段地址,并可以访问互联网(访问路由器的网关)。
单击【接口管理】--【WAN设置】--【连接到因特网】,WAN网口1选择PPPoE,运营商提供PPPoE用户名为adc PPPoE密码为abc123456 最后点击【应用】。
单击 【高级设置】--【路由设置】--【静态路由】,目的地址分别是交换机vlan2、vlan3的网关,下一跳地址是交换机和路由器互连接口的地址。交换机上新增了vlan2和van3,因此需要配置两条静态路由。
设备默认会保存配置。
#进入命令行,创建VLAN 2 、VLAN3,并配置网关
<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]vlan 2
[H3C-vlan2]quit
[H3C]vlan 3
[H3C-vlan2] quit
[H3C] interface Vlan-interface 1
[H3C-Vlan-interface1]ip address 192.168.1.2 24
[H3C] interface Vlan-interface 2
[H3C-Vlan-interface2]ip address 192.168.2.1 24
[H3C-Vlan-interface2]quit
[H3C] interface Vlan-interface 3
[H3C-Vlan-interface3]ip address 192.168.3.1 24
[H3C-Vlan-interface3]quit
[H3C]dhcp enable
#创建vlan2的地址池
[H3C]dhcp server ip-pool vlan2
#发布网段为192.168.2.0网段
[H3C-dhcp-pool-vlan2]network 192.168.2.0
#指定网关地址
[H3C-dhcp-pool-vlan2]gateway-list 192.168.2.1
#指定dns
[H3C-dhcp-pool-vlan2]dns-list 114.114.114.114
[H3C-dhcp-pool-vlan2]quit
#创建vlan2的地址池
[H3C]dhcp server ip-pool vlan3
#发布网段为192.168.2.0网段
[H3C-dhcp-pool-vlan3]network 192.168.3.0
#指定网关地址
[H3C-dhcp-pool-vlan3]gateway-list 192.168.3.1
#指定dns
[H3C-dhcp-pool-vlan3]dns-list 114.114.114.114
[H3C-dhcp-pool-vlan3]quit
#将交换机与PC互联接口分别加入VLAN 中
[H3C] interface GigabitEthernet 1/0/2
[H3C-GigabitEthernet1/0/2]port access vlan 2
[H3C-GigabitEthernet1/0/2]quit
[H3C] interface GigabitEthernet 1/0/3
[H3C-GigabitEthernet1/0/3]port access vlan 3
[H3C-GigabitEthernet1/0/3]quit
#配置出口默认静态路由
[H3C]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
#保存配置
[H3C]save force
Validating file. Please wait...
Saved the current configuration to mainboard device successfully.
(0)
成功解决上网的问题,但是vlan2和vlan3上面的pc互相ping不通,该如何解决?
把ER的LAN口地址设置为和核心交换机相连接口为同一网段,保证核心交换机可以ping通ER的路由器,然后在路由器上配置路由即可。
静态路由是一种特殊的路由,需要您手工设置。设置静态路由后,去往指定目的地的报文将按照您指定的路径进行转发。在组网结构比较简单的网络中,只需设置静态路由就可以实现网络互通。恰当地设置和使用静态路由可以改善网络的性能,并可为重要的网络应用保证带宽。
静态路由的缺点在于:不能自动适应网络拓扑结构的变化,当网络发生故障或者拓扑发生变化后,可能会出现路由不可达,导致网络中断。此时必须由您手工修改静态路由的设置。
比如:如图13-2所示,如果您希望LAN A中PC1与LAN B中PC2可以相互访问或LAN B中PC2通过ER G2系列高性能路由器访问因特网,则可以在ER G2系列路由器上设置一条静态路由(目的网段:192.168.2.0,下一跳地址:192.168.1.3)。
页面向导:高级设置→路由设置→静态路由
本页面为您提供如下主要功能:
显示和修改当前您已添加的静态路由(主页面) | |
添加静态路由(主页面。单击<新增>按钮,在弹出的对话框中设置相应的参数,单击<增加>按钮完成操作) | |
查看所添加的静态路由的生效情况(单击主页面上的“查看路由信息表”按钮,您即可在弹出的页面中查看已经生效的静态路由信息。如果您添加了一条错误的静态路由,该路由不会生效。您可以通过对比主页面的静态路由表和此处的路由信息,判断您是否添加了错误路由) |
页面中关键项的含义如下表所示。
表13-3 页面关键项描述
页面关键项 | 说明 |
目的地址 | 输入需要到达的目的IP地址 |
子网掩码 | 输入需要到达的目的地址的子网掩码 |
下一跳地址 | 输入数据在到达目的地址前,需要经过的下一个路由器的IP地址 |
出接口 | 选择静态路由的出接口 您必须选择正确的出接口,所添加的静态路由才能生效 |
描述 | 对此静态路由表项进行描述 |
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
成功解决上网的问题,但是vlan2和vlan3上面的pc互相ping不通,该如何解决?