办公楼要进行装修同时对现有网络进行改造,目前核心交换机是思科产品后续用华为的产品替换,为了避免影响办公,先用华为产品在临时办公地根据现有的网络配置组建一个网络,如今的用户把计算机搬过去插上网线就能够和原来同样上网。网络
具体过程:ide
在思科交换机上设置好Trunk口。ui
conf t
int gigabitethernet 6/8this
switchport mode trunkcode
switchport trunk allow vlan all接口
write
exitip
在华为的5720上进行具体设置:路由
一、设置一个Trunk口;
interface GigabitEthernet 0/0/49 //指定某个光电口
port link-type trunk //设置trunk
port trunk allow-pass vlan all //容许全部VLAN 经过产品
或者it
interface GigabitEthernet0/0/49
port link-type trunk
port trunk allow-pass vlan 2 to 12 //容许Vlan2到Vlan12的访问经过
二、配置路由
ip route-static 0.0.0.0 0.0.0.0 路由地址 //设置静态路由
三、设置交换机的地址,管理地址,开放访问模式;
四、将每一个接口(端口)上配置Vlan,对应到现有的Vlan,绑定IP地址、Mac地址、接口(端口)号。
⑴ 建立Vlan
interface Vlan号
ip address 网关地址 子网掩码
⑵进入具体接口,绑定Vlan便可。
interface GigabitEthernet0/0/1
port link-type access
port default vlan 5
⑶绑定
ip source check user-bind enable
绑定IP地址、Mac地址、端口
user-bind static ip-address IP地址 mac-address Mac地址 interface GigabitEthernet 0/0/1 vlan ID
如须要删除以前的绑定,能够输入
undo user-b static ip-address #ip地址; //删除端口、MAC地址绑定,也能够输出mac-address #mac地址
user-bind static ip-address #ip地址 mac-address #mac地址 ; //指定ip地址和mac地址绑定,绑定类型能够端口,ip,mac自由组合
//第一种:绑定IP和端口(加Vlan)
user-bind static ip-address IP地址 interface GigabitEthernet 0/0/1 vlan ID
//第二种:绑定Mac和端口(加Vlan)
user-bind static mac-address Mac地址 interface GigabitEthernet 0/0/1 vlan ID
//第三种:绑定IP、Mac和端口(加Vlan)
user-bind static ip-address IP地址 mac-address Mac地址 interface GigabitEthernet 0/0/1 vlan ID
经常使用命令:
quit //退出配置界面
save //保存设置
display this //显示当前接口或者Vlan的配置
display Current //显示系统当前的配置
undo 操做 //删除操做
与思科操做相似,不熟悉命令后面加?,记不全命令加Tab。
PS:进过试运行,机关楼网络出现问题,同时临时办公地的网络也有问题,虽然两边均可以正常上网。 通过排查,多是交换机设置出现问题,删除了临时办公点的Vlan里面的ip address 的设置,修改交换机的管理地址,两边的网络没有再出现问题,临时办公点的Vlan只须要绑定端口便可,不须要再对Vlan进行详细设置来肯定子网。