Jumat, 28 Juni 2013

aplikasi java perhitungan bangun ruang

asalamualaikum wr..wb..
pada kesempatan kali ini saya akan share perogram java saya yang berjudul"aplikasi perhitungan bagun ruang..
oke,langsung saja kita ke codingnya..

FRAME UTAMA

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import javax.swing.JDesktopPane;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTextField;
import javax.swing.JLabel;




/**
 *
 * @author hasan basri
 */
public class Hitungbngun extends JFrame implements ActionListener {
   
    JFileChooser FileChooser = new JFileChooser();
    Mp3Filter filter = new Mp3Filter();
    ArrayList listSong = new ArrayList();
    JTextField text1 = new JTextField (20);
    JMenu mnukubus = new JMenu ("kubus");
    JMenu mnubalok = new JMenu ("balok");
    JMenu mnutabung = new JMenu ("tabung");
    JMenu mnulimas = new JMenu ("limas");
    JMenu mnubola = new JMenu ("bola");
    JMenu mnukerucut = new JMenu ("kerucut");
    JMenu mnuprisma = new JMenu ("prisma");
    JMenu mnuabout = new JMenu ("About");
    
    JMenuItem open = new JMenuItem("Open");
    JMenuItem itmvlume = new JMenuItem("volume kubus");
    JMenuItem itmluas = new JMenuItem("Luas kubus");
    JMenuItem itmvlumeblk = new JMenuItem("volume balok");
    JMenuItem itmluasblk = new JMenuItem("Luas balok");
    JMenuItem itmvlumetbg = new JMenuItem("volume tabung");
    JMenuItem itmluastbg = new JMenuItem("Luas tabung");
    JMenuItem itmvlumelms = new JMenuItem("volume limas");
    JMenuItem itmluaslms = new JMenuItem("Luas limas");
    JMenuItem itmvlumebola = new JMenuItem("volume bola");
    JMenuItem itmluasbola = new JMenuItem("Luas bola");
    JMenuItem itmvlumekrt = new JMenuItem("volume kerucut");
    JMenuItem itmluaskrt = new JMenuItem("Luas kerucut");
    JMenuItem itmvlumeprm = new JMenuItem("volume prisma");
    JMenuItem itmluasprm = new JMenuItem("Luas prisma");
    JMenuItem itmaboutApp= new JMenuItem ("About Application");
    JMenuItem itmaboutAuthor = new JMenuItem ("About Author");
   
    JLabel lblNewLabel = new JLabel();
    JLabel lblNewLabel1 = new JLabel();
    JLabel lblNewLabel2 = new JLabel(new javax.swing.ImageIcon(getClass().getResource("/hitungbngun/bangunruang2.jpg")));
           
  
    JDesktopPane desk = new JDesktopPane();
      
  
      
    public Hitungbngun () {
        setTitle ("APLIKASI PERHITUNGAN BANGUN RUANG");
        setSize (920,400);
       
       
        setIconImage(Toolkit.getDefaultToolkit().getImage("/Bahan Ngajar/program java/Hitungbngun/src/hitungbngun/lintasberita-32x32.gif"));
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLocationRelativeTo(null);
        setVisible (true);
               
        Buatmenu();
        component();
       
       
       
    }
   
   
   
    void Buatmenu(){
       
        JMenuBar barismenu = new JMenuBar();
        barismenu.setBackground(Color.red);
        setJMenuBar(barismenu);
       
        barismenu.add(mnukubus);
        mnukubus.setBackground(Color.ORANGE);
        barismenu.add(mnubalok);
        mnubalok.setBackground(Color.BLUE);
        barismenu.add(mnutabung);
        mnutabung.setBackground(Color.CYAN);
        barismenu.add(mnulimas);
        mnulimas.setBackground(Color.DARK_GRAY);
        barismenu.add(mnubola);
        mnubola.setBackground(Color.GRAY);
        barismenu.add(mnukerucut);
        mnukerucut.setBackground(Color.GREEN);
        barismenu.add(mnuprisma);
        mnuprisma.setBackground(Color.MAGENTA);
        barismenu.add(mnuabout);
        mnuabout.setBackground(Color.YELLOW);
       
        mnukubus.add(itmvlume).setBackground(Color.red);
        mnukubus.add(itmluas).setBackground(Color.BLUE);
        mnukubus.add(open).setBackground(Color.BLUE);
       
        mnubalok.add(itmvlumeblk).setBackground(Color.red);
        mnubalok.add(itmluasblk).setBackground(Color.ORANGE);
       
        mnutabung.add(itmvlumetbg).setBackground(Color.GREEN);
        mnutabung.add(itmluastbg).setBackground(Color.YELLOW);
       
        mnulimas.add(itmvlumelms).setBackground(Color.PINK);
        mnulimas.add(itmluaslms).setBackground(Color.orange);
       
        mnubola.add(itmvlumebola).setBackground(Color.white);
        mnubola.add(itmluasbola).setBackground(Color.red);
       
        mnukerucut.add(itmvlumekrt).setBackground(Color.yellow);
        mnukerucut.add(itmluaskrt).setBackground(Color.BLUE);
       
        mnuprisma.add(itmvlumeprm).setBackground(Color.red);
        mnuprisma.add(itmluasprm).setBackground(Color.GREEN);
       
        mnuabout.add(itmaboutApp).setBackground(Color.GREEN);
        mnuabout.add(itmaboutAuthor).setBackground(Color.BLUE);
       
       
        getContentPane().add(lblNewLabel2);
        add(lblNewLabel2, BorderLayout.EAST);
        lblNewLabel2.setBounds(20,80,70,20);
        getContentPane().setBackground(Color.getColor(null, Color.TRANSLUCENT));
       
       

      
        desk.setBackground(Color.GREEN);
       
      
        itmvlume.addActionListener(this);
        itmvlumeblk.addActionListener(this);
        itmvlumetbg.addActionListener(this);
        itmvlumelms.addActionListener(this);
        itmluas.addActionListener(this);
        itmluasblk.addActionListener(this);
        itmluastbg.addActionListener(this);
        itmluaslms.addActionListener(this);
        itmluasbola.addActionListener(this);
        itmluaskrt.addActionListener(this);
        itmvlumebola.addActionListener(this);
        itmvlumekrt.addActionListener(this);
        itmaboutApp.addActionListener(this);
        itmaboutAuthor.addActionListener(this);
        itmvlumeprm.addActionListener(this);
        itmluasprm.addActionListener(this);
        open.addActionListener(this);
      
    }
   
   
   
    void component () {
       
        getContentPane().add(desk);
       
       
    }
   
  
   
   
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==itmvlume){
            Vlmekbs h = new Vlmekbs();
            desk.add(h);
            h.show();
        }
       
        else if (e.getSource()==itmvlumeblk){
            vlmeblk s = new vlmeblk();
            desk.add(s);
            s.show();
        }
       
        else if (e.getSource()==itmvlumetbg){
            vlmetbg n = new vlmetbg();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmluas){
            luaskbs n = new luaskbs();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmluasblk){
            luasblk n = new luasblk();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmluastbg){
            luastbg n = new luastbg();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmluaslms){
            luaslms n = new luaslms();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmvlumelms){
            vlmelms n = new vlmelms();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmvlumebola){
            Vlumebola n = new Vlumebola();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmvlumekrt){
            vlmekrc n = new vlmekrc();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmluasbola){
            luasbola n = new luasbola();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmluaskrt){
            luaskrc n = new luaskrc();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmvlumeprm){
            vlumeprs n = new vlumeprs();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmluasprm){
            luasprs n = new luasprs();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==itmaboutAuthor){
            Full n = new Full();
            desk.add(n);
            n.show();
        }   
        else if (e.getSource()==itmaboutApp){
            App n = new App();
            desk.add(n);
            n.show();
        }
        else if (e.getSource()==open){
        FileChooser.setFileFilter(filter);
        FileChooser.setMultiSelectionEnabled(true);
        int fileValid = FileChooser.showOpenDialog(open);
        if (fileValid == javax.swing.JFileChooser.CANCEL_OPTION) {
            return;
           
        }
        else if(fileValid == javax.swing.JFileChooser.APPROVE_OPTION) {
            File file = FileChooser.getSelectedFile();
            listSong.add(file);  
        }
        }
       
    }

   
   
    public static void main (String[]args){
        Hitungbngun m = new Hitungbngun ();
    }

       
}




setelah frame utama kita buat internalframenya..

INTERNAL FRAME LUAS BALOK

import java.awt.*;
import java.awt.event.*;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
import javax.swing.JInternalFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;


public class luasblk extends JInternalFrame implements ActionListener {
 TextField txtPanjang, txtLebar, txtHasil,txttinggi,txtrms;
 Button btnHitung,btnReset,btnSimpan;
 Label lblPanjang, lblLebar, lblHasil,lbltinggi,lblrms;
 double hasil;
 DefaultListModel lmodel;
     JList list = new JList();


 public luasblk(){
     super("Luas balok",true,true,true,true);
    
     Icon h = null;
     try {
     h = new javax.swing.ImageIcon(getClass().getResource("/hitungbngun/balok.jpg"));
     } catch (Exception e) {
         e.printStackTrace();
     }
     setFrameIcon(h);
    
     Panel panelhasan   = new Panel();
     Panel panelbasri = new Panel();
     Panel panelhb = new Panel();
    
     lmodel = new DefaultListModel();
        list = new JList(lmodel);
        JScrollPane scroll = new JScrollPane(list);
        scroll.setBounds(30,40,50,20);
        this.add(scroll);
    
    
     panelhasan.setLayout(new GridLayout(7, 1));
     panelhasan.add(lblPanjang = new Label("Panjang: "));
     panelhasan.add(lblLebar   = new Label("Lebar: "));
     panelhasan.add(lbltinggi   = new Label("tinggi: "));
     panelhasan.add(new Label());
     panelhasan.add(lblHasil   = new Label("Volume: "));
     panelhasan.add(lblrms   = new Label("RUMUS: "));
 
     panelbasri.setLayout(new GridLayout(7, 1));
     panelbasri.add(txtPanjang = new TextField(""));
     panelbasri.add(txtLebar   = new TextField());
     panelbasri.add(txttinggi   = new TextField());
     panelbasri.add(btnHitung  = new Button("Hitung"));
     btnHitung.setBackground(Color.red);
     panelbasri.add(txtHasil   = new TextField());
     panelbasri.add(txtrms   = new TextField("2*(P*L+L*T+P*T)"));
    
     panelhb.setLayout(new GridLayout(4, 1));
     panelhb.add(btnReset=new Button("Reset"));
     btnReset.setBackground(Color.red);
     panelhb.add(btnSimpan=new Button("Simpan"));
     btnSimpan.setBackground(Color.red);
     panelhb.add(scroll);
    
    
     getContentPane().setBackground(Color.red);
     btnHitung.addActionListener(this);
     btnSimpan.addActionListener(this);
     btnReset.addActionListener(this);    
     add(panelhasan, BorderLayout.WEST);
     add(panelbasri, BorderLayout.CENTER);
     add(panelhb, BorderLayout.EAST);
    
               
     setSize(500,300);
     setVisible(true);
 }

 public void actionPerformed(ActionEvent e) {
     if (e.getSource().equals(btnHitung)) {
         hasil = 2 * (Double.parseDouble(txtPanjang.getText()) * Double.parseDouble(txtLebar.getText())
                 +Double.parseDouble(txtPanjang.getText()) * Double.parseDouble(txttinggi.getText())+
                 Double.parseDouble(txttinggi.getText()) * Double.parseDouble(txtLebar.getText()));
         txtHasil.setText(""+hasil);

         }else if(e.getSource() == btnSimpan){
              lmodel.addElement("Panjang   :" +   txtPanjang.getText());
              lmodel.addElement("Lebar   :" +   txtLebar.getText());
              lmodel.addElement("tinggi   :" +   txttinggi.getText());
              lmodel.addElement("Luas Balok   :" +   txtHasil.getText());
        
                 
         }else if(e.getSource() == btnReset){
              txtPanjang.setText(" ");
              txtLebar.setText(" ");
              txttinggi.setText(" ");
              txtHasil.setText(" ");
          }else {
            this.dispose();
          }
        
     }
 }

INTERNAL FRAME VOLUME BALOK

import java.awt.*;
import java.awt.event.*;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
import javax.swing.JInternalFrame;
import javax.swing.JList;
import javax.swing.JScrollPane;

public class vlmeblk extends JInternalFrame implements ActionListener {
 TextField txtPanjang, txtLebar, txtHasil,txttinggi,txtrms;
 Button btnHitung,btnReset,btnSimpan;
 Label lblPanjang, lblLebar, lblHasil,lbltinggi,lblrms;
 double hasil;
 DefaultListModel lmodel;
     JList list = new JList();


 public vlmeblk(){
     super("volume balok",true,true,true,true);
    
     Icon h = null;
     try {
     h = new javax.swing.ImageIcon(getClass().getResource("/hitungbngun/balok.jpg"));
     } catch (Exception e) {
         e.printStackTrace();
     }

     setFrameIcon(h);
     Panel panelhasan   = new Panel();
     Panel panelbasri = new Panel();
     Panel panelhb = new Panel();

     lmodel = new DefaultListModel();
        list = new JList(lmodel);
        JScrollPane scroll = new JScrollPane(list);
        scroll.setBounds(30,40,50,20);
        this.add(scroll);
    
     panelhasan.setLayout(new GridLayout(7, 1));
     panelhasan.add(lblPanjang = new Label("Panjang: "));
     panelhasan.add(lblLebar   = new Label("Lebar: "));
     panelhasan.add(lbltinggi   = new Label("tinggi: "));
     panelhasan.add(new Label());
     panelhasan.add(lblHasil   = new Label("Volume: "));
     panelhasan.add(lblrms   = new Label("RUMUS: "));
 
     panelbasri.setLayout(new GridLayout(7, 1));
     panelbasri.add(txtPanjang = new TextField(""));
     panelbasri.add(txtLebar   = new TextField());
     panelbasri.add(txttinggi   = new TextField());
     panelbasri.add(btnHitung  = new Button("Hitung"));
     btnHitung.setBackground(Color.red);
     panelbasri.add(txtHasil   = new TextField());
     panelbasri.add(txtrms   = new TextField("panjang*lebar*tinggi"));

     panelhb.setLayout(new GridLayout(4, 1));
     panelhb.add(btnReset=new Button("Reset"));
     btnReset.setBackground(Color.red);
     panelhb.add(btnSimpan=new Button("Simpan"));
     btnSimpan.setBackground(Color.red);
     panelhb.add(scroll);
     getContentPane().setBackground(Color.red);
     btnHitung.addActionListener(this);
     btnSimpan.addActionListener(this);
     btnReset.addActionListener(this);    
    
    
     add(panelhasan, BorderLayout.WEST);
     add(panelbasri, BorderLayout.CENTER);
     add(panelhb, BorderLayout.EAST);
    
     setSize(500,300);
     setVisible(true);
 }

 public void actionPerformed(ActionEvent e) {
     if (e.getSource().equals(btnHitung)) {
         hasil = Double.parseDouble(txtPanjang.getText()) * Double.parseDouble(txtLebar.getText()) *
                 Double.parseDouble(txttinggi.getText());
         txtHasil.setText(""+hasil);
         }else if(e.getSource() == btnSimpan){
              lmodel.addElement("Panjang   :" +   txtPanjang.getText());
              lmodel.addElement("Lebar   :" +   txtLebar.getText());
              lmodel.addElement("tinggi  :" +   txttinggi.getText());
              lmodel.addElement("Volume Balok   :" +   txtHasil.getText());
        
     }else if(e.getSource() == btnReset){
              txtPanjang.setText(" ");
              txtLebar.setText(" ");
              txttinggi.setText(" ");
              txtHasil.setText(" ");
          }else {
            this.dispose();
          }
        
     }
 }

selanjutnya buat internal frame luas dan volume kubus,luas dan volume kerucut,luas dan volume bola dll..
untuk lebih jelas download saja projeknya DISINI

adapun hasinya seperti ini


Jumat, 01 Maret 2013

contoh awt java

asalamualaikum..wr.wb

pada kesempatan kali ini saya akan membagi contoh  program awt java..

source kodenya:

import java.awt.*;
public class Buah {
public static void main(String[]args){
Frame myFrame=new Frame("Demo program AWT");
myFrame.setLayout(new BorderLayout());
Label topLabel=new Label("title pilihan buah");
myFrame.add(topLabel,BorderLayout.NORTH);
Panel horizPanel=new Panel(new BorderLayout());
Label leftLabel=new Label("buah");
horizPanel.add(leftLabel,BorderLayout.WEST);
Choice myChoice=new Choice();
myChoice.add("mangga");
myChoice.add("pisang");
myChoice.add("jeruk");
myChoice.add("apple");
myChoice.add("anggur");
horizPanel.add(myChoice,BorderLayout.EAST);
myFrame.add(horizPanel,BorderLayout.SOUTH);
myFrame.setSize(300,200);
myFrame.show();

}   
    
}

setelah di run hasilnya seperti:

membuat menu di java

assalamualikum..wr.wb..
selamat siang sahabat blog asyik..:)
pada kesmpatan kali ini saya akan share source code untuk membuat menu..


import java.awt.*;
   
    import java.awt.event.*;
   
    import javax.swing.*;
   
    public class Menu extends JFrame {
   
        private JMenuBar bar;
   
        private JMenu mnuFile, mnuHelp, submnuNew;
   
        private JMenuItem itemNew, itemOpen, itemExit, itemAbout, itemHelp,
   
            subitemFile, subitemProject;
   
        public Menu() {
   
            super ("Membuat menu");
   
            bar = new JMenuBar();
   
            setJMenuBar (bar);
   
            mnuFile = new JMenu ("File");
   
            mnuFile.setMnemonic('F');
   
            mnuHelp = new JMenu ("Help");
   
            mnuHelp.setMnemonic('H');
   
            submnuNew = new JMenu ("New");
   
            submnuNew.setMnemonic('N');
   
            mnuFile.add(submnuNew);
   
            subitemFile = new JMenuItem ("File...");
   
            subitemFile.setIcon(new ImageIcon("images/new.gif"));
   
            subitemFile.setAccelerator(KeyStroke.getKeyStroke(
   
                KeyEvent.VK_N, ActionEvent.CTRL_MASK));
   
            subitemFile.addActionListener(
   
                new ActionListener() {
   
                    public void actionPerformed(ActionEvent e) {
   
                        JOptionPane.showMessageDialog(null, "New File");
   
                    }
   
                }
   
            );
   
            submnuNew.add(subitemFile);
   
            subitemProject = new JMenuItem ("Project...");
   
            subitemProject.setMnemonic ('P');
   
            submnuNew.add(subitemProject);
   
            itemOpen = new JMenuItem ("Open");
   
            itemOpen.setMnemonic('O');
   
            mnuFile.add(itemOpen);
   
            mnuFile.addSeparator();
   
            itemExit = new JMenuItem ("Exit");
   
            itemExit.setMnemonic('E');
   
            itemExit.addActionListener(
   
                new ActionListener() {
   
                    public void actionPerformed(ActionEvent e) {
   
                        if (JOptionPane.showConfirmDialog(null,"Apakah Anda yakin akan keluar?",
   
                            "Konfirmasi",JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE)
   
                            == JOptionPane.OK_OPTION) {
   
                            System.exit(0);
   
                        }
   
                    }
   
                }
   
            );
   
            mnuFile.add(itemExit);
   
            itemHelp = new JMenuItem ("Help");
   
            itemHelp.setIcon(new ImageIcon("images/help.gif"));
   
            itemHelp.setMnemonic('e');
   
            mnuHelp.add(itemHelp);
   
            itemAbout = new JMenuItem ("About");
   
            itemAbout.setMnemonic('A');
   
            itemAbout.setIcon(new ImageIcon("images/info.gif"));
   
            mnuHelp.add(itemAbout);
   
            bar.add(mnuFile);
   
            bar.add(mnuHelp);
   
            setSize (400,200);
   
            setLocationRelativeTo(null);
   
            setVisible (true);
   
        }
   
        public static void main (String args[]) {
   
            JFrame.setDefaultLookAndFeelDecorated(true);
   
            Menu test = new Menu();
   
            test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   
        }
   
    }


setelah di run akan seperti


 


Kamis, 28 Februari 2013

pasang iklan di blog

assalamualaikum...

selamat pagi sahabat blog asyik...:)...:)
pada kesempatan kali ini saya mau share tentang memasang iklan di blog nih...
pasti kalian yang mempunyai blog ingin mempunyai iklan di blognya...
nah..nih ada ppc yang mudah untuk para blogger..
stepnya..:
1.  klik iklan blog
2   klik join publisher
3   isi biodata
4   setelah selesai semua kita tunggu konfirmmasi dari ppc lewat email
5   setelah dapat konfirm kita buat
     zona iklan
    

  pilih jenis iklan terus submit....


setelah ajukan muncul kode html dan copaz di blog anda...


sekian saja info dari saya semoga bermanfaat..amin..thank..:))

Sabtu, 16 Februari 2013

mendapt pulsa gratis all operator

selamat siang semua sahabat blog asik....
siapa si yang ga mau mendapat pulsa apalagi gratis...

semua pasti mau kan ayo yang mau..???
buruan klik..

pulsa gratis

sekian saja info dari saya..semoga anda berhasil mendapatkan pulsa gratis..:)

Jumat, 14 Desember 2012

ENetwork Basic Configuration PT Practice SBA

CISCO NETWORKING ACADEMY – ENetwork Basic Configuration PT Practice SBA – QUESTIONS
A few things to keep in mind while completing this activity:
1. Do not use the browserBac k button or close or reload any Exam windows during the exam.
2. Do not close Packet Tracer when you are done. It will close automatically.
3. Click the Submit Assessment button to submit your work.

Introduction
In this practice Packet Tracer Skills Exam, you will:
 finish connecting the devices
 design and implement an addressing scheme to meet stated requirements
 configure, verify, and troubleshoot connectivity between all devices in the network
Addressing Table

NOTE: The initial network has some errors. To aid in configuring and verifying the devices as well troubleshooting the existing errors, use a printed version of these instructions to fill inthe missing address information in the table during Step 2.

Step 1: Connect the Devices.
Connect the following devices using the appropriate cable:
a. Connect PC1 to Switch1.
b. Connect Switch1 to the Fa0/0 interface on Router1.
c. Connect Switch2 to the Fa0/1 interface on Router1.
d. Connect PC1 to the Router1 console port.

Step 2: Determine the IP Addressing Scheme.
Design an addressing scheme and fill in the Addressing Table based on the following requirements:
a. Subnet the address space 172.16.1.0/24 to provide 30 host addresses for LAN 1 while wasting the least amount of address space.
b. Assign the first available subnet to LAN 1.
c. Assign the lowest (first) host address in this subnet to the Fa0/0 interface on Router1.
d. Assign the second address in this subnet to the VLAN 1 interface on Switch1.
e. Assign the highest (last) host IP address in this subnet to PC1.
f. Using the next available subnet, further subnet it to provide 10 host addresses for LAN2 while wasting the least amount of address space.
g. Assign the lowest (first) host address in the LAN2 subnet to the Fa0/1 interface on Router1.

Step 3: Configure Router1.
a. Configure Router1 with the following basic parameters:
· The router name is Router1.
· The privileged EXEC mode uses the following encrypted password: class
· Enable Telnet and console line login using the following password: cisco
· Configure the banner message-of-the-day as Authorized access only!
b. Configure the two Fast Ethernet interfaces, including addressing and a description.
c. Close the terminal window after completing the router configuration.

Step 4: Configure Switch1 and Verify Connectivity.
a. Remove the console connection between PC1 and Router1.
b. Connect PC1 to the Switch1 console port.
c. Configure Switch1 with the following basic parameters:
· The switch name is Switch1
· The privileged EXEC mode uses the following encrypted password: class
· Enable Telnet and console line login using the following password: cisco
· Configure the banner message-of-the-day as Authorized access only!
d.Configure interface VLAN 1 and default gateway for Switch1.
e.Switch1 should be able to ping the default gateway.

Step 5: Configure and Verify PC1 Addressing.
a. Using the IP addressing you determined in Step 2, configure PC1 with the correct addressing.
b. PC1 should be able to ping the default gateway.

Step 6: Verify and Troubleshoot End-to-End Connectivity.
Verify that PC1 is able to ping PC2. If the ping fails, locate and correct any errors. For example, make sure PC2 is configured correctly with appropriate addressing for the subnet it belongs to.


ENetwork Basic Configuration PT Practice SBA  -  ANSWERS


Step 1: Connect the Devices.
Connect the following devices using the appropriate cable:
a. Connect PC1 to Switch1.
b. Connect Switch1 to the Fa0/0 interface on Router1.
c. Connect Switch2 to the Fa0/1 interface on Router1.
d. Connect PC1 to the Router1 console port.


Step 2: Determine the IP Addressing Scheme.

Design an addressing scheme and fill in the Addressing Table based on the following requirements:

a. Subnet the address space 172.16.1.0/24 to provide 30 host addresses for LAN 1 while wasting the least amount of address space.
b. Assign the first available subnet to LAN 1.
c. Assign the lowest (first) host address in this subnet to the Fa0/0 interface on
Router1.
d. Assign the second address in this subnet to the VLAN 1 interface on Switch1
e. Assign the highest (last) host IP address in this subnet to PC1.
f. Using the next available subnet, further subnet it to provide 10 host addresses for LAN2 while wasting the least amount of address space.
g. Assign the lowest (first) host address in the LAN2 subnet to the Fa0/1 interface on Router1.

Step 3: Configure Router1.

a. Configure Router1 with the following basic parameters:
The router name is Router1.
Router>enable
Router#config terminal
Router(config)#hostname Router1
The privileged EXEC mode uses the following encrypted password: class
Router1(config)#enable secret class
Router1(config)#service password-encryption
Router1(config)#line console 0
Router1(config) #password cisco
Router1(config)#login
Enable Telnet and console line login using the following password: cisco
Router1(config)#line vty 0 4
Router1(config-line)#password cisco
Router1(config-line)#login
Router1(config-line)#exit
Configure the banner message-of-the-day as Authorized access only!
Router1(config)#banner motd # Authorized access only! #

b. Configure the two Fast Ethernet interfaces, including addressing and a description.
Router1(config)#interface fastethernet 0/0
Router1(config-if)#ip addres 172.16.1.1 255.255.255.224
Router1(config-if)#description LAN1
Router1(config-if)#no shutdown
Router1(config-if)#exit

Router1(config)#interface fastethernet 0/1
Router1(config-if)#ip addres 172.16.1.33 255.255.255.240
Router1(config-if)#description LAN2
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#exit
Router1#write
c. Close the terminal window after completing the router configuration.

Step 4: Configure Switch1 and Verify Connectivity.
a. Remove the console connection between PC1 and Router1.
b. Connect PC1 to the Switch1 console port.
c. Configure Switch1 with the following basic parameters:
The switch name is Switch1
Switch>enable
Swich#config terminal
Switch(config)#hostname Switch1
The privileged EXEC mode uses the following encrypted password: class
Switch1(config)#enable secret class
Switch1(config)#service password-encryption
Switch1(config)#line console 0
Switch1(config)#password cisco
Switch1(config)#login
Enable Telnet and console line login using the following password: cisco
Switch1(config)#line vty 0 15
Switch1(config-line)#password cisco
Switch1(config-line)#login
Switch1(config-line)#exit
Configure the banner message-of-the-day as Authorized access only!
Switch1(config)#banner motd # Authorized access only! #

d. Configure interface VLAN 1 and default gateway for Switch1.
Switch1(config)#ip default-gateway 172.16.1.1
Switch1(config)#interface vlan 1
Switch1(config-if)#ip address 172.16.1.2 255.255.255.224
Switch1(config-if)#no shutdown
Switch1(config-if)#exit

e. Switch1 should be able to ping the default gateway.

Step 5: Configure and Verify PC1 Addressing.
a. Using the IP addressing you determined in Step 2, configure PC1 with the correct
addressing.
b. PC1 should be able to ping the default gateway.

Step 6: Verify and Troubleshoot End-to-End Connectivity.
Verify that PC1 is able to ping PC2. If the ping fails, locate and correct any errors. For example, make sure PC2 is configured correctly with appropriate addressing for the subnet it belongs to.
* Replace cable to PC2 with a direct SW2.

The result is 100%.