!
hostname SWCore
!
ip routing
!
!
interface GigabitEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface Vlan1
no shut
ip address 192.168.1.1 255.255.255.0
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
ip helper-address 192.168.1.20
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
ip helper-address 192.168.1.20
!
ip route 0.0.0.0 0.0.0.0 192.168.1.254
!
vtp mode server
vtp domain duytan.vn
vtp password dtu123
SWCore(config)#vlan 10
SWCore(config-vlan)#name TaiChinh
SWCore(config)#vlan 20
SWCore(config-vlan)#name KeToan
//Xem thông tin VLAN đã được tạo
SWCore# show vlan
//Xem thông tin VTP
SWCore# show vtp status
vtp mode client
vtp domain duytan.vn
vtp password dtu123
interface G0/1
switchport mode trunk
exit
interface range F0/1 - 10
switchport mode access
switchport access vlan 10
exit
//Xem thông tin VLAN đã được tạo
SW1# show vlan
//Xem thông tin VTP
SW1# show vtp status
vtp mode client
vtp domain duytan.vn
vtp password dtu123
interface G0/2
switchport mode trunk
exit
interface range F0/11 - 20
switchport mode access
switchport access vlan 10
exit
//Xem thông tin VLAN đã được tạo
SW1# show vlan
//Xem thông tin VTP
SW1# show vtp status
//Laptop-VLAN10 đã xin được IP từ DHCP Server
//Laptop-VLAN20 đã xin được IP từ DHCP Server
!
hostname RouterGW
!
interface FastEthernet0/0
no shut
ip address 192.168.1.254 255.255.255.0
ip nat inside
exit
!
interface FastEthernet0/1
no shut
ip address 8.8.8.9 255.255.255.240
ip nat outside
exit
!
ip route 192.168.10.0 255.255.255.0 FastEthernet0/0
ip route 192.168.20.0 255.255.255.0 FastEthernet0/0
!
access-list 1 permit 192.168.1.0 0.0.0.255
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255
!
!
ip nat inside source list 1 interface FastEthernet0/1 overload
ip nat inside source static tcp 192.168.1.10 80 8.8.8.9 80
ip nat inside source static tcp 192.168.1.10 443 8.8.8.9 443
!
Ping thất bại là đúng theo yêu cầu đặt ra.
Trung cập thành công là OK!
RouterGW#show ip nat translations
» Tin mới nhất:
» Các tin khác: