IT袋

当前位置:主页 > 经验教程 > 硬件教程 >

网关怎么设置才能上网

网关怎么设置才能上网 无线路由器密码重新设置的方法(2)

更新:2023-08-28 22:08:08 来源:IT袋 作者:苏晓敏
导读:网关怎么设置才能上网,对端 SW1 的接口地址 192.168.5.1 6.配置完成后保存配置 SW2 save SW3 配置如下: 1.创建 vlan SW3 system-view //进入系统模式 [SW3] vlan 4 //新建 vlan 4 [SW3-vlan4] quit // 退出

网关怎么设置才能上网

对端 SW1 的接口地址 192.168.5.1

6.配置完成后保存配置

<SW2> save

SW3 配置如下:

1.创建 vlan

<SW3> system-view //进入系统模式

[SW3] vlan 4 //新建 vlan 4

[SW3-vlan4] quit // 退出 vlan 4

[SW3] vlan 5

[SW3-vlan5] quit

2.接口加入到相应 vlan

# SW2—–PC

[SW3] interface Ethernet 0/0/1 //接 PC 电脑

[SW3-Ethernet0/0/1] port link-type access //链路类型为 access

[SW3-Ethernet0/0/1] port default vlan 4

[SW3-Ethernet0/0/1] quit

# SW3—SW1

[SW3] interface GigabitEthernet 0/0/1 //对接 SW1

[SW3-GigabitEthernet0/0/1] port link-type access //链路类型为 access

[SW3-GigabitEthernet0/0/1] port default vlan 5

[SW3-GigabitEthernet0/0/1] quit

3.配置 IP 地址作为 PC 电脑的网关 IP 地址

[SW3] interface Vlanif 4 //系统视图进入 vlanif4 三层接口

[SW3-Vlanif4] ip address 192.168.4.1 24 //配置 PC3 和 PC4 的网关地址

[SW3-Vlanif4] quit

4.配置 ip 地址实现 SW3 和 SW1 互联

[SW3] interface Vlanif 5

[SW3-Vlanif5] ip address 192.168.5.3 24 //互联接口 IP 地址

[SW3-Vlanif5] quit

5.配置静态路由,为 SW3 下 PC 网段出去指路

[SW3] ip route-static 0.0.0.0 0.0.0.0 192.168.5.1 //配置默认路由出去,下一跳

为对端 SW1 的接口地址 192.168.5.1

6.配置完成后保存配置

<SW3> save

SW1 配置:

1.创建 vlan

<SW1> system-view //进入系统模式

[SW1] vlan 5 //新建 vlan 5

[SW1-vlan5] quit //退出 vlan5 模式

2.接口加入到相应 vlan 配置

[SW1] interface GigabitEthernet 0/0/2 //对接 SW2

[SW1-GigabitEthernet0/0/2] port link-type access //链路类型为 access

[SW1-GigabitEthernet0/0/2] port default vlan 5 //透传 vlan5

[SW1-GigabitEthernet0/0/2] quit //退出接口 GE0/0/5

[SW1] interface GigabitEthernet 0/0/24 //对接 SW3

[SW1-GigabitEthernet0/0/24] port link-type access

[SW1-GigabitEthernet0/0/24] port default vlan 5

[SW1-GigabitEthernet0/0/24] quit

[SW1] interface GigabitEthernet 0/0/1 //对接 R 路由器

[SW1-GigabitEthernet0/0/1] port link-type access

[SW1-GigabitEthernet0/0/1] port default vlan 5

[SW1-GigabitEthernet0/0/1] quit

3. 配 IP 地址,作为对接 SW2、SW3 及 R 路由器的互联接口地址

[SW1] interface Vlanif 5 //进入三层接口 vlanif5

[SW1-Vlanif5] ip address 192.168.5.1 24 //配置 ip 地址

[SW1-Vlanif5] quit //退出 vlanif 5

4.配置静态路由

# 配置回程明细路由,实现内网网段之间互访

相关阅读