SW2========================================================================================
[sw2]dis cu
#
sysname sw2
vlan batch 10 20 ------添加vlan
#
interface Eth-Trunk1 链路聚合
port link-type trunk 把接口设为trunk模式允许vlan 10 20通过
port trunk allow-pass vlan 10 20
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface Ethernet0/0/1
port link-type access 把接口以access模式加入到vlan 10
port default vlan 10
#
interface Ethernet0/0/10
eth-trunk 1 接口添加到eth-trunk 1
#
interface Ethernet0/0/11
eth-trunk 1
#
interface Ethernet0/0/12
port link-type access 把接口以access模式加入到vlan 20
port default vlan 20
#
interface GigabitEthernet0/0/1
eth-trunk 2 接口添加到eth-trunk 2
#
interface GigabitEthernet0/0/2
eth-trunk 2
#
SW3========================================================================================
sysname Huawei
#
vlan batch 10 20
#
#
interface Eth-Trunk1 进接口
port link-type trunk 把接口设置为trunk
port trunk allow-pass vlan 10 20 trunk允许通过vlan10 20
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
port link-type access 把接口以access模式加入到vlan 10
port default vlan 10
#
interface Ethernet0/0/12
eth-trunk 1
# 把接口添加到eth-trunk 1
interface Ethernet0/0/13
eth-trunk 1
#
SW1=============================================================================================
sysname sw1
#
vlan batch 10 20 30 100 添加vlan
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
dhcp enable 开启dhcp功能
#
diffserv domain default
#
drop-profile default
#
ip pool vlan20
gateway-list 192.168.20.1
network 192.168.20.0 mask 255.255.255.0 给vlan20 设置地址池
dns-list 2.2.2.2
#
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
dhcp select interface 给vlan10设置dhcp 基于端口
dhcp server dns-list 1.1.1.1
#
interface Vlanif20
ip address 192.168.20.1 255.255.255.0 给vlan20设置网关
dhcp select global dhcp地址池选择全局
#
interface Vlanif30
ip address 192.168.30.1 255.255.255.0 vlan30 设置网关
dhcp select global
dhcp select relay dhcp中继代理
dhcp relay server-ip 23.0.0.3 指向代理方得ip地址
#
interface Vlanif100
ip address 11.0.0.1 255.255.255.0 vlan100设置网关
#
interface MEth0/0/1
#
interface Eth-Trunk2 进接口interface Eth-Trunk2 并把它设置为trunk,允许vlan 10 20通过
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface Eth-Trunk3
port link-type access 进接口interface Eth-Trunk3 并把它设置为trunk,允许vlan 100通过
port default vlan 100
#
interface GigabitEthernet0/0/1
eth-trunk 2 把接口添加到 eth-trunk 2
#
interface GigabitEthernet0/0/2
eth-trunk 2
#
interface GigabitEthernet0/0/3
port link-type access 进接口 ,把接口设置为access口属于vlan30
port default vlan 30
#
interface GigabitEthernet0/0/4
eth-trunk 3
# 把接口添加到 eth-trunk 23
interface GigabitEthernet0/0/5
eth-trunk 3
#
rip 1 动态路由协议
undo summary 关闭路由汇总
version 2 版本2
network 192.168.10.0
network 192.168.20.0 告诉邻居自己知道的ip
network 192.168.30.0
network 11.0.0.0
AR1========================================================================================
interface Eth-Trunk3 进入Eth-Trunk3
undo portswitch 从二层模式切换到三层
ip address 11.0.0.2 255.255.255.0 给Eth-Trunk3设置ip
#
interface GigabitEthernet0/0/0
eth-trunk 3 把接口添加到 eth-trunk 3 (链路聚合)
#
interface GigabitEthernet0/0/1
eth-trunk 3
#
interface GigabitEthernet0/0/2
ip address 12.0.0.1 255.255.255.0 设置ip
#
interface NULL0
#
rip 1
undo summary
version 2
network 11.0.0.0
network 12.0.0.0
AR2================================================================================================
interface Eth-Trunk4
undo portswitch 从二层模式切换到三层
ip address 23.0.0.2 255.255.255.0 设置ip
#
interface GigabitEthernet0/0/0
ip address 12.0.0.2 255.255.255.0 ip
#
interface GigabitEthernet0/0/1
eth-trunk 4 把接口添加到 eth-trunk 4(链路聚合)
#
interface GigabitEthernet0/0/2
eth-trunk 4
#
interface NULL0
#
rip 1
undo summary
version 2
network 23.0.0.0
network 12.0.0.0
#
AR3==========================================================================================
#
dhcp enable 开启dhcp功能
#
undo dhcp server bootp
#
ip pool vlan30
gateway-list 192.168.30.1
network 192.168.30.0 mask 255.255.255.0 设置地址池
dns-list 3.3.3.3 4.4.4.4
#
interface Eth-Trunk4
undo portswitch 从二层模式切换到三层
ip address 23.0.0.3 255.255.255.0
dhcp select global 全局的地址池给DHCP客户端使用
#
interface GigabitEthernet0/0/0
eth-trunk 4 把接口添加到 eth-trunk 4(链路聚合)
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
eth-trunk 4 把接口添加到 eth-trunk 4(链路聚合)
#
interface NULL0
#
rip 1
undo summary
version 2
network 23.0.0.0
#
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。