Setting up Vitrual Lab

Viewing 16 reply threads
  • Author
    Posts
    • #1394
      vp75
      Participant

      quote author=blackazarro link=topic=1369.msg4977#msg4977 date=1180737930]

      Vp75, it appears that you’re a bit confuse and that’s ok. I was also confuse when I started to learn about VMware and virtual machines. I encourage you to reread Negrita’s article carefully. What ever linux distro you download, you have to use a virtualization software in order to convert it to a virtual machines. Then use the VMware Player to boot-up the linux OS or whatever OS you interested in.

      As for the knoppix distro, download the iso image and burned this to a cd. In your burning cd software, make sure to choose the option for burning iso image to a cd. Then use VMware Server or VMX Builder as I mentioned before, to create the virtual machine. This step here is similar to installing a OS on your system but you are doing it virtually. I haven’t used knoppix for while but I think this distro does have an option to install it on a hard drive.

      After successfully installing knoppix virtually you can add scripts, download applications and configure settings in your virtual machine and this will be saved.

      Suse and Knoppix are two different linux distribution, for complete info refer to the following links:

      http://en.wikipedia.org/wiki/SUSE_Linux
      http://en.wikipedia.org/wiki/Knoppix

      Vp75, if you still having problems in creating and playing virtual machines, I recommend that you check EH-NET forums for any information that will help you on the subject or create a new forum topic so we can address your problems there. I would like to keep this forum topic CEH related ūüėȬ† ,thanks.
      [/quote]

      Hi blackazarro ,

      Thanks for your reply, as it is about setting up virtual lab iam taking this as a new topic , hope iam in right place now.

      blackazarro , i installed knoppix 5.1.0 and downloaded 5.1.0 iso live cd and renamed as per negrita post and able to open knoppix in vmplayer. Iam able to ping both side and i have got the ethernet selection as NAT, Anyway dynamic ipaddress is assigned to virtual pc and am able to ping both the host & guest, but not able to use internet or connect to internet in virtual pc, iam  not sure of what setting needs to be done in knoppix.

      Also iam not able to save any desktop configuration in virtual pc, does it needs to be with any write permission, bcoz when i tried setting read/write permission i had message saying it should be mounted….! how does virtual pc have space to store scripts…?

      Does any one have idea….or clue about it,

      Cheers
      Vp75

    • #12960
      blackazarro
      Participant

      Hi vp75,

      First of all, I need some information from you so I can continue troubleshooting your problem.

      1. What is your host OS (the physical, real OS running on your computer)?

      2. What is your guest OS (this is the OS that you want to run virtually from your host OS)?

      3. Are you booting the guest OS using the VMware playrer via a preinstalled virtual machine (installed guest OS using virtualization software like VMware Server or VMX builder) or from an iso image?

      4. Did your create your virtual lab at home and are you using a SOHO router?

    • #12961
      lastdojo
      Participant

      I recommend VirtualBox (it seems you’re having problems with VMWare)

      http://www.virtualbox.org

      It’s pretty easy to configure, saves you the hassle of working with VMWare images.

    • #12962
      vp75
      Participant

      @blackazarro wrote:

      Hi vp75,

      First of all, I need some information from you so I can continue troubleshooting your problem.

      1. What is your host OS (the physical, real OS running on your computer)?

      2. What is your guest OS (this is the OS that you want to run virtually from your host OS)?

      3. Are you booting the guest OS using the VMware playrer via a preinstalled virtual machine (installed guest OS using virtualization software like VMware Server or VMX builder) or from an iso image?

      4. Did your create your virtual lab at home and are you using a SOHO router?

      Hi

      Oops, i should have provided these information before i write the query, anyway,

      1. My Host is Windows XP Home edition,
      2. I want to run Knoppix 5.1.0 version.
      I downloaded Knoppix 5.1.0 virtual machine thru link provided by vmware website, it had set of files .nvram, .vmdk, .vmx and one livecd.iso(this is just a dummy iso file and needed to download orinial .iso file from knoppix.net which i downloaded and renamed as livecd.iso)
      Everything was placed in directory as given in negrita on vmware setting up article)
      3. iam booting guest OS thru vmplayer where it asks to open .vmx file and from there it checks for livecd.iso image file and boots it, there is no vmserver or i didnt create thru vmx builder.)
      4. No i didnt create using vmx builder.

      Hope this helps,

      Cheers
      Vp75

    • #12963
      blackazarro
      Participant

      Ok, now that I have a clear picture of basically what you have setup as of now, lets proceed with your problem. We are going to tackle this one step at a time.

      Let start first with the problem that you are having saving configurations settings and data on your Knoppix OS. Based on the information that you’ve provided, if you boot Knoppix using the iso image then all your settings, softwares or scripts won’t be saved, that is because all this information is being temporarily¬† stored into your computer’s ROM. As soon you shutdown Knoppix all this data is lost. Some Linux distros that are designed to function as a live cd will usually have sets of commands to save this data to a media disk, for instance, a usb flash drive. When you boot the system up with the usb plugged in to your computer, you’ll then execute the appropriates commands to restore your saved settings. This is kind of a hassle so I preferred to use VMware or VMX Builder to create a virtual machine by installing the OS onto a virtual hard drive. For an example, please refer to Irongeek’s video on how to do this with VMX Builder. In that way, every time you configure a setting or download a software, this data will be saved on your virtual hard drive where your virtual machine resides.

      I will like to mention that some virtual appliances that you see in VMware website are preconfigured to use the OS iso image and others are created as vitural machines. The virtual machine has a VMware virtual disk file (with file extension .vmdk). The VMware player uses either the iso image or virtual disk file to boot the OS.

      After you’ve solved this problem we’ll go ahead and try to fix your internet connection problems.

      Note: I’m not an expert in VMware or virtualization software so if anybody finds errors on what I’ve written, please jump in and correct me. Thanks

    • #12964
      vp75
      Participant

      Hi blackazarro

      thanks for your reply, i think i would prefer to install it in virtual pc and go on with that, and with virtual workstation or virtual server i think i will be able to achieve that. Will be installing this today and will try it. Will keep updating you about it soon….

      CHeers
      Vp75

    • #12965
      vp75
      Participant

      @blackazarro wrote:

      Ok, now that I have a clear picture of basically what you have setup as of now, lets proceed with your problem. We are going to tackle this one step at a time.

      Let start first with the problem that you are having saving configurations settings and data on your Knoppix OS. Based on the information that you’ve provided, if you boot Knoppix using the iso image then all your settings, softwares or scripts won’t be saved, that is because all this information is being temporarily¬† stored into your computer’s ROM. As soon you shutdown Knoppix all this data is lost. Some Linux distros that are designed to function as a live cd will usually have sets of commands to save this data to a media disk, for instance, a usb flash drive. When you boot the system up with the usb plugged in to your computer, you’ll then execute the appropriates commands to restore your saved settings. This is kind of a hassle so I preferred to use VMware or VMX Builder to create a virtual machine by installing the OS onto a virtual hard drive. For an example, please refer to Irongeek’s video on how to do this with VMX Builder. In that way, every time you configure a setting or download a software, this data will be saved on your virtual hard drive where your virtual machine resides.

      I will like to mention that some virtual appliances that you see in VMware website are preconfigured to use the OS iso image and others are created as vitural machines. The virtual machine has a VMware virtual disk file (with file extension .vmdk). The VMware player uses either the iso image or virtual disk file to boot the OS.

      After you’ve solved this problem we’ll go ahead and try to fix your internet connection problems.

      Note: I’m not an expert in VMware or virtualization software so if anybody finds errors on what I’ve written, please jump in and correct me. Thanks

      Hi blackazarro

      Atlast got Virtual workstation and alloted 5GB space for SUSE linux initially to start with. Now everything is fine except the net connection setup…guys pls help me to move forward on setting the net access in linuz, FYI i have got the NAT setup in virtual pc, i tried giving entry for default gateway, still couldnt get it, tried pinging my windows pc (host) it recognizes…..so ….not sure where iam missing entry….

      Cheers
      Vp75

    • #12966
      blackazarro
      Participant

      Awesome, now that you got that out of the way can you please provide us some additional info:

      1) Run a command DOS in your host OS and type the following command:

      ipconfig /all 

      2) On your guess OS open a new shell and type the following two commands:

      ifconfig
      netstat -nr

      For each command please post the results so I can analyze them.

    • #12967
      vp75
      Participant

      Hi Blackzarro

      ifconfig in linux didnt fetch me any result, , i got error message as
      bash: ifconfig : command not found. But when i try man ifconfig it displays help information on ifconfig command, so couldnt get details about linux config details,
      Got details about host OS with ipconfig/all


      Windows IP Configuration

              Host Name . . . . . . . . . . . . : XXX
              Primary Dns Suffix  . . . . . . . :
              Node Type . . . . . . . . . . . . : Unknown
              IP Routing Enabled. . . . . . . . : No
              WINS Proxy Enabled. . . . . . . . : No

      Ethernet adapter VMware Network Adapter VMnet8:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
      VMnet8
              Physical Address. . . . . . . . . : 00-50-56-C0-00-08
              Dhcp Enabled. . . . . . . . . . . : No
              IP Address. . . . . . . . . . . . : 192.168.36.1
              Subnet Mask . . . . . . . . . . . : 255.255.255.0
              Default Gateway . . . . . . . . . :

      Ethernet adapter VMware Network Adapter VMnet1:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
      VMnet1
              Physical Address. . . . . . . . . : 00-50-56-C0-00-01
              Dhcp Enabled. . . . . . . . . . . : No
              IP Address. . . . . . . . . . . . : 192.168.145.1
              Subnet Mask . . . . . . . . . . . : 255.255.255.0
              Default Gateway . . . . . . . . . :

      Ethernet adapter Local Area Connection:

              Media State . . . . . . . . . . . : Media disconnected
              Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Ethernet NIC
              Physical Address. . . . . . . . . : 00-0D-61-ED-F0-CE

      Ethernet adapter AGN Virtual Network Adapter:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : AGN Virtual Network Adapter
              Physical Address. . . . . . . . . : 00-00-00-00-00-01
              Dhcp Enabled. . . . . . . . . . . : No
              IP Address. . . . . . . . . . . . : 0.0.0.0
              Subnet Mask . . . . . . . . . . . : 0.0.0.0
              Default Gateway . . . . . . . . . :

      Ethernet adapter Wireless Network Connection:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : NETGEAR WG111T 108Mbps Wireless 2.0 Adapter
              Physical Address. . . . . . . . . : 00-14-6C-5D-C7-DA
              Dhcp Enabled. . . . . . . . . . . : Yes
              Autoconfiguration Enabled . . . . : Yes
              IP Address. . . . . . . . . . . . : 192.168.0.2
              Subnet Mask . . . . . . . . . . . : 255.255.255.0
              Default Gateway . . . . . . . . . : 192.168.0.1
              DHCP Server . . . . . . . . . . . : 192.168.0.1
              DNS Servers . . . . . . . . . . . : xx.xx.xx.xx
                                                  xx.xx.xx.xx
              Lease Obtained. . . . . . . . . . : 07 June 2007 20:56:02
              Lease Expires . . . . . . . . . . : 10 June 2007 20:56:02


      Hope this wil help me….

      Updating @17:00 GMT – ifconfig executed only when iam logged in as root, couldnt copy & paste the details across Guest OS to Host OS…will post it soon.

      CHeers
      Vp75

    • #12968
      blackazarro
      Participant

      As mentioned in http://www.linuxcommand.org:

      When you type in the name of a command, the system does not search the entire computer to find where the program is located. That would take a long time. You have noticed that you don’t usually have to specify a complete path name to the program you want to run, the shell just seems to know.

      Well, you are right. The shell does know. Here’s how: the shell maintains a list of directories where executable files (programs) are kept, and just searches the directories in that list. If it does not find the program after searching each directory in the list, it will issue the famous command not found error message.

      This list of directories is called your path. You can view the list of directories with the following command:

      [me@linuxbox me]$ echo $PATH

      This will return a colon separated list of directories that will be searched if a specific path name is not given when a command is attempted.

      You can add directories to your path with the following command, where directory is the name of the directory you want to add:

      [me@linuxbox me]$ export PATH=$PATH:directory

      A better way would be to edit your .bash_profile file to include the above command. That way, it would be done automatically every time you log in.

      Most modern Linux distributions encourage a practice in which each user has a specific directory for the programs he/she personally uses. This directory is called bin and is a subdirectory of your home directory. If you do not already have one, create it with the following command:

      [me@linuxbox me]$ mkdir bin

      Move your script into your new bin

      With this information we can do the following: (example):

      bob@bob-desktop:~$ whereis ifconfig
      ifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz
      bob@bob-desktop:~$ echo $PATH
      /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/games

      Notice that directory /sbin/ is not included in my $PATH environment variable, so if I execute the ifconfig command it will give me an error message similar to yours.

      I can manually execute the command including its absolute path like so:

      /sbin/ifconfig

      or add this directory to my $PATH so  every time I execute this command the shell can find it:

      export PATH=$PATH:/sbin

      and now I should have it include in my $PATH:

      bob@bob-desktop:~$ echo $PATH
      /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/sbin

      Remember to include the netstat -nr result for your guest OS and also, I recommend that you visit the above link to learn the basic linux commands.

    • #12969
      vp75
      Participant

      Hi Blackzarro

      Thanks for ur reply , i got the ifconfig details, stored it as a file, but couldnt copy it across copy&paste to windows from virtual pc or not sure how to bring the stored file from vmware to windows….!
      will post very soon,
      cheers
      Vp75

    • #12970
      blackazarro
      Participant

      I think there’s a VMware tool that you can install for SUSE that will let you copy and paste between guest and host. Google it to find it. Also, you can always use a usb flash drive.

      If it’s to much trouble for you, just give me the interface (e.g. eth0), IP address and submask.

    • #12971
      Anonymous
      Participant

      use SCP to move the file(s) between your host and guest Operating Systems.

    • #12972
      vp75
      Participant

      Hi ChrisG

      Thanks for ur help.

      hi Blackzarro

      Atlast you would be surprised to hear this, iam posting this reply from Suse linux broswer (konqueror) ;D

      I was not sure how it was configured to access net, i suspect i installed dhcp configuration from suse dvd and from there it started working. I hope it didnt had proper dhcp modules to extract or not sure iam bluffing something dumb….

      Now to the problem side,

      I couldnt open 192.168.0.1 router configuration admin page…..! not sure whats happening.

      Anyway as u requested iam posting the ifconfig -a command execution:

      eth0      Link encap:Ethernet  HWaddr 00:0C:29:A4:D2:FB
                inet addr:192.168.0.128  Bcast:192.168.0.255  Mask:255.255.255.0
                inet6 addr: fe80::20c:29ff:fea4:d2fb/64 Scope:Link
                UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:612 errors:0 dropped:0 overruns:0 frame:0
                TX packets:398 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000
                RX bytes:296580 (289.6 Kb)  TX bytes:53178 (51.9 Kb)
                Interrupt:10 Base address:0x2024

      lo        Link encap:Local Loopback
                inet addr:127.0.0.1  Mask:255.0.0.0
                inet6 addr: ::1/128 Scope:Host
                UP LOOPBACK RUNNING  MTU:16436  Metric:1
                RX packets:50 errors:0 dropped:0 overruns:0 frame:0
                TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
                RX bytes:3260 (3.1 Kb)  TX bytes:3260 (3.1 Kb)

      sit0      Link encap:IPv6-in-IPv4
                NOARP  MTU:1480  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

      And here comes Netstat -nr:
      Kernel IP routing table
      Destination    Gateway        Genmask        Flags  MSS Window  irtt Iface
      192.168.0.0    0.0.0.0        255.255.255.0  U        0 0          0 eth0
      169.254.0.0    0.0.0.0        255.255.0.0    U        0 0          0 eth0
      127.0.0.0      0.0.0.0        255.0.0.0      U        0 0          0 lo
      0.0.0.0        192.168.0.2    0.0.0.0        UG        0 0          0 eth0

      And here is ipconfig/all from Host windows xp home
      Windows IP Configuration

              Host Name . . . . . . . . . . . . : Vp
              Primary Dns Suffix  . . . . . . . :
              Node Type . . . . . . . . . . . . : Unknown
              IP Routing Enabled. . . . . . . . : No
              WINS Proxy Enabled. . . . . . . . : No

      Ethernet adapter Local Area Connection:

              Media State . . . . . . . . . . . : Media disconnected
              Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Eth
      ernet NIC
              Physical Address. . . . . . . . . : 00-0D-61-ED-F0-CE

      Ethernet adapter VMware Network Adapter VMnet8:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
      VMnet8
              Physical Address. . . . . . . . . : 00-50-56-C0-00-08
              Dhcp Enabled. . . . . . . . . . . : Yes
              Autoconfiguration Enabled . . . . : Yes
              IP Address. . . . . . . . . . . . : 0.0.0.0
              Subnet Mask . . . . . . . . . . . : 0.0.0.0
              Default Gateway . . . . . . . . . :
              DHCP Server . . . . . . . . . . . : 255.255.255.255

      Ethernet adapter Wireless Network Connection:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : NETGEAR WG111T 108Mbps Wireless USB2
      .0 Adapter
              Physical Address. . . . . . . . . : 00-14-6C-5D-C7-DA
              Dhcp Enabled. . . . . . . . . . . : Yes
              Autoconfiguration Enabled . . . . : Yes
              IP Address. . . . . . . . . . . . : 192.168.0.2
              Subnet Mask . . . . . . . . . . . : 255.255.255.0
              Default Gateway . . . . . . . . . : 192.168.0.1
              DHCP Server . . . . . . . . . . . : 192.168.0.1
              DNS Servers . . . . . . . . . . . : xxx.xx.xxx.xx
                                                  xxx.xx.xxx.xx
              Lease Obtained. . . . . . . . . . : 12 June 2007 20:50:48
              Lease Expires . . . . . . . . . . : 15 June 2007 20:50:48

      Ethernet adapter VMware Network Adapter VMnet1:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
      VMnet1
              Physical Address. . . . . . . . . : 00-50-56-C0-00-01
              Dhcp Enabled. . . . . . . . . . . : No
              IP Address. . . . . . . . . . . . : 192.168.0.5
              Subnet Mask . . . . . . . . . . . : 255.255.255.0
              Default Gateway . . . . . . . . . :

      Anyhelp friends….

      Cheers
      Vp75

    • #12973
      blackazarro
      Participant

      At least you got the Internet issue working, however I see something weird in your NIC configuration. Did you manually configure the VMnet8 and VMnet1 configurations?

      You are having problem accessing your router’s admin page from SuSe because your packets never get to the router:

      Kernel IP routing table
      Destination    Gateway        Genmask        Flags  MSS Window  irtt Iface
      192.168.0.0    0.0.0.0        255.255.255.0  U        0 0          0 eth0
      169.254.0.0    0.0.0.0        255.255.0.0    U        0 0          0 eth0
      127.0.0.0      0.0.0.0        255.0.0.0      U        0 0          0 lo
      0.0.0.0        192.168.0.2    0.0.0.0        UG        0 0          0 eth0

      Your router IP is (192.168.0.1) and by looking the above netstat’s result, especially the first line:

      Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
      192.168.0.0    0.0.0.0        255.255.255.0  U        0 0          0 eth0

      there’s no way that the packet will ever get to your router. Remember your guest OS is a virtual machine and it needs a gateway in order route the packet to the host machine then to the router even though it appears that your guest OS is within the local network.

      For what I understand and knowing how my virtual lab is setup, the virtual NIC (e.g. VMnet8) should have a different subnet from your host machine. This is automatically assigned when you install VMware player or other VMware software. Therefore your guest hosts should have a IP address within the VMnet8 subnet (different from your real local subnet).

      Not sure if you understand this but I guess the best way to illustrate what I’m trying to say is by posting my virtual network configuration setup. I will post this later when I get a chance.

    • #12974
      vp75
      Participant

      Hi Blackzarro

      As you said in reply, i manually configured the vmnet8 & vmnet1, was not sure exactly and was trying it. After i posted the netstat & ifconfig,ipconfig result to posting, i restarted the host pc, and now it was able to access router admin by 192.168.0.1, by this if i start using the virtual pc after it boots , i start getting ipaddress conflict in my host pc, i tried looking at the event viewer , it reported as 192.168.0.1 is been assigned to vmnet8 adapter….

      From my previous posting you can see that there is no value assigned to vmnet8 &vmnet 1 as 192.168.0.1. So something in my manual configuration is wrong. iam investigating the same.

      By the way, why does ipconfig/all shows no ipaddress in host for vmnet8 (i understand vmnet8 is used to connect to internet), so i disabled vmnet1.

      Do you find where iam lagging…. conceptually in configuring….!

      I hope on looking at your virtual lab setup i will be get some idea…

      Cheers
      Vp75

    • #12975
      blackazarro
      Participant

      Here’s how I have my virtual lab setup. I’m just going to show my host and one guest configuration.

      My LAN consist of few machines so I assigned a subnet of 192.168.1.33/29. My SOHO router (192.168.1.33) dynamically assigns IP addresses to the local machines. Currently the host machine (Windows) has an IP address of (192.168.1.37):

      Ethernet adapter Wireless Network Connection:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : Intel(R) PRO/Wireless LAN 2100 3B Mini PCI Adapter
              Physical Address. . . . . . . . . : XX-XX-XX-XX-XX-XX
              Dhcp Enabled. . . . . . . . . . . : No
              IP Address. . . . . . . . . . . . : 192.168.1.37
              Subnet Mask . . . . . . . . . . . : 255.255.255.248
              Default Gateway . . . . . . . . . : 192.168.1.33
              DNS Servers . . . . . . . . . . . : 10.0.0.138

      When I installed the VMware player it automatically created 2 virtual interfaces (VMnet1 & VMnet8)  in my host machine. It randomly assigned IP address to both virtual NIC. As I also understand the VMnet8 is used to connect the Internet:

      Ethernet adapter VMware Network Adapter VMnet8:

            Connection-specific DNS Suffix  . :
            Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
            Physical Address. . . . . . . . . : 00-50-56-C0-00-08
            Dhcp Enabled. . . . . . . . . . . : No
            IP Address. . . . . . . . . . . . : 192.168.214.1
            Subnet Mask . . . . . . . . . . . : 255.255.255.0
            Default Gateway . . . . . . . . . :

      Ethernet adapter VMware Network Adapter VMnet1:

              Connection-specific DNS Suffix  . :
              Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
              Physical Address. . . . . . . . . : 00-50-56-C0-00-01
              Dhcp Enabled. . . . . . . . . . . : No
              IP Address. . . . . . . . . . . . : 192.168.87.1
              Subnet Mask . . . . . . . . . . . : 255.255.255.0
              Default Gateway . . . . . . . . . :

      Then I downloaded VMX Builder to create virtual machines which will be my guests to the host machine. For this example I used BackTrack to install it as a virtual machine and did the following steps below so that it can have access to my other physical machines in the LAN and the Internet:

      slax ~ # ifconfig -a
      eth0      Link encap:Ethernet  HWaddr 00:0C:29:93:BB:00
                BROADCAST MULTICAST  MTU:1500  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000
                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
                Interrupt:18 Base address:0x1080

      lo        Link encap:Local Loopback
                inet addr: 127.0.0.1  Mask:255.0.0.0
                inet6 addr: ::1/128 Scope:Host
                UP LOOPBACK RUNNING  MTU:16436  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

      sit0      Link encap:UNSPEC  HWaddr 00-00-00-00-31-00-00-00-00-00-00-00-00-00-00-00
                NOARP  MTU:1480  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
                RX bytes:0 ( 0.0 b)  TX bytes:0 (0.0 b)

      Notice that my guest OS has no IP address. I statically assigned an IP address of (192.168.214.3). Remember that VMnet8 in my host machine has IP (192.168.214.1) since this virtual NIC is used to access the Internet I assigned an IP within that subnet to my guest OS. I did not use IP (192.168.214.2) because VMware use this as a virtual gateway:

      slax ~ # ifconfig eth0 192.168.214.3
      slax ~ # clear
      slax ~ # ifconfig
      eth0      Link encap:Ethernet  HWaddr 00:0C:29:93:BB:00
                inet addr: 192.168.214.3  Bcast:192.168.214.255  Mask:255.255.255.0
                inet6 addr: fe80::20c:29ff:fe93:bb00/64 Scope:Link
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000
                RX bytes:0 (0.0 b)  TX bytes:308 (308.0 b)
                Interrupt:18 Base address:0x1080

      lo        Link encap:Local Loopback
                inet addr:127.0.0.1  Mask: 255.0.0.0
                inet6 addr: ::1/128 Scope:Host
                UP LOOPBACK RUNNING  MTU:16436  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

      Let’s check the routing table for this guest machine:

      slax ~ # netstat -nr
      Kernel IP routing table
      Destination    Gateway        Genmask        Flags  MSS  Window  irtt  Iface
      192.168.214.0  0.0.0.0        255.255.255.0  U        0            0          0 eth0
      127.0.0.0            0.0.0.0          255.0.0.0            U        0            0          0 lo

      Looking at the routing table I can see that I can send packets to (192.168.214.0) subnet via the eth0 interface. If I create additional virtual machines and statically assigned IP address within this subnet then my packets will reach them. However, I see there’s no way for my packets to reach the Internet. Need to add an entry to the routing table:

      slax ~ # route add default gw 192.168.214.2 eth0

      slax ~ # clear
      slax ~ # netstat -nr

      Kernel IP routing table
      Destination    Gateway        Genmask        Flags  MSS  Window  irtt Iface
      192.168.214.0  0.0.0.0        255.255.255.0  U        0            0          0 eth0
      127.0.0.0            0.0.0.0        255.0.0.0            U        0            0          0 lo
      0.0.0.0        192.168.214.2  0.0.0.0                UG      0            0          0 eth0

      I added a default gateway which is (192.168.214.2) the virtual VMware gateway. Now any packets destined to (0.0.0.0-what ever IP) but not 192.168.214.0/24 and 127.0.0.0/8 will be routed to (192.168.214.2) gateway via eth0 then from there to my host machine which will NAT (my VMware is set to NAT) the source IP with the IP of my host machine. If the packet is intended for the Internet then this packet will be routed to my SOHO router and off it goes.

      Lets test by pinging my router:

      slax ~ # ping 192.168.1.33
      PING 192.168.1.33 (192.168.1.33) 56(84) bytes of data.
      64 bytes from 192.168.1.33: icmp_seq=1 ttl=128 time=15.4 ms
      64 bytes from 192.168.1.33: icmp_seq=2 ttl=128 time=6.93 ms
      64 bytes from 192.168.1.33: icmp_seq=3 ttl=128 time= 4.25 ms

      Awesome it works : )

      Now when I fired up my browser to request this site’s page, I was receiving connection errors. I used tcpdump to see what was happening and noticed that my guest OS was trying to resolve the domain name to IP using an non-existing¬† DNS server so I configured the resolv.conf to add my DNS server IP (10.0.0.138). I got this IP from my host (Windows) configuration:

      slax ~ # cat /etc/resolv.conf
      nameserver 10.0.0.138

      And boom it worked. Now I can access to the Internet from my virtual OS.

      I hope this helps.

Viewing 16 reply threads
  • You must be logged in to reply to this topic.

Copyright ©2020 Caendra, Inc.

Contact Us

Thoughts, suggestions, issues? Send us an email, and we'll get back to you.

Sending

Sign in with Caendra

Forgot password?Sign up

Forgot your details?