Jump to content

How to do static routing with connecting router with switch?

GamerGry123

I was doing static routing on the routers and it worked fine.

 

I did it like this:

On router 1, I assigned the address and mask to the fastethernet interface the same on the 2nd router.

Then with the ip route command I showed to which network the packet should go and through which interface.

And it even worked as I was plugging in computers and one computer was pinging the other and it worked.

 

With commands it looked like this:

 

Router1:
Conf t
intterface fastethernet 0/0
ip address 10.10.10.1 255.255.255.0
sh
no sh
exit

 

PC1 which is connected to the router 1

ip 10.10.10.2/24/ 10.10.10.1

 

Conf t
intterface fastethernet 0/1
ip address 20.20.20.1 255.255.255.0
sh
no sh
exit

 

Router2

Conf t
intterface fastethernet 0/1
ip address 20.20.20.2 255.255.255.0
sh
no sh
exit

 

Conf t
intterface fastethernet 0/0
ip address 30.30.30.1 255.255.255.0
sh
no sh
exit

 

PC2 which is connected to the router 2

ip 30.30.30.2/24 30.30.30.1

 

Now the routing itself:

Router1:

conf t

ip route 30.30.30.0 255.255.255.0 20.20.20.2

 

30.30.30.0 it shows which network we want to have access to, 20.20.20.2 through which interface

 

Router2:

Router1:

conf t

ip route 10.10.10.0 255.255.255.0 20.20.20.1

 

10.10.10.0 it shows which network we want to have access to, 20.20.20.1 through which interface

 

 

 

Now how to do with switches?

I heard that you need to make a vlan on the switch, then make a virtual interface on the switch or router on the router, add a vlan to it and assign an address and check if there is a ping between the switch and the router.

 

I think it is done with these commands:

conf t
interface fastethernet 0/0.1

encapsulation dot1Q 10 

ip ad 10.10.10.1 255.255.255.0

sh

no sh

exit

 

 

I was looking for information on the internet, but that's just what I found.

In general, there is much less information from the Internet on the Internet, a lot of them, when you search, they show the ones that were shown 10 years ago. So that is why I would ask for a more detailed explanation of how it is done to make him understand it.

 

 

 

1.png

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, GamerGry123 said:

Now how to do with switches?

I heard that you need to make a vlan on the switch, then make a virtual interface on the switch or router on the router, add a vlan to it and assign an address and check if there is a ping between the switch and the router.

1.cisco has absolutely great documentation regarding everything cisco, be sure to check it out on their website.

 

so, the switch has a default vlan, vlan 1.

and on the switch you go into interface vlan 1 and give it an IP (this is so that the multilayer switch(mls) can act as the gateway for the network)

as with the link between the router and multilayer switch, you need to switch that port(L2) into an interface(L3) using the command #no switchport

 

for the config you'd use on the mls

conf t

ip routing         #to enable the router function on mls

int f1/0

no switchport       #switching to L3 port that can have an IP

ip add whatever you'll use

no sh

exit

int vlan 1

ip add the IP you want for the internal network

no sh       #vlan 1 unlike all virtual interfaces is off be default

ip route whatever whatever

Link to comment
Share on other sites

Link to post
Share on other sites

18 hours ago, Nuh_ said:

1.cisco has absolutely great documentation regarding everything cisco, be sure to check it out on their website.

 

so, the switch has a default vlan, vlan 1.

and on the switch you go into interface vlan 1 and give it an IP (this is so that the multilayer switch(mls) can act as the gateway for the network)

as with the link between the router and multilayer switch, you need to switch that port(L2) into an interface(L3) using the command #no switchport

 

for the config you'd use on the mls

conf t

ip routing         #to enable the router function on mls

int f1/0

no switchport       #switching to L3 port that can have an IP

ip add whatever you'll use

no sh

exit

int vlan 1

ip add the IP you want for the internal network

no sh       #vlan 1 unlike all virtual interfaces is off be default

ip route whatever whatever

You mean that you need to add to the switch port that is port 1/0 ip address?

So I created a vlan on the switch, I added port 1/0 to trunk, then I added vlan to this trunk and added the address to vlan ip. The order does not matter?

 

Then I turned on port 0/0 on the router.
conf t
interface fastethernet 0/0
sh
no sh

 

Then I made a 0 / 0.1 virtual interface and assigned a vlan to it that is on the switch, then I assigned an address to this interface and a ping section between the router and the switch. But routing still needs to be done. Tell me is it well done?

 

Router:

conf t

interface fastethernet 0/0 

sh

no sh

 

conf t

interface fastethernet 0/0.1

encapsulation dot1Q 10 

ip ad 10.10.10.1 255.255.255.0

sh 

no sh

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, GamerGry123 said:

You mean that you need to add to the switch port that is port 1/0 ip address?

So I created a vlan on the switch, I added port 1/0 to trunk, then I added vlan to this trunk and added the address to vlan ip. The order does not matter?

 

Then I turned on port 0/0 on the router.
conf t
interface fastethernet 0/0
sh
no sh

 

Then I made a 0 / 0.1 virtual interface and assigned a vlan to it that is on the switch, then I assigned an address to this interface and a ping section between the router and the switch. But routing still needs to be done. Tell me is it well done?

 

Router:

conf t

interface fastethernet 0/0 

sh

no sh

 

conf t

interface fastethernet 0/0.1

encapsulation dot1Q 10 

ip ad 10.10.10.1 255.255.255.0

sh 

no sh

 

noooo, big wrong. you don't need trunks or sub interfaces in this case, because you have a multilayer switch; that's a  switch that also works as a router.

you configure the gateway for each network on the vlan interface and that's basically it (other than routing).

 

then you'd just tell the multilayer switch to change f0/1 to a router interface and give it an ip.

Link to comment
Share on other sites

Link to post
Share on other sites

This feels like a design question rather than a configuration question.

 

You first need to figure out how you want the network to look. Then we can help you with the configuration.

 

Did you intend to use L3 switches or was that a mistake?

If you want to use L3 switches, do you want to use routed ports or do you want to use VLANs?

If you want to use VLANs, where do you want the routing to be done?

 

A lot of questions you are asking can be answered with "it depends".

Link to comment
Share on other sites

Link to post
Share on other sites

22.04.2022 o 11:59 LAwLz powiedział:

Aby zostać utworzonym pytaniem projektowym, niekonfiguracyjnym.

 

Życie musisz dowiedzieć się, jak ma się tworzyć. W miarę trudności w konfiguracji.

 

Czy zamierzałeś wejść na l3, czy to był błąd?

Jeśli chcesz chcesz aby L3, czy chcesz korzystać z routowanych, chcesz korzystać z sieci VLAN?

Jeśli chcesz korzystać z sieci VLAN, gdzie chcesz chcesz wyznaczać trasy?

 

Na pytaniach, które zadajesz, można wiele zestawów, zależy od”.

Now, how did I make the computers connected to the switches send packets to each other?

 

Chcę użyć przełącznika L3, czyli Etherswitcha, który może działać jak router, prawda?

Porty routowane, nie do końca wiem co to jest. Domyślam się, że to ten sam port co w routerze gdzie nie ma przypisanego do niego vlana?

 

I want to do 3 VLANS on each Switch.

VLANS from one switch is to send packets to the other switch which also has VLANS.

 

I will show it in the photo.

 

On switch1 it is done:

First, I set the switch port 1/0 to trunk mode.

So that the vlan can run through one cable.

 

3 vlans:

VLAN10

VLAN20

VLAN30

 

Each vlan is assigned a masked IP address

VLAN10 

address10.10.10.2 255.255.255.0 

 

VLAN20

address 20.20.20.2 255.255.255.0

 

VLAN30

address 30.30.30.2 255.255.255.0 

 

 

On the second switch I did the same, only vlan is called innej:

VLAN100

address 100.100.100.2 255.255.255.0

 

VLAN200

address 200.200.200.2 255.255.255.0

 

VLAN250

address 210.210.210.210.2 255.255.255.0

 

On router 1, I made a virtual interface fastethernet 0 / 0.1

It is 0 / 0.1 because switch1 is connected to router port 0/0 if router port would be 0/1 which would be connected to switch the virtual interface would also be 0 / .1.1.

 

Then I added vlan 10 to this virtual interface with the command:
encapsulation dot1Q 10

Next, I added an address to this virtual interface
10.10.10.1 255.255.255.0

 

Ping was working between the router and the switch.

 

I did the same two more virtual interfaces 0 / 0.2 and 0 / 0.3 and also added to the other two vlans, i.e. vlan20 vlan30.

 

The same is done on the second switch, only the IP addresses are different.

In the picture I showed that ping works.

 

On router 1 on port 0/1 I set the address 40.40.40.2 255.255.255.0

On the second router, the same address is 40.40.40.2 255.255.255.0

 

Now to ping from switch to switch 2 and vice versa to do routing.

With the ip route command, I wrote on the router1 to which address the packet has enough, i.e. 100.100.100.0 and take which port, enter the address of this port, i.e. 40.40.40.2

conf t
ip route 100.100.100.0 255.255.255.0 40.40.40.2

 

On the second router, just a different address and through a different port

conf t
ip route 10.10.10.0 255.255.255.0 40.40.40.1

 

I did the same with others by giving other addresses to other vlans.

 

Now how to make the connected computer to switch1 send packets to computer 2 which is connected to switch2?

 

image.png

image.png

image.png

Link to comment
Share on other sites

Link to post
Share on other sites

This sounds like a routing problem caused by a misunderstanding of how VLANs work.

 

VLANs are a layer 2 technology. Routing, which is what you are doing here, is a layer 3 technology.

Once a packet reaches a router, the VLAN tag is stripped off. Interface f1/0 on Switch ESW1 should not be a trunk if you are routing VLANs 10, 20 and 30 on the switch itself. 

Interface f0/0 should not be divided into sub-interfaces on R1 either, since it will not use VLANs. Traffic from the switch to the router will not have any VLAN tag if both ports are routed.

 

 

 

 

4 hours ago, GamerGry123 said:

Chcę użyć przełącznika L3, czyli Etherswitcha, który może działać jak router, prawda?

Porty routowane, nie do końca wiem co to jest. Domyślam się, że to ten sam port co w routerze gdzie nie ma przypisanego do niego vlana?

I don't speak Polish so I've had to use Google translate here.

Quote

"I want to use an L3 switch which is an Etherswitch that can act like a router right?"

Yes, a L3 switch can act as a router. A L3 switch can act like a regular L2 switch. It can act like a router (by using "routed ports", by typing in the "no switchport" command) and it can use what's called an "SVI", which is a logical interface that belongs to a particular VLAN.

 

Quote

Routed ports, I'm not sure what it is. My guess is that this is the same port as in the router where there is no vlan assigned to it?

A routed port is a port that has an IP address assigned directly to it. Routers only have routed ports. L3 switches can have routed ports, but they can also have "SVI"s.

So yes, a routed port on a L3 switch is the same as a regular port on a router.

 

 

 

4 hours ago, GamerGry123 said:

I want to do 3 VLANS on each Switch.

Do you want these three VLANs to be routed on the switch, or on the router?

In other words, which device is going to have the default gateway address that belongs to these VLANs? Is it going to be the router, or the L3 switch?

 

 

I have attached a file to this post where I have configured a network the way I think you want it to work.

 

Everything in this network can ping everyone else.

 

For-GamerGry123-From-LAwLz.pkt

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, LAwLz said:

This sounds like a routing problem caused by a misunderstanding of how VLANs work.

 

VLANs are a layer 2 technology. Routing, which is what you are doing here, is a layer 3 technology.

Once a packet reaches a router, the VLAN tag is stripped off. Interface f1/0 on Switch ESW1 should not be a trunk if you are routing VLANs 10, 20 and 30 on the switch itself. 

Interface f0/0 should not be divided into sub-interfaces on R1 either, since it will not use VLANs. Traffic from the switch to the router will not have any VLAN tag if both ports are routed.

 

 

 

 

Nie mówię po polsku, więc musiałem tutaj skorzystać z Tłumacza Google.

Tak, przełącznik L3 może działać jako router. Przełącznik L3 może działać jak zwykły przełącznik L2. Może działać jak router (używając „portów routowanych”, wpisując polecenie „no switchport”) i może używać tak zwanego „SVI”, który jest interfejsem logicznym należącym do określonej sieci VLAN.

 

Port routowany to port, do którego bezpośrednio przypisany jest adres IP. Routery mają tylko porty routowane. Przełączniki L3 mogą mieć porty routowane, ale mogą też mieć porty „SVI”.

A więc tak, routowany port w przełączniku L3 jest taki sam, jak zwykły port w routerze.

 

 

 

Czy chcesz, aby te trzy sieci VLAN były routowane na przełączniku, czy na routerze?

Innymi słowy, które urządzenie będzie miało domyślny adres bramy należący do tych sieci VLAN? Czy to będzie router, czy przełącznik L3?

 

 

Załączyłem plik do tego postu, w którym skonfigurowałem sieć tak , jak myślę , że chcesz, aby działała.

 

Wszystko w tej sieci może pingować wszystkich innych.

 

For-GamerGry123-From-LAwLz.pkt 53,1 kB · 0 pobrań

I want vlans to be on the switch and ping vlans on the other switch through these two routers.

 

You write that it is wrongly done.

 

That's the way we did it at school, when we made this virtual interface at school, we also said that it shouldn't be done, but they did it to show how this virtual switch works.

Link to comment
Share on other sites

Link to post
Share on other sites

39 minutes ago, LAwLz said:

This sounds like a routing problem caused by a misunderstanding of how VLANs work.

 

VLANs are a layer 2 technology. Routing, which is what you are doing here, is a layer 3 technology.

Once a packet reaches a router, the VLAN tag is stripped off. Interface f1/0 on Switch ESW1 should not be a trunk if you are routing VLANs 10, 20 and 30 on the switch itself. 

Interface f0/0 should not be divided into sub-interfaces on R1 either, since it will not use VLANs. Traffic from the switch to the router will not have any VLAN tag if both ports are routed.

 

 

 

 

I don't speak Polish so I've had to use Google translate here.

Yes, a L3 switch can act as a router. A L3 switch can act like a regular L2 switch. It can act like a router (by using "routed ports", by typing in the "no switchport" command) and it can use what's called an "SVI", which is a logical interface that belongs to a particular VLAN.

 

A routed port is a port that has an IP address assigned directly to it. Routers only have routed ports. L3 switches can have routed ports, but they can also have "SVI"s.

So yes, a routed port on a L3 switch is the same as a regular port on a router.

 

 

 

Do you want these three VLANs to be routed on the switch, or on the router?

In other words, which device is going to have the default gateway address that belongs to these VLANs? Is it going to be the router, or the L3 switch?

 

 

I have attached a file to this post where I have configured a network the way I think you want it to work.

 

Everything in this network can ping everyone else.

 

For-GamerGry123-From-LAwLz.pkt 53.1 kB · 1 download

Thanks for doing it and showing it on an example. But I did it in GNS3 and there are some different commands there.

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, GamerGry123 said:

Thanks for doing it and showing it on an example. But I did it in GNS3 and there are some different commands there.

Oh okay.

Do you not have access to Packet tracer? I can post the running-config if you want.

 

 

The IOS version in Packet Tracer is really old so that's probably why some commands are slightly different compared to GNS3.

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, GamerGry123 said:

I want vlans to be on the switch and ping vlans on the other switch through these two routers.

 

You write that it is wrongly done.

 

That's the way we did it at school, when we made this virtual interface at school, we also said that it shouldn't be done, but they did it to show how this virtual switch works.

It depends on what you mean by "ping vlans on the other switch through these two routers".

You can definitely make a computer on VLAN 10 on switch 1 reach a computer on VLAN 100 on switch 2. But it is important to understand that the VLAN information will not carry over once it passes through a device that routes the traffic. I suspect that you have misunderstood this part since you configured the port between the switch and router as a trunk connected to sub-interfaces.

 

The way I configured it, with a regular routed link between the switch and the router, is the "more correct" way of doing it.

 

You could get it working with sub-interfaces and a trunk as well if you want, but it will be very weird and confusing for no reason, from a design perspective.

 

Again, I feel a bit confused as to what you are trying to achieve and why. That makes it hard to help you.

Link to comment
Share on other sites

Link to post
Share on other sites

45 minutes ago, LAwLz said:

Zależy to od tego, co masz na myśli, mówiąc „ping vlans na drugim przełączniku przez te dwa routery”.

Zdecydowanie można sprawić, by komputer w sieci VLAN 10 na przełączniku 1 dotarł do komputera w sieci VLAN 100 na przełączniku 2. Należy jednak pamiętać, że informacje o sieci VLAN nie zostaną przeniesione, gdy przejdą przez urządzenie, które kieruje ruchem. Podejrzewam, że źle zrozumiałeś tę część, ponieważ skonfigurowałeś port między przełącznikiem a routerem jako łącze trunkingowe połączone z podinterfejsami.

 

Sposób, w jaki to skonfigurowałem, ze zwykłym łączem między przełącznikiem a routerem, jest „bardziej poprawnym” sposobem wykonania tego.

 

Możesz sprawić, by działał z pod-interfejsami i bagażnikiem, jeśli chcesz, ale będzie to bardzo dziwne i mylące bez powodu, z perspektywy projektowania.

 

Znowu czuję się trochę zdezorientowany co do tego, co próbujesz osiągnąć i dlaczego. To sprawia, że trudno ci pomóc.

Since you sent it with Cisco Packet Tracer, I know how it should look good.

But I don't know how to do the same in GNS3 because the commands are different for the same things.

 

But first, I would like to do the same as in school, I know that you do not do that, but how would you be able to connect the computer to ESW1 at all and that it would ping the computer that is connected to ESW2?

Link to comment
Share on other sites

Link to post
Share on other sites

48 minutes ago, LAwLz said:

Zależy to od tego, co masz na myśli, mówiąc „ping vlans na drugim przełączniku przez te dwa routery”.

Zdecydowanie można sprawić, by komputer w sieci VLAN 10 na przełączniku 1 dotarł do komputera w sieci VLAN 100 na przełączniku 2. Należy jednak pamiętać, że informacje o sieci VLAN nie zostaną przeniesione, gdy przejdą przez urządzenie, które kieruje ruchem. Podejrzewam, że źle zrozumiałeś tę część, ponieważ skonfigurowałeś port między przełącznikiem a routerem jako łącze trunkingowe połączone z podinterfejsami.

 

Sposób, w jaki to skonfigurowałem, ze zwykłym łączem między przełącznikiem a routerem, jest „bardziej poprawnym” sposobem wykonania tego.

 

Możesz sprawić, by działał z pod-interfejsami i bagażnikiem, jeśli chcesz, ale będzie to bardzo dziwne i mylące bez powodu, z perspektywy projektowania.

 

Znowu czuję się trochę zdezorientowany co do tego, co próbujesz osiągnąć i dlaczego. To sprawia, że trudno ci pomóc.

I did it so that I connected the computer to ESW1 to port 1/1 and I added this port to the trunk and I assigned the address 10.10.10.3 255.255.255.0 to the computer so that it was in the same network as VLAN10 but it did not work, even ping did not work to switch1, i.e. to ESW1.

 

I don't know how to do it, could you write down how to do it?

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, GamerGry123 said:

But I don't know how to do the same in GNS3 because the commands are different for the same things.

Which commands are different?

I am fairly sure the important commands are the same even in newer versions of IOS.

 

 

21 minutes ago, GamerGry123 said:

But first, I would like to do the same as in school, I know that you do not do that, but how would you be able to connect the computer to ESW1 at all and that it would ping the computer that is connected to ESW2?

I am not sure how you did it at school though, so I can't really help you with that.

Do you mean with a trunk on the L3 switch and sub-interfaces on the router? If you do it that way, you don't really want to do routing on the switch. You should keep it as a layer 2 switch in that case. 

 

 

19 minutes ago, GamerGry123 said:

I did it so that I connected the computer to ESW1 to port 1/1 and I added this port to the trunk and I assigned the address 10.10.10.3 255.255.255.0 to the computer so that it was in the same network as VLAN10 but it did not work, even ping did not work to switch1, i.e. to ESW1.

By "added this port to the trunk", do you mean you configured the port as a trunk port? 

If that's what you mean then that's why it doesn't work. When an untagged packet arrives at a trunk, it will assume the traffic belongs to the native VLAN. My guess is that the native VLAN on your trunk port is VLAN 1. If it is, then it won't pass traffic between that port and VLAN 10 since they are not in the same VLAN. Unless it is being routed somewhere of course.

 

 

Edit:

I think I understand what has happened now.

Did you say you configured this at school and got it working? If so, I think I can explain why. 

 

I have attached an updated version of the config, that is configured how I think you did it at school.

I removed the other router for clarity, since it is not really involved in this part.

What I think you have done is create a sub-interface for VLAN 1 on the router. Then you created a trunk on the switch and connected a computer to that. Since the native VLAN on the trunk is 1, it will assume the traffic from the PC belongs to VLAN 1 and send it to the router. From there the router sends the traffic back to the switch and it routes it to the other VLANs.

For-GamerGry123-From-LAwLz_v2.pkt

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, LAwLz said:

Jakie polecenia są różne?

Jestem prawie pewien, że ważne polecenia są takie same nawet w nowszych wersjach IOS.

 

 

Nie jestem jednak pewien, jak to zrobiłeś w szkole, więc nie mogę ci w tym naprawdę pomóc.

Masz na myśli z trunkiem na przełączniku L3 i pod-interfejsami na routerze? Jeśli zrobisz to w ten sposób, tak naprawdę nie chcesz robić routingu na przełączniku. W takim przypadku należy zachować go jako przełącznik warstwy 2. 

 

 

Czy mówiąc „dodano ten port do trunka” masz na myśli, że skonfigurowałeś port jako port trunk? 

Jeśli to masz na myśli, to dlatego to nie działa. Gdy nieoznakowany pakiet dociera do łącza, zakłada, że ruch należy do natywnej sieci VLAN. Domyślam się, że natywna sieć VLAN na twoim porcie trunkingu to VLAN 1. Jeśli tak jest, nie będzie przekazywać ruchu między tym portem a VLAN 10, ponieważ nie znajdują się one w tej samej sieci VLAN. Chyba że jest gdzieś kierowany, oczywiście.

This is how the port is configured as trunk.
You write that you do not know how I did you have the GNS3 program, if you want I can send you the file as you sent me and you will be able to see how it is done.

 

I already know why ping does not work between computers that are connected to swichs.

 

So you can do routing on the switch or keep it how to switch L2? So there are two ways?

 

Just like at school, I was dealing with these VLANs on switchas and under interfaces on the router. Another port 1/0 on ESW1 was a runk to make the ping work to the router. If it wasn't set as trunk, then pinging didn't even work. So how VLAN10 has the address 10.10.10.2 255.255.255.0, as I typed ping 10.10.10.2 to myself, it didn't even work, that's why this port works as a trunk.

 

Would you show me both how to do it? I would like to know.

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, LAwLz said:

Which commands are different?

I am fairly sure the important commands are the same even in newer versions of IOS.

 

 

I am not sure how you did it at school though, so I can't really help you with that.

Do you mean with a trunk on the L3 switch and sub-interfaces on the router? If you do it that way, you don't really want to do routing on the switch. You should keep it as a layer 2 switch in that case. 

 

 

By "added this port to the trunk", do you mean you configured the port as a trunk port? 

If that's what you mean then that's why it doesn't work. When an untagged packet arrives at a trunk, it will assume the traffic belongs to the native VLAN. My guess is that the native VLAN on your trunk port is VLAN 1. If it is, then it won't pass traffic between that port and VLAN 10 since they are not in the same VLAN. Unless it is being routed somewhere of course.

 

 

Edit:

I think I understand what has happened now.

Did you say you configured this at school and got it working? If so, I think I can explain why. 

 

I have attached an updated version of the config, that is configured how I think you did it at school.

How would you answer, I am asking out of curiosity. Are you working in the field of network computing?
How did you learn it? How come, because there is not much about networks on the Internet, most of the films are from 10 years ago.
Is what we do in school up-to-date are you using it somewhere right now?

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, LAwLz said:

Jakie polecenia są różne?

Jestem prawie pewien, że ważne polecenia są takie same nawet w nowszych wersjach IOS.

 

 

Nie jestem jednak pewien, jak to zrobiłeś w szkole, więc nie mogę ci w tym naprawdę pomóc.

Masz na myśli z trunkiem na przełączniku L3 i pod-interfejsami na routerze? Jeśli zrobisz to w ten sposób, tak naprawdę nie chcesz robić routingu na przełączniku. W takim przypadku należy zachować go jako przełącznik warstwy 2. 

 

 

Czy mówiąc „dodano ten port do trunka” masz na myśli, że skonfigurowałeś port jako port trunk? 

Jeśli to masz na myśli, to dlatego to nie działa. Gdy nieoznakowany pakiet dociera do łącza, zakłada, że ruch należy do natywnej sieci VLAN. Domyślam się, że natywna sieć VLAN na twoim porcie trunkingu to VLAN 1. Jeśli tak jest, nie będzie przekazywać ruchu między tym portem a VLAN 10, ponieważ nie znajdują się one w tej samej sieci VLAN. Chyba że jest gdzieś kierowany, oczywiście.

 

 

Edytować:

Chyba rozumiem, co się teraz stało.

Mówiłeś, że skonfigurowałeś to w szkole i uruchomiłeś? Jeśli tak, myślę, że mogę wyjaśnić dlaczego. 

 

Załączam zaktualizowaną wersję konfiguracji, która jest skonfigurowana tak, jak myślę, że zrobiłeś to w szkole.

Usunąłem drugi router dla jasności, ponieważ tak naprawdę nie jest zaangażowany w tę część.

Myślę, że stworzyłeś pod-interfejs dla VLAN 1 na routerze. Następnie utworzyłeś trunk na przełączniku i podłączyłeś do niego komputer. Ponieważ natywna sieć VLAN na magistrali to 1, przyjmie, że ruch z komputera należy do sieci VLAN 1 i wyśle go do routera. Stamtąd router wysyła ruch z powrotem do przełącznika i kieruje go do innych sieci VLAN.

For-GamerGry123-Od-LAwLz_v2.pkt 47,34 kB · 0 pobrań

How to make the switch work in L3 mode?
It can be done so that it works in L2 and L3, I need it so that I can create a VLANY and give the IP address to port 1/0.

Link to comment
Share on other sites

Link to post
Share on other sites

23 minutes ago, LAwLz said:

Jakie polecenia są różne?

Jestem prawie pewien, że ważne polecenia są takie same nawet w nowszych wersjach IOS.

 

 

Nie jestem jednak pewien, jak to zrobiłeś w szkole, więc nie mogę ci w tym naprawdę pomóc.

Masz na myśli z trunkiem na przełączniku L3 i pod-interfejsami na routerze? Jeśli zrobisz to w ten sposób, tak naprawdę nie chcesz robić routingu na przełączniku. W takim przypadku należy zachować go jako przełącznik warstwy 2. 

 

 

Czy mówiąc „dodano ten port do trunka” masz na myśli, że skonfigurowałeś port jako port trunk? 

Jeśli to masz na myśli, to dlatego to nie działa. Gdy nieoznakowany pakiet dociera do łącza, zakłada, że ruch należy do natywnej sieci VLAN. Domyślam się, że natywna sieć VLAN na twoim porcie trunkingu to VLAN 1. Jeśli tak jest, nie będzie przekazywać ruchu między tym portem a VLAN 10, ponieważ nie znajdują się one w tej samej sieci VLAN. Chyba że jest gdzieś kierowany, oczywiście.

 

 

Edytować:

Chyba rozumiem, co się teraz stało.

Mówiłeś, że skonfigurowałeś to w szkole i uruchomiłeś? Jeśli tak, myślę, że mogę wyjaśnić dlaczego. 

 

Załączam zaktualizowaną wersję konfiguracji, która jest skonfigurowana tak, jak myślę, że zrobiłeś to w szkole.

Usunąłem drugi router dla jasności, ponieważ tak naprawdę nie jest zaangażowany w tę część.

Myślę, że stworzyłeś pod-interfejs dla VLAN 1 na routerze. Następnie utworzyłeś trunk na przełączniku i podłączyłeś do niego komputer. Ponieważ natywna sieć VLAN na magistrali to 1, przyjmie, że ruch z komputera należy do sieci VLAN 1 i wyśle go do routera. Stamtąd router wysyła ruch z powrotem do przełącznika i kieruje go do innych sieci VLAN.

For-GamerGry123-Od-LAwLz_v2.pkt 47,34 kB · 0 pobrań

You sent me the second file where the switch port that connects to the router is in trunk mode but has no IP address, how is it to connect to the router and send packets?

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, GamerGry123 said:

How would you answer, I am asking out of curiosity. Are you working in the field of network computing?

Yes. I am a networking consultant.

 

15 minutes ago, GamerGry123 said:

How did you learn it? How come, because there is not much about networks on the Internet, most of the films are from 10 years ago.

I learned the basics at university, where I got my degree.

Then after university I got a full-time employment as a networking consultant. I have learned a lot through just working it with 8 hours a day for years, but I have also taken Cisco courses as part of my employment. The last one I attended was the ENCOR in preparation for my CCNP renewal. 

 

Honestly though, the fundamentals of networking hasn't really changed since the 90's. Those 10 year old videos might not look that good, but the information they contain is probably just as relevant today as they were when they were produced.

 

22 minutes ago, GamerGry123 said:

Is what we do in school up-to-date are you using it somewhere right now?

It sounds like you're doing some basic routing stuff as well as VLANs. Those things are still very relevant.

 

 

 

 

 

15 minutes ago, GamerGry123 said:

How to make the switch work in L3 mode?

 

 

Switch(config)# ip routing

Switch(config)# vlan <VLAND-ID>

Switch(vlan)# exit

Switch(config)# interface vlan <VLAN-ID>

Switch(config-if)# ip address XXX.XXX.XXX.XXX YYY.YYY.YYY.YYY

 

 

 

Switch(config)# ip routing

This command enables the routing functions on the switch. They are off by default on most (or maybe all) Cisco L3 switches.

 

Switch(config)# vlan <VLAND-ID>

Switch(vlan)# exit

These commands creates the VLAN in the vlan database. This is very important because VLANs do not work unless they exist in the VLAN database. You can see the VLAN database by typing in the command "show vlan".

The exit command is there just to get you back to the configuration mode. VLANs are created when you exit the configuration for them.

 

Switch(config)# interface vlan <VLAN-ID>

This command creates the SVI, the virtual interface that is associated with the VLAN you specified. 

 

Switch(config-if)# ip address XXX.XXX.XXX.XXX YYY.YYY.YYY.YYY

This assigns an IP to the SVI, just like on any other interface you might be used to, like a routes port.

 

 

 

24 minutes ago, GamerGry123 said:

It can be done so that it works in L2 and L3, I need it so that I can create a VLANY and give the IP address to port 1/0.

Yes that is possible. In fact, I did that in the second configuration file I sent you. VLAN 10, 20 and 30 all have SVIs associated with them on the switch. As a result, VLAN 10, 20 and 30 are routed on the switch. 

VLAN 1 on the other hand, do not have an SVI associated with it. As a result, it works just like a regular VLAN on a layer 2 switch. 

 

 

25 minutes ago, GamerGry123 said:

You sent me the second file where the switch port that connects to the router is in trunk mode but has no IP address, how is it to connect to the router and send packets?

It works on layer 2. Trunks do not need an IP address. They just forward traffic depending on the VLAN tag.

Since VLAN 1 is the native VLAN on the trunk, traffic leaving it will be tagged with VLAN 1.

 

But please note that since I changed the S1's Gig1/0/1 from a routed port to a trunk, R1 and S1 are no longer able to communicate on layer 3. As a result, R1 can not reach VLAN 10, 20 or 30 anymore.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 4 weeks later...
On 25.04.2022 at 00:05, LAwLz said:

Tak. Jestem konsultantem ds. sieci.

 

Podstaw nauczyłem się na uniwersytecie, gdzie uzyskałem dyplom.

Następnie po studiach zostałem zatrudniony na pełen etat jako konsultant ds. networkingu. Wiele się nauczyłem, pracując przez 8 godzin dziennie przez lata, ale w ramach mojego zatrudnienia uczęszczałem również na kursy Cisco. Ostatnim, w którym uczestniczyłem, był ENCOR w ramach przygotowań do mojego odnowienia CCNP. 

 

Szczerze mówiąc, podstawy networkingu nie zmieniły się tak naprawdę od lat 90-tych. Te 10-letnie filmy mogą nie wyglądać tak dobrze, ale informacje, które zawierają, są prawdopodobnie tak samo aktualne dzisiaj, jak wtedy, gdy zostały wyprodukowane.

 

Wygląda na to, że robisz kilka podstawowych rzeczy związanych z routingiem, a także sieci VLAN. Te rzeczy są nadal bardzo aktualne.

 

 

 

 

 

 

 

Switch(config)# ip routing

Przełącznik(config)# vlan <VLAND-ID>

Przełącz (vlan) # wyjście

Switch(config)# interface vlan <VLAN-ID>

Switch(config-if)# adres ip XXX.XXX.XXX.XXX YYY.YYY.YYY.YYY

 

 

 

Switch(config)# ip routing

To polecenie włącza funkcje routingu w przełączniku. Są one domyślnie wyłączone w większości (lub może we wszystkich) przełącznikach Cisco L3.

 

Przełącznik(config)# vlan <VLAND-ID>

Przełącz (vlan) # wyjście

Te polecenia tworzą sieć VLAN w bazie danych vlan. Jest to bardzo ważne, ponieważ sieci VLAN nie działają, chyba że istnieją w bazie danych VLAN. Możesz zobaczyć bazę danych VLAN, wpisując polecenie „show vlan”.

Polecenie wyjścia służy tylko do powrotu do trybu konfiguracji. Sieci VLAN są tworzone po wyjściu z ich konfiguracji.

 

Switch(config)# interface vlan <VLAN-ID>

To polecenie tworzy SVI, wirtualny interfejs powiązany z określoną siecią VLAN. 

 

Switch(config-if)# adres ip XXX.XXX.XXX.XXX YYY.YYY.YYY.YYY

To przypisuje adres IP do SVI, tak jak w każdym innym interfejsie, do którego możesz być przyzwyczajony, na przykład port routingu.

 

 

 

Tak, to możliwe. W rzeczywistości zrobiłem to w drugim pliku konfiguracyjnym, który ci wysłałem. Wszystkie sieci VLAN 10, 20 i 30 mają przypisane SVI na przełączniku. W rezultacie sieci VLAN 10, 20 i 30 są routowane na przełączniku. 

Z drugiej strony, VLAN 1 nie ma skojarzonego z nim SVI. W rezultacie działa tak samo jak zwykła sieć VLAN na przełączniku warstwy 2. 

 

 

Działa na warstwie 2. Trunk nie wymaga adresu IP. Po prostu przekazują ruch w zależności od tagu VLAN.

Ponieważ VLAN 1 jest natywną siecią VLAN w trunku, ruch opuszczający ją będzie oznaczony tagiem VLAN 1.

 

Należy jednak pamiętać, że odkąd zmieniłem S1 Gig1/0/1 z routowanego portu na trunk, R1 i S1 nie są już w stanie komunikować się na warstwie 3. W rezultacie R1 nie może już połączyć się z VLAN 10, 20 lub 30 .

I do not know if I did as you wrote, because I did not fully understand what you wrote.

 

But I did it differently and it works.

 

On ESW1 I did VLAN, then port 1/15 I added to trunk mode, then automatic VLAN was added to this trunk.
To the same VLAN I added ports 1-8 in acces mode.

 

And just then when I added these ports to this VLAN in the acces mode and one of them I connected the computer to ESW1, everything worked.

 

Create a virtual interface on Router1:
interface fastethernet 0 / 0.1

It is 0 / 0.1 because it goes from port 0/0 so the next virtual interface would be 0 / 0.2.

 

Then I added a VLAN to it which is a comedy for ESW1
encapsulation dot1Q 10
This at the end is the VLAN number or VLAN 10.
Then I assigned an address to this interface so that this interface and VLAN which is on ESW1 are in the same network.

 

I would like to do a little more difficult task on the same topic could you help me?

 

image.png

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×