Tuesday, April 29, 2014

Tutorial: Configure a DHCP server in multiple VLAN's

Information

For my school project we had to make a network for our fictive business. Because we cannot build the network physical we made it in Packet Tracer. The requirements for our network are:
  • Multiple VLAN's
  • Physical DHCP server
This is a very small network with basic subnetting. This tutorial is just to show you how you can have 1 DHCP server for multiple VLAN's.

Result

Network with multiple VLAN's and a DHCP server.

Tutorial

So, how do you build this network. In the following steps I will try to explain step by step. I made a screenshot of every step. But if you just want the commands just scroll down to the running config of the router.
Step 1: First add a router, in this case I took the standard one: "1841". But this router does not have enough ports so we add the "HWIC-4ESW" module. This module contains 4x FastEthernet ports. Do not forget to power off the device before you add the module.
Step 2: When you have added the "HWIC-4ESW" module you can power on the device again.
Step 3: Now add your server and a switch. Connect them with a straight-through cable. For the switch you can choose but I have chosen the "2950-24". The server you can find in "End Devices".
Step 4: When you have added the server it's time to configure it. First we give the server a static ip address. For this server I used 192.168.1.6 and 255.255.255.0 as subnet mask.This is a personal choice, if you want to use a other ip address, you can.
Step 5: Next we have to configure the default gateway. Since our ip address is 192.168.1.6 we have to choose one in the same local network. I always choose the first ip address available in the local network. So here our default gateway is 192.168.1.1.
Step 6: Now we can configure the DHCP server. The first pool is for our local network 192.168.1.0.
Step 7: The start ip is 192.168.1.10 with a subnet mask 255.255.255.0. With a maximum of 100 users. So the ip addresses available for the DHCP clients are 192.168.1.10-192.168.110.
Step 8: When our DHCP server is configured the port status summary should look like this.
Step 9: Now we add a computer in the same local network. For example a laptop and connect it to the switch.
Step 10: Now change the ip configuration to DHCP. Now our laptop has a ip address provided by the DHCP server.
Step 11: To verify our network works you can ping from the laptop to the server.
Step 12: We have to create VLAN's on our router. We do this step by step so now we only add our VLAN for the subnet where our server is located.
Step 13: We have made our VLAN, but we still have to assign it to the right FastEthernet port. I have plugged this particular network to "FastEthernet0/1/0". Here we change the VLAN to 10. Also do not forget to change the port status to on!
Step 14: We also have to give the VLAN an ip address. You can easily do this in the CLI. The commands you can see in the screenshot.
Step 15: After these steps the port status summary should look like this.
Step 16: Now we can start building our second subnet, starting by adding a new switch.
Step 17: Adding the second subnet to the router.
Step 18: Change the port status to on, and the VLAN to the one we just created.
Step 19: Also we have to configure an ip address for VLAN 100. Because our DHCP server is located in a other subnet we have to use the ip helper-address command. This will enable our DHCP packets to flow to 192.168.1.6.
Step 20: The basic network is made. By adding a new end device to the new switch we can test our DHCP server.
Step 21: But first we need to add an other pool to our DHCP server. This time we need to add the 192.168.2.0 network.
Step 22: When the pool is added we can test the configuration. Go to your pc on the second subnet and change the ip configuration to DHCP. After some seconds your pc should have a ip address provided by the DHCP server.
Step 23: Now add a third switch and a pc for our third subnet.
Step 24: Again we have to add a new subnet in our router.
Step 25: Also again configure the ip address and ip helper address.
Step 26: Change the "FastEthernet0/1/2" to VLAN200. Again switch the port to on.
Step 27: Now add the third subnet to the pool. This time it's network 192.168.3.0.
Step 28: Again change the ip configuration to DHCP. Normally your pc will receive an ip address.
Step 29: The last subnet is connected with an access point. Add the access point and a wireless device to your network.
Step 30: Next we add the last subnet: Subnet4 with number 300.
Step 31: Again change the VLAN of "FastEthernet0/1/3". Do not forget to switch the port on!
Step 32: Add the network to the DHCP.
Step 33: Give the VLAN the ip address 192.168.4.1 with ip helper address 192.168.1.6.
Step 34: The tablet should get a ip address from the DHCP server.
Step 35: Now simply add more clients to your network.

Running Config

Over here is the running config of the router:
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1/0
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/1/1
 switchport access vlan 100
 switchport mode access
!
interface FastEthernet0/1/2
 switchport access vlan 200
 switchport mode access
!
interface FastEthernet0/1/3
 switchport access vlan 300
 switchport mode access
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan10
 ip address 192.168.1.1 255.255.255.0
!
interface Vlan100
 ip address 192.168.2.1 255.255.255.0
 ip helper-address 192.168.1.6
!
interface Vlan200
 ip address 192.168.3.1 255.255.255.0
 ip helper-address 192.168.1.6
!
interface Vlan300
 ip address 192.168.4.1 255.255.255.0
 ip helper-address 192.168.1.6
!
router rip
!
ip classless
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

Sunday, April 27, 2014

Benchmark: AMD driver 13.3 vs 14.4 on R9 280X

Yesterday the new AMD drivers came out. I was curious how they would preform on my R9 280X. I was expecting a increase in performance, but not in the games I currently play.

Information 

The specification's of my gaming system.
  • Intel Core i5-4670
  • R9 280X
    • I over-clocked my card to 1100Mhz on the core and 1550Mhz on the memory.
  • Full specifiation's
The games I have used. All games were on maximum graphics on 1080p resolution
  • DiRT Showdown
  • DiRT 3
  • Assassins Creed III
  • Assassins Creed IV: Black Flag
  • Need For Speed Rivals
    Also I have ran the Performance Benchmark of 3DMark 11.

    The results:

    Conclusion

    After these results I am very disappointed in AMD, the 14.4 drivers preform worse or equal to 13.3. Maybe the results on a R9 290(x). Maybe I will do the same tests on my HTPC which is equipped with an R7 260x. 

    Wednesday, April 16, 2014

    How android developers are pushed to buy reviews for their apps.

    Hello

    A few days ago I launched my new android application: a rain radar for Belgium, Netherlands, Germany and the UK. Now I have over 400 downloads and I'm really happy with that! More info about the app you can find here. Without any advertising I managed to get some downloads with a simple application. And for that, I give myself a A+.

    But also I already got 5 emails from companies to either add advertisements or buy reviews. This is not the way I want to do it. Reviews should be real, not fake ones you bought. The prices are ridiculous. Here are some examples I got.



    You can also see those emails are sent automatically due the fact they spell my name wrong, "J%C3%BCrgen" is not my name! In the last mail there is a brochure you can view with a nice marketing talk. A copy of the link you can find over here: https://docs.google.com/file/d/0B79aYRbrrAA3Q3R3TndxWFp4R1U/edit.

    In my eyes this is wrong. What if someone creates an app which is working just fine. Buys reviews, but adds a backdoor? And how much people are actually looking to the reviews in the Play Store? The first thing I check are the images.

    But after all I got one email from a company which actually did download my app and asked friendly if I wanted to add advertisements. I gently replied I do not have any plans to add advertisements. So maybe not all the companies are bad.

    Feel free to discuss over here in the comments!

    Tuesday, April 15, 2014

    Tutorial: How to use a ExpandableListView in android

    For my mobile app MijnLessenrooster I needed a list which contained an other list. Soon I found the ExpandableListView in the Google API. I saw I needed to make my own BaseExpandableListAdapter class to make the list work. Here is my tutorial how to implement a Listview in your android application.
    Example ExpandableListView

    I used a linked hashmap to store my data, the keyset is for the headers and the valueset for the second list. You can use whatever you want but in my application I needed a sorted map.

    XML files you need to make in the /layout folder

    • list_view_main.xml
    • child_item.xml

    list_view_main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <ExpandableListView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </LinearLayout>
    child_item.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:padding="10dp" >

        <TextView
            android:id="@+id/item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="25dp" />

    </LinearLayout>
    For this particular application I used the listview inside a fragment. With a few tweaks you could use this as a normal view.

    Next is the java files itself. The only thing needed to make this code works is to store your data in the LinkedHashMap "data". An example of the data inside the map:

    • item1
      • childitem1
      • childitem2
    • item2
      • childitem1

     ExpandableListView.java

      public class ExpandableListView extends Fragment {

        private View rootView;
        private Map<String, ArrayList<String>> data =
                new LinkedHashMap<String, ArrayList<String>>();
        private List<String> groupList;
        private List<String> childList;
        private Map<String, List<String>> dataCollection;
        private LayoutInflater inflater;

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            this.inflater = inflater;

            rootView = inflater.inflate(R.layout.list_view_main, null);
            // you must fill the linkedhashmap data before this 2 methods
            createGroupList();
            createCollection();
           
            ExpandableListView elv =
                (ExpandableListView) rootView.findViewById(R.id.list);
            elv.setAdapter(new ExpandableListAdapter
                (inflater, groupList,dataCollection));
           
            return rootView;
        }



        private void createGroupList() {
            groupList = new ArrayList<String>();
            for (String groupItem : data.keySet()) {
                groupList.add(groupItem);
            }
        }

        private void createCollection() {

            dataCollection = new LinkedHashMap<String, List<String>>();

            for (String childItem : groupList) {
                ArrayList<String> l = data.get(childItem);
                loadChild(l.toArray(new String[l.size()]));

                dataCollection.put(laptop, childList);
            }
        }

        private void loadChild(String[] childModels) {
            childList = new ArrayList<String>();
            for (String model : childModels)
                childList.add(model);
        }

        public class ExpandableListAdapter extends BaseExpandableListAdapter {

            private LayoutInflater context;
            private Map<String, List<String>> dataCollection;
            private List<String> childItems;

            public ExpandableListAdapter(LayoutInflater context,
                    List<String> childItems,
                    Map<String, List<String>> dataCollection) {
                this.context = context;
                this.dataCollection = dataCollection;
                this.childItems = childItems;
            }

            public Object getChild(int groupPosition, int childPosition) {
                return dataCollection.get(childItems.get(groupPosition)).get(
                        childPosition);
            }

            public long getChildId(int groupPosition, int childPosition) {
                return childPosition;
            }

            public View getChildView(final int groupPosition,
                    final int childPosition, boolean isLastChild, View convertView,
                    ViewGroup parent) {

                TextView textView = new TextView(
                        ExpandableListView.this.getActivity());
                textView.setText(getChild(groupPosition, childPosition).toString());

                textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
                textView.setPadding(50, 7, 7, 7);

                return textView;
            }

            public int getChildrenCount(int groupPosition) {
                return dataCollection.get(childItems.get(groupPosition)).size();
            }

            public Object getGroup(int groupPosition) {
                return childItems.get(groupPosition);
            }

            public int getGroupCount() {
                return childItems.size();
            }

            public long getGroupId(int groupPosition) {
                return groupPosition;
            }

            public View getGroupView(int groupPosition, boolean isExpanded,
                    View convertView, ViewGroup parent) {
                String childName = (String) getGroup(groupPosition);
                if (convertView == null) {
                    LayoutInflater infalInflater = context;
                    convertView = infalInflater.inflate(R.layout.child_item, null);
                }
                TextView item = (TextView) convertView.findViewById(R.id.item);
                item.setTypeface(null, Typeface.BOLD);
                item.setText(childName);
                return convertView;
            }

            public boolean hasStableIds() {
                return true;
            }

            public boolean isChildSelectable(int groupPosition, int childPosition) {
                return true;
            }
        }

    }


    I hope this tutorial helped you and if you have any questions feel free to ask them!

    Monday, April 14, 2014

    How I fixed the 80073712 error Windows 8.1 Update

    When the update rolled out I was really happy and I could not wait to install it. On my desktop everything went great, no problems at all! So I started the update process on my HTPC as well.

    But it went wrong...


    After searching on Google I had the following things I could try:
    1. Format my pc
    2. Run cmd in administrator mode
      • dism /online /remove-package/packagename:Package_for_KB2919355~31bf3856ad364e35~amd64~~6.3.1.14
      •  dism /online /cleanup-image /startcomponentcleanup
    3. Run cmd in administrator mode
      •  Sfc /scannow
    But they all failed... Now 5 days later Microsoft still hasn't done anything to help us so I went back searching. My last hope before formatting my pc was System Restore. First I tried to set my pc back to the day I installed the update for the first time, April 9. The process started and after reboot I got this screen.
    So I was all like... Okay what now. As I was thinking should I take my Ubuntu live disk for backing up my data and where is my Windows 8.1 setup disk I was thinking lets try it one more time. So I tried System restore again but now I chose March 29 as restore point and it succeeded. I was back at my desktop, great! Then the first thing I did was installing KB2919355. Not from Windows Update but with the stand-alone installer, which can be found here (64 bit) or here (32 bit). And it installed just fine now!

    So why the update failed? Well the only difference when I installed the update on both my HTPC and desktop was the update order. On my desktop I installed all the available updates except KB2919355. After rebooting I installed it. On my HTPC I was all like: "Just install them in one time". So thank you Microsoft for the great update...

    After the update was successfully installed I did the other updates.