vlan batch 10 20 30 99
int g0/0/1
port link-type access
port default vlan 10
q
int g0/0/2
port link-type access
port default vlan 20
q
int g0/0/3
port link-type access
port default vlan 30
q
int g0/0/24
port link-type access
port default vlan 99
q
interface Vlanif10
ip address 10.5.11.254 24
q
interface Vlanif20
ip address 10.5.12.254 24
q
interface Vlanif30
ip address 10.5.13.254 24
q
interface Vlanif99
ip address 10.5.14.2 255.255.255.0
q
[sw-hexin]dis ip in b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 1
The number of interface that is DOWN in Physical is 6
The number of interface that is UP in Protocol is 1
The number of interface that is DOWN in Protocol is 6
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned down down
Vlanif10 10.5.11.254/24 down down
Vlanif20 10.5.12.254/24 down down
Vlanif30 10.5.13.254/24 down down
Vlanif99 10.5.14.2/24 down down
[sw-hexin]
dhcp enable #全局模式下开启DHCP
int g0/0/0
ip add 10.5.14.1 24
dhcp select global #此接口选择全局的地址池给DHCP客户端使用
q
ip route-static 10.5.11.0 255.255.255.0 10.5.14.2
ip route-static 10.5.12.0 255.255.255.0 10.5.14.2
ip route-static 10.5.13.0 255.255.255.0 10.5.14.2
或者可以直接写一条
ip route-static 10.5.0.0 16 10.5.14.2
ip pool vlan10
gateway-list 10.5.11.254
network 10.5.11.0 mask 255.255.255.0
dns-list 114.114.114.114
q
ip pool vlan20
gateway-list 10.5.12.254
network 10.5.12.0 mask 255.255.255.0
dns-list 114.114.114.114
q
ip pool vlan30
gateway-list 10.5.13.254
network 10.5.13.0 mask 255.255.255.0
dns-list 114.114.114.114
q
ip pool vlan99
gateway-list 10.5.14.254
network 10.5.14.0 mask 255.255.255.0
dns-list 114.114.114.114
q
检查结果
[pr-route]dis ip pool
-----------------------------------------------------------------------
Pool-name : vlan10
Pool-No : 0
Position : Local Status : Unlocked
Gateway-0 : 10.5.11.254
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------
Pool-name : vlan20
Pool-No : 1
Position : Local Status : Unlocked
Gateway-0 : 10.5.12.254
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------
Pool-name : vlan30
Pool-No : 2
Position : Local Status : Unlocked
Gateway-0 : 10.5.13.254
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------
Pool-name : vlan99
Pool-No : 3
Position : Local Status : Unlocked
Gateway-0 : 10.5.14.254
Mask : 255.255.255.0
VPN instance : --
IP address Statistic
Total :1012
Used :0 Idle :1012
Expired :0 Conflict :0 Disable :0
[pr-route]
sw-hexin上配置
dhcp enable
interface Vlanif10
dhcp select relay
dhcp relay server-ip 10.5.14.1
q
interface Vlanif20
dhcp select relay
dhcp relay server-ip 10.5.14.1
q
interface Vlanif30
dhcp select relay
dhcp relay server-ip 10.5.14.1
q
interface Vlanif99
dhcp select relay
dhcp relay server-ip 10.5.14.1
q
检查中继
interface Vlanif10
ip address 10.5.11.254 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.5.14.1
interface Vlanif20
ip address 10.5.12.254 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.5.14.1
interface Vlanif30
ip address 10.5.13.254 255.255.255.0
dhcp select relay
dhcp relay server-ip 10.5.14.1
purui-route上配置
ip pool vlan10
excluded-ip-address 10.5.11.200 10.5.11.253
q
ip pool vlan20
excluded-ip-address 10.5.12.200 10.5.12.253
q
ip pool vlan30
excluded-ip-address 10.5.13.200 10.5.13.253
q
这里需要注意的是一定要选dhcp,然后点击应用。
purui-route 加路由
ip route-static 0.0.0.0 0 20.1.1.2
jituan-route加路由
ip route-static 0.0.0.0 0 24 30.1.1.2
使得两个公网IP互通
purui-route
[pr-route]interface Tunnel 0/0/1 #新建隧道
[pr-route-Tunnel0/0/1]description to_jituan #隧道描述
[pr-route-Tunnel0/0/1]tunnel-protocol gre #隧道协议
[pr-route-Tunnel0/0/1]source 20.1.1.1#源地址
[pr-route-Tunnel0/0/1]destination 30.1.1.1 #目标地址
[pr-route-Tunnel0/0/1]ip add 50.1.1.1 24 #给隧道配置地址
jituan-route
[jituan-route]interface Tunnel 0/0/0
[jituan-route-Tunnel0/0/0]description to_purui
[jituan-route-Tunnel0/0/0]tunnel-protocol gre
[jituan-route-Tunnel0/0/0]source 30.1.1.1
[jituan-route-Tunnel0/0/0]destination 20.1.1.1
[jituan-route-Tunnel0/0/0]ip add 50.1.1.2 24
purui-route 加路由
ip route-static 192.168.0.0 24 50.1.1.2
jituan-route加路由
ip route-static 10.5.0.0 16 50.1.1.1