1. 配置VLANIF接口的IP地址
[LSW1]vlan batch 10
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 10
[LSW1]int Vlanif 10
[LSW1-Vlanif10]ip add 10.1.1.2 16
[LSW2]vlan batch 10 20
[LSW2-GigabitEthernet0/0/1]port link-type access
[LSW2-GigabitEthernet0/0/1]port default vlan 10
[LSW2-GigabitEthernet0/0/2]port link-type access
[LSW2-GigabitEthernet0/0/2]port default vlan 20
[LSW2-GigabitEthernet0/0/3]port link-type access
[LSW2-GigabitEthernet0/0/3]port default vlan 20
[LSW2-Vlanif10]ip add 10.1.1.1 16
[LSW2-Vlanif20]ip add 10.2.1.1 16
[LSW3]vlan batch 10 20
[LSW3-GigabitEthernet0/0/1]port link-type access
[LSW3-GigabitEthernet0/0/1]port default vlan 20
[LSW3-GigabitEthernet0/0/3]port link-type access
[LSW3-GigabitEthernet0/0/3]port default vlan 10
[LSW3-Vlanif10]ip add 10.3.1.1 16
[LSW3-Vlanif20]ip add 10.2.1.2 16
2. 配置OSPF
[LSW1]ospf 1
[LSW1-ospf-1]area 0
[LSW1-ospf-1-area-0.0.0.0]network 10.1.0.0 0.0.255.255
[LSW2]ospf 1
[LSW2-ospf-1]area 0
[LSW2-ospf-1-area-0.0.0.0]network 10.1.0.0 0.0.255.255
[LSW2-ospf-1-area-0.0.0.0]network 10.2.0.0 0.0.255.255
[LSW2-ospf-1-area-0.0.0.0]network 10.4.1.1 0.0.0.0
[LSW3]ospf 1
[LSW3-ospf-1]area 0
[LSW3-ospf-1-area-0.0.0.0]network 10.2.0.0 0.0.255.255
[LSW3-ospf-1-area-0.0.0.0]network 10.3.0.0 0.0.255.255
[LSW3-ospf-1-area-0.0.0.0]network 10.4.1.2 0.0.0.0
3. 在LSW1上配置静态DNS表项
[LSW1]ip host host1 10.4.1.1
[LSW1]ip host host2 10.4.1.2
4. 使能DNS域名解析功能
[LSW1]dns resolve
5. 配置DNS服务器的IP地址
[LSW1]dns server 10.3.1.2
6. 配置域名后缀
[LSW1]dns domain net
[LSW1]dns domain com
7.配置其他IP地址
[LSW2]int LoopBack 0
[LSW2-LoopBack0]ip add 10.4.1.1 32
[LSW3]int LoopBack 0
[LSW3-LoopBack0]ip add 10.4.1.2 32
8.验证配置