2020年10月24日 星期六

跨Switch的Inter-VLAN Routing及靜態路由設定

 SwitchInter-VLAN Routing及靜態路由設定

設備 : Extreme X440

 


PC1~PC8的設定值

名稱

IP Address

Net Mask

Gateway

屬於哪一個VLAN

PC1

192.168.50.1

/24

192.168.50.254

10

PC2

192.168.51.1

/24

192.168.51.254

20

PC3

192.168.52.1

/24

192.168.52.254

30

PC4

192.168.53.1

/24

192.168.53.254

40

PC5

192.168.54.1

/24

192.168.54.254

50

PC6

192.168.55.1

/24

192.168.55.254

60

PC7

192.168.56.1

/24

192.168.56.254

70

PC8

192.168.57.1

/24

192.168.57.254

80

 

R1的設定:

PCVLAN的配置

說明

create vlan vlan10 tag 10

configure vlan vlan10 add ports 1

configure vlan vlan10 ipaddress 192.168.50.254/24

設定VLAN 10及其Port、介面IP,並且連接至PC1的網卡

create vlan vlan20 tag 20

configure vlan vlan20 add ports 2

configure vlan vlan20 ipaddress 192.168.51.254/24

設定VLAN 20及其Port、介面IP,並且連接至PC2的網卡

Inter-VLAN Routing設定

 

enable ipforwarding vlan10

enable ipforwarding vlan20

 

Switch間的VLAN設定

 

create vlan vlan11 tag 11

configure vlan vlan11 add ports 24

configure vlan vlan11 ipaddress 192.168.49.1/30

連接至R2間的VLAN設定

啟動Switch間的Inter-VLAN Routing

 

enable ipforwarding vlan11

R2 Inter-VLAN Routing

設定至未知網域的靜態路由

 

configure iproute add 192.168.52.0/24 192.168.49.2

configure iproute add 192.168.53.0/24 192.168.49.2

R2PC1PC2兩個區域網路

configure iproute add 192.168.54.0/24 192.168.49.2

configure iproute add 192.168.55.0/24 192.168.49.2

R3PC5PC6兩個區域網路

configure iproute add 192.168.56.0/24 192.168.49.2

configure iproute add 192.168.57.0/24 192.168.49.2

R4PC7PC8兩個區域網路

configure iproute add 192.168.49.4/30 192.168.49.2

未知SwitchVLAN區域(192.168.49.4/30)

configure iproute add 192.168.49.8/30 192.168.49.2

未知SwitchVLAN區域(192.168.49.8/30)

 

R2的設定:

PCVLAN的配置

說明

create vlan vlan30 tag 30

configure vlan vlan30 add ports 1

configure vlan vlan30 ipaddress 192.168.52.254/24

設定VLAN 30及其Port、介面IP,並且連接至PC3的網卡

create vlan vlan40 tag 40

configure vlan vlan40 add ports 2

configure vlan vlan40 ipaddress 192.168.53.254/24

設定VLAN 40及其Port、介面IP,並且連接至PC4的網卡

Inter-VLAN Routing設定

 

enable ipforwarding vlan30

enable ipforwarding vlan40

 

Switch間的VLAN設定

 

create vlan vlan11 tag 11

configure vlan vlan11 add ports 24

configure vlan vlan11 ipaddress 192.168.49.2/30

連接至R1間的VLAN設定

create vlan vlan12 tag 12

configure vlan vlan12 add ports 23

configure vlan vlan12 ipaddress 192.168.49.5/30

連接至R3間的VLAN設定

啟動Switch間的Inter-VLAN Routing

 

enable ipforwarding vlan11

R1 Inter-VLAN Routing

enable ipforwarding vlan12

R3 Inter-VLAN Routing

設定至未知網域的靜態路由

 

configure iproute add 192.168.50.0/24 192.168.49.1

configure iproute add 192.168.51.0/24 192.168.49.1

R1PC1PC2兩個區域網路

configure iproute add 192.168.54.0/24 192.168.49.6

configure iproute add 192.168.55.0/24 192.168.49.6

R3PC5PC6兩個區域網路

configure iproute add 192.168.56.0/24 192.168.49.6

configure iproute add 192.168.57.0/24 192.168.49.6

R4PC7PC8兩個區域網路

configure iproute add 192.168.49.8/30 192.168.49.6

未知SwitchVLAN區域 (192.168.49.8/30)

 

R3的設定:

PCVLAN的配置

說明

create vlan vlan50 tag 50

configure vlan vlan50 add ports 1

configure vlan vlan50 ipaddress 192.168.54.254/24

設定VLAN 50及其Port、介面IP,並且連接至PC5的網卡

create vlan vlan60 tag 60

configure vlan vlan60 add ports 2

configure vlan vlan60 ipaddress 192.168.55.254/24

設定VLAN 60及其Port、介面IP,並且連接至PC6的網卡

Inter-VLAN Routing設定

 

enable ipforwarding vlan50

enable ipforwarding vlan60

 

Switch間的VLAN設定

 

create vlan vlan12 tag 12

configure vlan vlan12 add ports 24

configure vlan vlan12 ipaddress 192.168.49.6/30

連接至R1間的VLAN設定

create vlan vlan13 tag 13

configure vlan vlan13 add ports 23

configure vlan vlan13 ipaddress 192.168.49.9/30

連接至R3間的VLAN設定

啟動Switch間的Inter-VLAN Routing

 

enable ipforwarding vlan12

R2 Inter-VLAN Routing

enable ipforwarding vlan13

R4 Inter-VLAN Routing

設定至未知網域的靜態路由

 

configure iproute add 192.168.50.0/24 192.168.49.5

configure iproute add 192.168.51.0/24 192.168.49.5

R1PC1PC2兩個區域網路

configure iproute add 192.168.54.0/24 192.168.49.5

configure iproute add 192.168.55.0/24 192.168.49.5

R2PC3PC4兩個區域網路

configure iproute add 192.168.56.0/24 192.168.49.10

configure iproute add 192.168.57.0/24 192.168.49.10

R4PC7PC8兩個區域網路

configure iproute add 192.168.49.0/30 192.168.49.5

未知SwitchVLAN區域 (192.168.49.0/30)

 

R4的設定:

PCVLAN的配置

說明

create vlan vlan70 tag 70

configure vlan vlan70 add ports 1

configure vlan vlan70 ipaddress 192.168.56.254/24

設定VLAN 70及其Port、介面IP,並且連接至PC7的網卡

create vlan vlan80 tag 80

configure vlan vlan80 add ports 2

configure vlan vlan80 ipaddress 192.168.57.254/24

設定VLAN 80及其Port、介面IP,並且連接至PC8的網卡

Inter-VLAN Routing設定

 

enable ipforwarding vlan70

enable ipforwarding vlan80

 

Switch間的VLAN設定

 

create vlan vlan13 tag 13

configure vlan vlan13 add ports 24

configure vlan vlan13 ipaddress 192.168.49.9/30

連接至R3間的VLAN設定

啟動Switch間的Inter-VLAN Routing

 

enable ipforwarding vlan13

R3 Inter-VLAN Routing

設定至未知網域的靜態路由

 

configure iproute add 192.168.50.0/24 192.168.49.9

configure iproute add 192.168.51.0/24 192.168.49.9

R1PC1PC2兩個區域網路

configure iproute add 192.168.52.0/24 192.168.49.9

configure iproute add 192.168.53.0/24 192.168.49.9

R2PC5PC6兩個區域網路

configure iproute add 192.168.54.0/24 192.168.49.9

configure iproute add 192.168.55.0/24 192.168.49.9

R3PC5PC6兩個區域網路

configure iproute add 192.168.49.0/30 192.168.49.6

未知SwitchVLAN區域 (192.168.49.0/30)

configure iproute add 192.168.49.4/30 192.168.49.6

未知SwitchVLAN區域 (192.168.49.4/30)

 

測試結果 : PC皆能互Ping成功