准备工作:
1.核心交换机H3C S5500 vlan划分10,20,30,40,50,60,70 七个vlan
2.安装CentOS 5.6服务器配置ip地址为外网eth0地址为192.168.200.9 子网掩码为255.255.255.0 网关为192.168.200.96 dns为202.101.172.46,eth1内网地址无。
3.外网为eth0,内网为eth1,物理连接eth1连接交换机的 trunk口。
1.首先配置H3C S5500核心交换机划分7个VLAN,利用SecureCRT连接交换机器如图所示:
<H3C>dis cu //进入交换机首先查看默认配置如下:
#
version 5.20, Release 2202P19
#
sysname H3C
#
domain default enable system
#
telnet server enable
#
undo ip ttl-expires
#
vlan 1
#
radius scheme system
server-type extended
primary authentication 127.0.0.1 1645
primary accounting 127.0.0.1 1646
user-name-format without-domain
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
user-group system
#
interface NULL0
#
interface GigabitEthernet1/0/1
#
interface GigabitEthernet1/0/2
#
interface GigabitEthernet1/0/3
#
interface GigabitEthernet1/0/4
#
interface GigabitEthernet1/0/5
#
interface GigabitEthernet1/0/6
#
interface GigabitEthernet1/0/7
#
interface GigabitEthernet1/0/8
#
interface GigabitEthernet1/0/9
#
interface GigabitEthernet1/0/10
#
interface GigabitEthernet1/0/11
#
interface GigabitEthernet1/0/12
#
interface GigabitEthernet1/0/13
#
interface GigabitEthernet1/0/14
#
interface GigabitEthernet1/0/15
#
interface GigabitEthernet1/0/16
#
interface GigabitEthernet1/0/17
#
interface GigabitEthernet1/0/18
#
interface GigabitEthernet1/0/19
#
interface GigabitEthernet1/0/20
#
interface GigabitEthernet1/0/21
#
interface GigabitEthernet1/0/22
#
interface GigabitEthernet1/0/23
#
interface GigabitEthernet1/0/24
#
interface GigabitEthernet1/0/25
shutdown
#
interface GigabitEthernet1/0/26
shutdown
#
interface GigabitEthernet1/0/27
shutdown
#
interface GigabitEthernet1/0/28
shutdown
#
user-interface aux 0
user-interface vty 0 4
#
return
<H3C>system-view //进入视图模式创建vlan 10,20,30,40,50,60,70 每个vlan成员端口为2个。
System View: return to User View with Ctrl+Z.
[H3C]vlan 10//创建vlan10和直接进入vlan10视图模式
[H3C-vlan10]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2 //把1-2端口加入vlan10
[H3C-vlan10]vlan 20
[H3C-vlan20]port GigabitEthernet 1/0/3 to GigabitEthernet 1/0/4
[H3C-vlan20]vlan 30
[H3C-vlan30]port GigabitEthernet 1/0/5 to GigabitEthernet 1/0/6
[H3C-vlan30]vlan 40
[H3C-vlan40]port GigabitEthernet 1/0/7 to GigabitEthernet 1/0/8
[H3C-vlan40]vlan 50
[H3C-vlan50]port GigabitEthernet 1/0/9 to GigabitEthernet 1/0/10
[H3C-vlan50]vlan 60
[H3C-vlan60]port GigabitEthernet 1/0/11 to GigabitEthernet 1/0/12
[H3C-vlan60]VLAN 70
[H3C-vlan70]port GigabitEthernet 1/0/13 to GigabitEthernet 1/0/14
[H3C]interface GigabitEthernet 1/0/15 //进入1/0/15以太网端口视图
[H3C-GigabitEthernet1/0/15]port link-type trunk //设置15端口为trunk模式
[H3C-GigabitEthernet1/0/15]port trunk permit vlan all //设置15端口所有vlan都能通过
Please wait........................................... Done.
推荐阅读:
VMware虚拟机环境里用Linux和XP系统测试防火墙的NAT转换
NAT服务器教程