?
Solved

LAYER 2 SWITCH - MAC-ADDRESS-TABLE QUERY

Posted on 2011-10-03
51
Medium Priority
?
392 Views
Last Modified: 2012-05-12
The only reason I ask this question is because I did a test exam for 'CCNA and not the ICND parts 1 & 2' and if I remember correctly I had a question that asked me to 'ping something', and then find out the 'Source & Destination mac address'.

I think the scenario would not let me ping from the actual host pc otherwise I could have logged onto the specific host destination pc for example, do an 'ipconfig /all' and find out the 'mac-address', but I dont think this is the 'Destination mac-address' that the question is asking as if I remember correctly it will be the mac-address of the destination of the 'last exit interface'!!!!!!! Im thinking that the scenario has already presumed that 'manual address mac addresses' were already added to the switches for every device attached!!!!!!!!!!

If I have a single router with a basic config in place and in this case with 'NO SERIAL' connections but using 2 x fa0/0 & fa0/1 ports but also on different subnets ie:

My switches A & B and router interfaces are all 'ping successful' first of all!!

Router

Int fa0/0 - 192.168.0.1 / 24
Description Connected to SwitchA port 1
no shut

Int fa0/1 - 10.0.0.1 /24
Description Connected to SwitchB port 1
no shut

I have not yet set any 'mac addresses' yet for 'host pcs' connected to specific ports on both 'Switches A & B' yet!!

If someone said to me I wish to find out the 'mac-address' of the 'Source & Destination' Im not sure how to go about this?

Ive just logged onto 'SwitchA':

sh mac-address-table
clear mac-address-table
sh arp
clear arp-cache
ping 192.168.1.10 but received 'NO reply' from SwitchA to a host pc attached to 'Same SwitchA on port 23 - I was able to do:
sh arp
 - This showed the host pc address I tried to ping ie 192.168.1.10 which also shows a mac address in 'Same mac table', so I presume that this is the 'Actual Destination mac address' of Int fa0/23 which is where host pc 192.168.1.10 is plugged -  ?
ping 192.168.1.1 - This was successful
sh arp
- This showed '192.168.1.1' and a mac address but I think this is the 'mac address' of the same switch Im logged onto 'SwitchA - fa0/1
ping 10.0.0.1 - Unsuccessful
sh arp
- This still showed the 'exact same mac' ie - 192.168.1.1

Im going to 'add manually the mac-addresses' for each host pc attached to both 'Switch A & B' and try again

Any help would be good!!

0
Comment
Question by:mikey250
  • 29
  • 22
51 Comments
 
LVL 50

Accepted Solution

by:
Don Johnston earned 2000 total points
ID: 36903100
From the router, "show arp".

That will tell you the MAC address of 192.168.1.10 and what interface it's connected through.

Then go to the switch that is connected to that interface and issue a "show mac-address-table". That will tell you what port it's connected to.

You will only be able to ping the workstation from the switch if the management IP of the switch is in the same VLAN as the workstation or if there is a router that is routing the traffic between the two.
0
 

Author Comment

by:mikey250
ID: 36903109
Ive made a few wording ammendments but reading your comments now!!!
0
 

Author Comment

by:mikey250
ID: 36903118
Hi donjohnston, after pinging from SwitchA the host pc attached to same switch ie 192.168.1.10 - As it turns out after doing:

sh arp on SwitchA - also matches the 'sh arp' on the router - so thats good!!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mikey250
ID: 36903289
Qns1. For some unknown reason I 'cannot' ping the management addresses when logged onto SwitchA or B?

ip host SWITCHA 10.0.0.2 - Unsuccessful ping

int vlan 1
ip address 10.0.0.3 255.255.255.0 - Successful ping
no shut

ip default-gateway 10.0.0.1 - Successful ping

ip host SWITCHB 192.168.0.2 - Unsuccessful ping

int vlan 1
ip address 192.168.1.3 255.255.255.0 - Successful ping
no shut

ip default-gateway 192.168.1.1 - Successful ping

Ive also done copy run start & reload switches
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36903421
>I 'cannot' ping the management addresses when logged onto SwitchA or B?

Where are you pinging from? What IP address?

Is the default gateway for all the switches and workstations correctly set?

It would help to see the configs.
0
 

Author Comment

by:mikey250
ID: 36903509
As per last thread I cannot ping from 'Switch A to the management address on SwitchA'

ip host SWITCHA 10.0.0.2 - Unsuccessful ping

int vlan 1
ip address 10.0.0.3 255.255.255.0 - Successful ping
no shut

ip default-gateway 10.0.0.1 - Successful ping

ip host SWITCHB 192.168.0.2 - Unsuccessful ping

int vlan 1
ip address 192.168.1.3 255.255.255.0 - Successful ping
no shut

ip default-gateway 192.168.1.1 - Successful ping

Ive also done copy run start & reload switches

I have noticed something else also!!!!!!!!!!!!!
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36903563
I read your post and I'm sure it makes sense to you... but not to me.

For example:
----------------------
ip host SWITCHA 10.0.0.2 - Unsuccessful ping

int vlan 1
ip address 10.0.0.3 255.255.255.0 - Successful ping
no shut

ip default-gateway 10.0.0.1 - Successful ping
----------------------

I'm guessing that "ip host SWITCHA 10.0.0.2 - Unsuccessful ping" means that Switch A's management IP address is 10.0.0.2.  And that you can't ping that address from the switch itself?

And that the next three lines are from the config of Switch A? If that's the case, then Switch A's address is 10.0.0.3 and not 10.0.0.2.

But I can't be sure.
0
 

Author Comment

by:mikey250
ID: 36903640
I have no vlans setup just defaults and no routing protocols as just config specific to this thread!!

SwitchB - I have 'pinged successfully or Unsuccessfully' the following but the 'arp' below still shows:
sh arp:

- 10.0.0.3 - Successful
- 10.0.0.1 - Successful
- 192.168.1.10 - Unsuccessful
- 192.168.1.1 - Unsuccessful
- 192.168.1.2 - Unsuccessful
- 192.168.1.3 - Successful
- 192.168.1.11 - This was obviously unsuccessful as no host device is configured with this specific address

On SwitchA
sh arp:

- 192.168.1.1 - Successful
- 192.168.1.3 - Successful
- 192.168.1.2 - Unsuccessful - Does not show in arp
- 10.0.0.1 - Successful - but shows 192.168.1.1 & dont know why as SwitchB does not do this!!
- 10.0.0.2 - Unsuccessful - Does not show in arp
- 10.0.0.3 - Unsuccessful - Does not show in arp
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36903687
This will be much easier if you would post the configs of the two switches and router.
0
 

Author Comment

by:mikey250
ID: 36903703
Yes I agree !!  Just to confirm 'SwitchA belongs to: 192.168.1.x & SwitchB belongs to: 10.0.0.x'

I have though changed the config to the following:

SwitchA - When logged onto this switch I cannot ping 192.168.1.3 ?
ip host switcha 192.168.1.3

int vlan 1
ip address 192.168.1.2 255.255.255.0
no shut

ip default-gateway 192.168.1.1

SwitchB - When logged onto this switch I cannot ping 10.0.0.3

ip host switchb 10.0.0.3

int vlan 1
ip address 10.0.0.2 255.255.255.0
no shut

ip default-gateway 10.0.0.1

0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36903746

>SwitchA - When logged onto this switch I cannot ping 192.168.1.3

>int vlan 1
>ip address 192.168.1.2 255.255.255.0
>no shut

So from Switch A with the IP address 192.168.1.2, you can't ping 192.168.1.3, right? Where is this 192.168.1.3 device???

You will have to post the configs of the devices.
0
 

Author Comment

by:mikey250
ID: 36903877
Im copying configs now!
0
 

Author Comment

by:mikey250
ID: 36903937
Hi Ive attached screenshots!!
SWITCHA-part-1a.zip
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 2000 total points
ID: 36903975
In the future, you can copy all the output to notepad and post all the output as a single .txt file. Or, in Putty, go to Session>Logging and direct all session output to a text file.

As for the problem:

Where is the device 192.168.1.3 located??????

If it's connected to a switch, which one and what port?  
0
 

Author Comment

by:mikey250
ID: 36903999
There is 'NO'device for 192.168.1.3 as this is the Management switch IP Address.

As for device attached to this switchA - There is only 1 host pc attached with static ip address 192.168.1.10/24..
0
 

Author Comment

by:mikey250
ID: 36904005
1 x management address
1 x int vlan address
1 x default-gateway address

nothing else except for 2 host pc attached to ports 4 & 5 on SwitchB & 1 host pc attached to SwitchA port 23
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36904052
>There is 'NO'device for 192.168.1.3 as this is the Management switch IP Address.

No. The management address of the switch is 192.168.1.2

0
 

Author Comment

by:mikey250
ID: 36904126
I have changed both addresses vice versa:

Management ip address 192.168.1.2 or 192.168.1.3 but this did not make a difference and surely if on same subnet then it should still work either way?

what are you asking me to do change management ip address from 192.168.1.3 to 192.168.1.2?
0
 

Author Comment

by:mikey250
ID: 36904158
I do understand that the Management device for SwitchA is the IP Address set by the way! Its just how you ask your question!!!
0
 

Author Comment

by:mikey250
ID: 36904171
This should be straignt forward as no other configs are neccessary and as all ip addresses are in same subent on switchA there should not be a problem! Im thinking there is a residual config on router or switch but that does not make sense as I have not even created any extra vlans as all are on default settings using vlan 1.  Also there is no 'VTP' set on either switch!!!!
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36904356
According to your posted config, the management IP address of the switch IS 192.168.1.2
0
 

Author Comment

by:mikey250
ID: 36904373
Ive been changing the management ip address from 192.168.1.2 to 192.168.1.3 and vice versa, even though on same subnet and obviously changing the Int vlan 1 also as a result but still cannot ping management address!! Unless Ive not waited long enough!!!
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36904631
Without knowing the CURRENT config,  there's no way to determine the problem.
0
 

Author Comment

by:mikey250
ID: 36904712
I will completely erase-startup tomorrow and start again with again just the bare basics just to be able to ping a L2 switch.  Its probably something like a residual config maybe although the only thing I practised with was 'ACL's only on one of my router interfaces to only allow 1 host ip address on 192.168.1.10 to use: http://192.168.0.10 and nothing else.

I then just removed from router:
int fa0/0
ip access-group 101 in

I did though leave the 2 ACL's on the router but I really doubt this was the issue.

Appreciated for your time anyway.  I will be on this tomorrow morning!!!!!
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36906291
You don't have to erase anything. Simply post the current config.
0
 

Author Comment

by:mikey250
ID: 36908583
Hi donjohnston it was a basic config anyway just thought I would clear that part up.  Anyway Ive linked the 'Corp' router to the switchA and still same problem cannot ping management switch ip address!!!

I have not configured the 'SwitchB' config yet except but just adde the router fa1/1 interface ready!1
corp-router-config1.txt
switcha-config.txt
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36909085
What IP address are you trying to ping and where are you trying to ping from???

0
 

Author Comment

by:mikey250
ID: 36909108
Hi donjohnston, I wish to be able to ping SWITCHA ie:

ping SWITCHA
ping 192.168.1.2 - Management IP Address

Im logged on to SwitchA
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 2000 total points
ID: 36909161
The management address of SWITCHA is 192.168.1.3

Look at your config for SWITCHA under "interface Vlan1". THAT is the management IP address of SWITCHA.

You are also creating an "ip host" entry for SWITCHA that points to 192.168.1.2. I'm not sure why you're doing this because it's wrong. The "ip host" entries are used to create static name resolution entries (like DNS) on an IOS device.

For example, you could add entries:

ip host RouterA 192.168.1.10
ip host SwitchX 192.168.1.20
ip host RouterB 10.1.1.1
ip host SwitchY 10.1.1.10

which would allow you to ping a device with the command "ping RouterA" instead of having to remember the ip address.

But these entries do not define (or configure) the IP address of a device. They are simply shortcuts to entering IP addresses when talking to a device.

If you wanted to put one in for the switch itself (which would be kind of weird since you don't often talk to your self), you could add the line

ip host SWITCHA 192.168.1.3

Then if you want to ping yourself you could type "ping SWITCHA".

0
 

Author Comment

by:mikey250
ID: 36909229
Hi don,  I did this yesturday ie change the ip address to what you said!!!

I just wanted to see if I could ping myself being logged onto also the same switch but it does not work, whether I change the IP Address to 192.168.1.2 or 192.168.1.3 nor can I do: ping SWITCHA
0
 

Author Comment

by:mikey250
ID: 36909234
Ive tried to do from Router: ping SWITCHA but this does not work either!!
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36913513
From the router you have named "CORP", what happens when you type "ping 192.168.1.3?

0
 

Author Comment

by:mikey250
ID: 36915183
Hi don,  I can always ping the 'gateway & the int vlan1' but never the 'management switch ip'!!  Ive currently removed the config to do something else but if you have any suggestions then please let me know!!
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 2000 total points
ID: 36916212
>I can always ping the 'gateway & the int vlan1' but never the 'management switch ip'!!

The VLAN 1 interface  IS THE MANAGEMENT IP!!!!!!
0
 

Author Comment

by:mikey250
ID: 36916895
Hi don,  ok my mis-interpretation.  If I add: ip host switcha 192.168.1.3 on switcha, how can I do I ping this?
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36918162
"ping 192.168.1.3"
0
 

Author Comment

by:mikey250
ID: 36918287
Hi don,  Ive not got it setup at the moment, but going over my previous thread: 36909161

If you wanted to put one in for the switch itself (which would be kind of weird since you don't often talk to your self), you could add the line

ip host SWITCHA 192.168.1.3

Then if you want to ping yourself you could type "ping SWITCHA".

I tried to ping SwitchA from SwitchA but this did not work!
I tried also to ping SwitchA from router but this did not work!

I will set this up again tomorrow morning and thanks for getting back to me!!!!!!!!! appreciated
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36918435
>I can always ping the 'gateway & the int vlan1

>I tried also to ping SwitchA from router but this did not work!

Which is it?

Post the configs of both devices and the session text when you try to ping.
0
 

Author Comment

by:mikey250
ID: 36931240
I did not realise you had sent me a message a couple of days!!
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36932129

                >I can always ping the 'gateway & the int vlan1

>I tried also to ping SwitchA from router but this did not work!

Which is it?

Post the configs of both devices and the session text when you try to ping.
0
 

Author Comment

by:mikey250
ID: 36941938
Hi Don,  Apologies for taking so long to get back to you!!!!!!! Ive attached 2 configs as you requested!!  Im not sure whether I should ping from either 'SwitchA or Corp router'!!  My IP Addresses may not be as you would like them as Ive been changing them throughout but still not able to 'ping SWITCHA or the IP'.
Corp-router-config-1b.txt
SwitchA-config.txt
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 2000 total points
ID: 36942055
Your switch config still has an inconsistency.
---------------------------------
hostname SWITCHA
!
ip host SWITCHA 192.168.0.3
!
interface Vlan1
 ip address 192.168.0.2 255.255.255.0
---------------------------------

What do you want the ip address of SWITCHA to be???

Unless you have a third device with an ip address of 192.168.0.3 out there, your ping results are fine.

In summary:

The ip address of "SWITCHA" a is 192.168.0.2.  And you can ping that from the switch and the router.

The ip address of the LAN interface of router "CORP" is 192.168.0.1. And you can ping that from the router and the switch.

Which means, everything is working correctly.
0
 

Author Comment

by:mikey250
ID: 36942468
Hi Don,  Yes I understand Your 'In summary' comments!!!!

I always thought that by adding ip host (name) (ip address) on a device such as a router or switch, that it would allow me to PING the name or IP, but not so.  That is why Im stuck!!

You mention a 3rd party device but not sure what you mean?

Ive added - ip host SWITCHA 192.168.0.3 on the router - As thought this enable me to ping the 'name - SWITCHA & also the IP Address but this did not work!!

I then added ip host SWITCHA 192.168.0.3 on the SWITCHA and tried to ping the name - SwitchA, but this did not work!!

0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 2000 total points
ID: 36943425
I didn't say third "party". I said third "device".

You are able to successfully ping the router and switch. So from a communications standpoint, everything is working correctly.

I still don't understand why you are putting in "IP host" entries for SWITCHA with the wrong IP address.  At this time,  THE IP ADDRESS OF SWITCH A IS 192.168.0.2!!!

If you want to ping by name, the statement in your config should be "ip host switcha 192.168.0.2"
0
 

Author Comment

by:mikey250
ID: 36943563
I just wont to know how to ping the 'name' if I wish!!

I have already done 'ping switcha' on both switcha and router but neither respond back so Im not sure!!
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 2000 total points
ID: 36944112
Read my last post.

If you want to ping by name, the statement in your config should be "ip host switcha 192.168.0.2"
0
 

Author Comment

by:mikey250
ID: 36944247
The configu does show:

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2011.10.10 12:20:57 =~=~=~=~=~=~=~=~=~=~=~=

SWITCHA#
SWITCHA#sh run
Building configuration...

Current configuration : 1222 bytes
!
version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SWITCHA
!
!
ip subnet-zero
!
ip host SWITCHA 192.168.0.3
!
spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
!
!
!
!
interface FastEthernet0/1
 description Connected to CORP
 switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
 switchport mode access
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface Vlan1
 ip address 192.168.0.2 255.255.255.0
 no ip route-cache
!
ip default-gateway 192.168.0.1
ip http server
!
line con 0
line vty 5 15
!
!
end

SWITCHA#
SWITCHA#ping 192.168.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
SWITCHA#ping 192.168.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
SWITCHA#ping 192.168.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
SWITCHA#ping SWITCHA

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
SWITCHA#
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 36944548
One more time...

There is NO device with an address of 192.168.0.3! You are wasting your time trying to ping it.

Your "IP host" statements reference IP address 192.168.0.3 which DOESN'T EXIST!
0
 

Author Comment

by:mikey250
ID: 36947285
Hi don, Ive just found one of your comments above:36909161

I did not properly understand the below message: You say it would be wierd, so why have it?

The management address of SWITCHA is 192.168.1.3

Look at your config for SWITCHA under "interface Vlan1". THAT is the management IP address of SWITCHA.

You are also creating an "ip host" entry for SWITCHA that points to 192.168.1.2. I'm not sure why you're doing this because it's wrong. The "ip host" entries are used to create static name resolution entries (like DNS) on an IOS device.

For example, you could add entries:

ip host RouterA 192.168.1.10
ip host SwitchX 192.168.1.20
ip host RouterB 10.1.1.1
ip host SwitchY 10.1.1.10

which would allow you to ping a device with the command "ping RouterA" instead of having to remember the ip address.

But these entries do not define (or configure) the IP address of a device. They are simply shortcuts to entering IP addresses when talking to a device.

If you wanted to put one in for the switch itself (which would be kind of weird since you don't often talk to your self), you could add the line

ip host SWITCHA 192.168.1.3

Then if you want to ping yourself you could type "ping SWITCHA".
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 2000 total points
ID: 36948372
Because pinging yourself is used to test the IP protocol stack.  And if you want to do that, you can ping 127.0.0.1.

To put an ip host statement in for your own address is something I've never seen before.

But if you want to, you can. You just have to put the correct ip address in the host statement.
0
 

Author Comment

by:mikey250
ID: 36948489
Ok thanks for that!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two basic ways to configure a static route for Cisco IOS devices. I've written this article to highlight a case study comparing the configuration of a static route using the next-hop IP and the configuration of a static route using an outg…
Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question