Cisco – How to connect to external server using router from VLAN’s

ciscolocal-area-networknetworkingroutervlan

I am newbie. I am trying to build network system in Packet Tracer.

Now I have such network layout.

enter image description here

I have different VLAN's Accounting and Sales. I have configured this using subinterface in router to allow computers from different vlan's communicate with each other. Everything works.

Let's assume that there are next subnets and VLAN's. Acct. VLAN (2) (ip's 172.168.0.1-172.168.0.254/24) and Sales VLAN (4) (ip's 172.168.1.1-172.168.1.254/24).

But I need to connect all this computers to the external server. That has ip , for instance 192.168.20.13/24. Like this.

enter image description here

I don't know hot to correctly configure router to make it possible for computers to connect to this server. I have connected switch to the another router interface. And than connected server to the switch and specified ip 192.168.20.13/24. Than I tried to set ip to the router interface from the same subnet like 192.168.20.22/24. So now router can communicate with server.

But how to allow computers to communicate with the server. Please help. I am newbie.

I would be grateful for any help.

Best Answer

First let me start out by adding just a bit of info. It looks like you intend all IPs to be private network addresses. The IPs that start with 172 must belong to 172.16.x.x - 172.31.x.x for them to be considered private. Since this is just a packet tracer lab, this doesn't really matter.

Some of the commands I am entering might be unnecessary if you don't have any opposing configs, but they wont hurt.

That being said, for simplicity I am going to assume the IPs for each of the workstations and server are hard coded. Since nothing was specified, my example is going to assign the following IPs: *Top ACCT VLAN PC: 172.168.0.10/24 *Bottom ACCT VLAN PC: 172.168.0.20/24 *Top SALES VLAN PC: 172.168.1.10/24 *Bottom SALES VLAN PC: 172.168.1.20/24 *Server: 192.168.20.13/24 *Router Top interface 0/0.2: 172.168.0.1/24 (used for ACCT VLAN 2) *Router Top interface 0/0.4: 172.168.1.1/24 (used for SALES VLAN 4) *Router Bottom interface 0/1: 192.168.20.1/24

As mentioned in the comments, make sure the computers and servers have a default gateway set. the default gateway should be the interface or subinterface of the router that the vlan or network connects to.

First thing you need to do on the switches is specify the various VLAN and trunk info. I do this with the following using my example info. Top switch: *Port 0/1 will be the trunk to the middle switch *Port 0/10 will be an access port assigned to ACCT VLAN 2, used by top ACCT PC *Port 0/11 will be an access port assigned to SALES VLAN 4, used by top SALES PC

Middle switch: *Port 0/1 will be the trunk to the top switch *Port 0/2 will be the trunk to the router *Port 0/10 will be an access port assigned to ACCT VLAN 2, used by bottom ACCT PC *Port 0/11 will be an access port assigned to SALES VLAN 4, used by bottom SALES PC

On the top switch, starting from global config mode, the commands would be: vlan 2 name ACCT vlan 4 name SALES exit int fa0/1 switchport mode trunk switchport trunk allowed vlan all int fa0/10 switchport mode access switchport access vlan 2 int fa0/11 switchport mode access switchport access vlan 4

On the bottom switch, starting from global config mode, the commands would be: vlan 2 name ACCT vlan 4 name SALES exit int fa0/1 switchport mode trunk switchport trunk allowed vlan all int fa0/2 switchport mode trunk switchport trunk allowed vlan all int fa0/10 switchport mode access switchport access vlan 2 int fa0/11 switchport mode access switchport access vlan 4

On the router you need to configure the subinterfaces with dot1q encapsulation, set to the particular VLAN. Then set those subinterface IPs and do a NO SHUTDOWN on the physical interface. commands would be, starting from the global configuration mode: int fa0/0.2 no shutdown encapsulation dot1Q 2 ip address 172.168.0.1 255.255.255.0 int fa0/0.4 no shutdown encapsulation dot1Q 4 ip address 172.168.1.1 255.255.255.0 int fa0/0 no shutdown int fa0/1 no shutdown ip address 192.168.20.1 255.255.255.0

Since you do not have multiple routers, you wont have to worry about enabling routing protocols or manually adding static routes in order to achieve connectivity. If you are still having issues I could probably throw this example together in packet tracer fairly quickly.

Hope this helps!