Mọi người giúp mình với. vấn đề là từ con Branch đến con HQ mình sử dụng OSPF. Từ con HQ đến ISP thì thầy yêu cầu là sử dụng định tuyến tĩnh ( Vì con ISP đã có internet). nhưng khi mình sử dụng OSPF trên tất cả router thì đã ping thành công hết. Nhưng khi vào internet lại ko được. Trong bài của mình thì con SERVER sẽ thay cho đường ra internet. mình làm trên thiết bị thật thì cũng đã ping được hết. Giờ mình mong các bạn chỉ mình cách nào vào được internet trên tất cả VLAN. thanks all.
link bài làm trên "Cisco Packet Tracer" và code cài đặt kèm theo file word.
CODE:
ISP(config)#interface fastEthernet 0/0
ISP(config-if)#ip ad
ISP(config-if)#ip address 192.168.100.254 255.255.255.0
ISP(config-if)#no shutdown
ISP(config)#interface fastEthernet 0/1
ISP(config-if)#ip address 172.16.100.1 255.255.255.0
ISP(config-if)#no shutdown
ISP(config-if)#
HQ(config)#interface fastEthernet 0/0
HQ(config-if)#ip address 192.168.100.253 255.255.255.0
HQ(config-if)#no shutdown
HQ(config-if)#exit
HQ(config)#
HQ(config)#interface fastEthernet 0/1
HQ(config-if)#ip address 10.30.21.1 255.255.255.252
HQ(config-if)#no shutdown
SW1(config)#ip routing
SW1(config-if)#interface FastEthernet0/1
SW1(config-if)#no switchport
SW1(config-if)#ip address 10.30.21.2 255.255.255.252
SW1(config-if)#no shutdown
SW1(config-if)#
SW1(config)#interface range fastEthernet 0/19 - 24
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#switchport trunk native vlan 99
SW1(config-if-range)#
SW1(config)#vtp mode server
Device mode already VTP SERVER.
SW1(config)#vtp domain phuong
Changing VTP domain name from NULL to phuong
SW1(config)#vtp password cisco
Setting device VLAN database password to cisco
SW1(config)#
SW1(config)#vlan 10
SW1(config-vlan)#name Finance
SW1(config-vlan)#vlan 20
SW1(config-vlan)#name "Human Resource"
SW1(config-vlan)#vlan 30
SW1(config-vlan)#name Marketing
SW1(config-vlan)#vlan 99
SW1(config-vlan)#name Management
SW1(config-vlan)#exit
SW1(config)#
SW1(config)#interface vlan 99
SW1(config-if)#ip address 10.30.20.1 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#interface vlan 10
SW1(config-if)#ip address 10.30.0.1 255.255.248.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#interface vlan 20
SW1(config-if)#ip address 10.30.8.1 255.255.248.0
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#interface vlan 30
SW1(config-if)#ip address 10.30.16.1 255.255.252.0
SW1(config-if)#no sh
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#
SW2(config)#interface range fastEthernet 0/19 - 24
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#switchport trunk native vlan 99
SW2(config-if-range)#
SW2(config)#vtp mode client
Setting device to VTP CLIENT mode.
SW2(config)#vtp domain phuong
Domain name already set to phuong.
SW2(config)#vtp password cisco
Setting device VLAN database password to cisco
SW2(config)#
SW2(config)#interface vlan 99
SW2(config-if)#ip address 10.30.20.2 255.255.255.0
SW2(config-if)#no shutdown
SW2(config-if)#
SW2(config)#ip default-gateway 10.30.20.1
SW2(config)#interface range fastEthernet 0/1 - 8
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 10
SW2(config-if-range)#exit
SW2(config)#interface range fastEthernet 0/9 - 14
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 20
SW2(config-if-range)#exit
SW2(config)#interface range fastEthernet 0/15 - 18
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 30
SW2(config-if-range)#exit
SW2(config)#
SW3(config)#interface range fastEthernet 0/19 - 24
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#switchport trunk native vlan 99
SW3(config)#vtp mode client
Setting device to VTP CLIENT mode.
SW3(config)#vtp domain phuong
Domain name already set to phuong.
SW3(config)#vtp password cisco
Setting device VLAN database password to cisco
SW3(config)#
SW3(config)#interface vlan 99
SW3(config-if)#ip address 10.30.20.3 255.255.255.0
SW3(config-if)#no shutdown
SW3(config-if)#
SW3(config)#ip default-gateway 10.30.20.1
SW1(config)#router ospf 1
SW1(config-router)#do show ip route con
C 10.30.0.0/21 is directly connected, Vlan10
C 10.30.8.0/21 is directly connected, Vlan20
C 10.30.16.0/22 is directly connected, Vlan30
C 10.30.20.0/24 is directly connected, Vlan99
C 10.30.21.0/30 is directly connected, FastEthernet0/1
SW1(config-router)#network 10.30.0.0 0.0.7.255 area 1
SW1(config-router)#network 10.30.8.0 0.0.7.255 area 1
SW1(config-router)#network 10.30.16.0 0.0.3.255 area 1
SW1(config-router)#network 10.30.20.0 0.0.0.255 area 1
SW1(config-router)#network 10.30.21.0 0.0.0.3 area 0
SW1(config-router)#
HQ(config)#router ospf 2
HQ(config-router)#do show ip route con
C 10.30.21.0/30 is directly connected, FastEthernet0/1
C 192.168.100.0/24 is directly connected, FastEthernet0/0
HQ(config-router)#network 10.30.21.0 0.0.0.3 area 0
HQ(config-router)#network 192.168.100.0 0.0.0.255 area 2
HQ(config-router)#
ISP(config)#router ospf 2
ISP(config-router)#do show ip route con
C 192.168.100.0/24 is directly connected, FastEthernet0/0
ISP(config-router)#network 192.168.100.0 0.0.0.255 area 2
ISP(config-router)#exit
ISP(config)#
ISP(config)#router ospf 2
ISP(config-router)#do show ip route con
C 172.16.100.0/24 is directly connected, FastEthernet0/1
C 192.168.100.0/24 is directly connected, FastEthernet0/0
ISP(config-router)#network 172.16.100.0 0.0.0.255 area 2
ISP(config-router)#exit
ISP(config)#
SW3(config)#interface range fastEthernet 0/15 - 18
SW3(config-if-range)#switchport mode access
SW3(config-if-range)#switchport access vlan 30
SW3(config-if-range)#exit
SW3(config)#spanning-tree vlan 99
SW3(config)#spanning-tree vlan 99 priority 4096
SW3(config)#
SW1(config)#spanning-tree vlan 10,20,30,99 priority 4096
SW1(config)#
SW3(config)#
SW3#show spanning-tree vlan 99
VLAN0099
Spanning tree enabled protocol ieee
Root ID Priority 32867
Address 0004.9AB4.B9EE
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32867 (priority 32768 sys-id-ext 99)
Address 0004.9AB4.B9EE
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
Comment