Welcome
First of all, may I welcome you to my site. My name is Chris and I'm from the UK and work as a Systems Engineer for Cisco. This blog was initially created to post up my subnetting technique but has now got more stuff to do with attaining Cisco certifications. Either way I really hope that the content is sufficent for your needs and I look forward to hearing your feedback. If you find that the content really helps you please feel free to donate using the PayPal link on the right.
To view the index of all my articles please click here.
How to calculate multicast MAC address
Thursday, 17 February 2011
Hi,
It's been a while but here's a quick post on how to calculate a multicast MAC address from an IP address.
The first half of a multicast MAC address is 01-00-5E so we need to work out the second half.
To do this we need to convert the last 23 bits of the IP address in question. If you think about this we are not using the high order bit in the second octet which carries a value of 128. Therefore it must follow that a value of 6 in the second octet must be the same as 134 in the second octet as the high-order bit (i.e. a value of 128) is ignored.
So this leads to a simple method. Let us try and convert 192.168.35.1 to a multicast MAC address
1. Start with a half-filled multicast MAC address of 01-00-5E-XX-YY-ZZ
2. To calculate the value of XX take the second octet. If the value of the second octet is greater than 128 then subtract 128 from the second octet. In this example, the value of 168 is greater than 128 so we subtract 128 from 168 to give us a value of 40. Convert this value to hexadecimal. Decimal 40 = 0x28. Our multicast MAC address is now 01-00-5E-28-YY-ZZ
3. To calculate the value of YY take the third octet and convert it to hex. In this example the value is 35 which equals 0x23. Our multicast MAC address is now 01-00-5E-28-23-ZZ
4. To calculate the value of ZZ take the fourth octet and convert it to hex. In this example the value is 1 which equals 0x01. Our multicast MAC address is now 01-00-5E-28-23-01
So 192.168.35.1 has a multicast MAC address of 01-00-5E-28-23-01.
Can you spot an issue here? Hopefully you can. Basically any IP address with 40.35.1 or 168.35.1 as the last three octets carry the same multicast MAC address so you have potentially 32 addresses with the same multicast MAC address!
Back to the books for me!
Good luck with your studies.
Posted byChris Bloomfield at 20:48 2 comments
Labels: 01-00-5E, calculate multicast MAC, machine, multicast, multicast MAC address
Vyatta on VM Workstation
Monday, 15 December 2008
Here's the deal. How do you fill your work time looking busy but having a bit of fun? Simple. Look out for emerging technologies and tell your department you want to "innovate" with Product X. So here I am, looking at Vyatta. Bold claims from these guys but is it as good as they say? Well I'm not here to run the mathematical experiments. What I want to know is "Is it easy to use?" and "Can I use it in one of our projects?". It's early days to be answering the latter but I may be able to answer the former over a series of posts.
What I want to do is set up a dummy network in VM Workstation to simulate a square with a Vyatta router at each corner like so:
Vyatta Instance 1 --> Vyatta Instance 2
Vyatta Instance 1 --> Vyatta Instance 3
Vyatta Instance 2 --> Vyatta Instance 4
Vyatta Instance 3 --> Vyatta Instance 4
I really am a noob to VM Workstation but after a little playing around I got it to work.
Taking the above connections I used the Custom Network Connections for each (I believe VMNet0 and VMNet1 are reserved):
Vyatta Instance 1 --> Vyatta Instance 2 = VMNet2
Vyatta Instance 1 --> Vyatta Instance 3 = VMNet3
Vyatta Instance 2 --> Vyatta Instance 4 = VMNet4
Vyatta Instance 3 --> Vyatta Instance 4 = VMNet5
By default each virtual machine in VM Workstation has one Network Connection set up (usually NAT). Modify this to a custom connection and from the drop-down list choose the appropriate VMNet. To add a new Network Adapter simply click Add in the Virtual Machine Settings and choose Network Adapter then select Custom and choose the desired VMNet connection. For my example above I modified the first Network Adapter on Vyatta Instance 1 to VMNet2 and created a new Network Adapter in VMNet3. I done similar on the other three instances and lo-and-behold everything was connected.
Here's my basic settings:
Vyatta Instance 1:
configure
set system host-name Vyatta-Instance-1
set interfaces ethernet eth0 description Link_To_Vyatta_Instance_2
set interfaces ethernet eth0 address 192.168.2.1/24
set interfaces ethernet eth1 description Link_To_Vyatta_Instance_3
set interfaces ethernet eth1 address 192.168.3.1/24
commit
save
Vyatta Instance 2:
configure
set system host-name Vyatta-Instance-2
set interfaces ethernet eth0 description Link_To_Vyatta_Instance_1
set interfaces ethernet eth0 address 192.168.2.2/24
set interfaces ethernet eth1 description Link_To_Vyatta_Instance_4
set interfaces ethernet eth1 address 192.168.4.1/24
commit
Vyatta Instance 3:
configure
set system host-name Vyatta-Instance-3
set interfaces ethernet eth0 description Link_To_Vyatta_Instance_1
set interfaces ethernet eth0 address 192.168.3.2/24
set interfaces ethernet eth1 description Link_To_Vyatta_Instance_4
set interfaces ethernet eth1 address 192.168.5.1/24
commit
Vyatta Instance 4:
configure
set system host-name Vyatta-Instance-4
set interfaces ethernet eth0 description Link_To_Vyatta_Instance_2
set interfaces ethernet eth0 address 192.168.4.2/24
set interfaces ethernet eth1 description Link_To_Vyatta_Instance_3
set interfaces ethernet eth1 address 192.168.5.2/24
commit
This is probably more for my reference but to undo anything use the "delete" command. For example if I accidentally put an IP address under eth0 for example I could use the following;
delete interfaces ethernet eth0 address 192.168.3.1/24
Now I've decided to run RIP just to see how easy it is.
Vyatta Instance 1
configure
set protocols rip network 192.168.2.0/24
set protocols rip network 192.168.3.0/24
commit
save
Vyatta Instance 2
configure
set protocols rip network 192.168.2.0/24
set protocols rip network 192.168.4.0/24
commit
save
Vyatta Instance 3
configure
set protocols rip network 192.168.3.0/24
set protocols rip network 192.168.5.0/24
commit
save
Vyatta Instance 4
configure
set protocols rip network 192.168.4.0/24
set protocols rip network 192.168.5.0/24
commit
save
To shut down an interface:
set interfaces ethernet eth0 disable
To bring it back up:
delete interfaces ethernet eth0 disable
It all seems easy so far.
Posted byChris Bloomfield at 11:23 1 comments
Labels: Cisco, machine, virtual, VM workstation, VMware, vyatta