LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-20-2012, 08:45 PM   #1
mikeJaneksi
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
VMWare NAT and static IP in linux guest - destination host unreachable


Hi everybody,

I am new to the Linux world and networking, so i decided to buy a book and download VMWare Workstation 30-day trial and CentOS 6.

I am following the book and i want to assign static ip addresses to my linux VMs. The book uses the subnet IP 192.168.122.0/24 and as i want to keep everything the same, i changed the NAT (VMNet 8) IP subnet in VMWare Workstation to 192.168.122.0 netmask 255.255.255.0 Under the NAT Settings in the Virtual Network Editor for VMNet8 (NAT) it shows the gateway being 192.168.122.2

In my Linux VM (CentOS), i configured the /etc/sysconfig/network-scripts/ifcfg-eth0 and added:
IPADDR: 192.168.122.20
NETMASK: 255.255.255.0
GATEWAY: 192.168.122.2
DNS1: 192.168.122.2

I also changed the /etc/sysconfig/network file and added:
GATEWAY: 192.168.122.2

I then did a 'service network restart' and everything restarted fine. When i tried to ping the gateway (192.168.122.2) i get a Destination Host Unreachable. When i use DHCP in the CentOS image, i get an ip address of 192.168.122.130 (random but the DHCP scope starts at .128-/254) and everything is working fine. I can ping the gateway and the outside world (google.com for example).

What am i doing wrong in my settings for the static ip address that i cannot get any networking connectivity? I read somewhere that i must use Bridged networking mode instead of NAT (which i am using) to use static ip address? But i do not understand why, when using DHCP everything works fine.

Can someone please help and let me know where i am going wrong so i can learn from my mistake?

Thank you very much guys.
 
Old 07-23-2012, 07:22 AM   #2
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76
Hi.

I use VMWare Server 2. I always use Bridged networking. It allows VMs to see each other as well as to get to the Internet. I assign static IPs.

To see some of the differences among the 3 modes pf networking in VMWare, do a Google search for vmware server bridged versus nat -- the first hit -- Blog Rat-- and a few of the many VMWare hits provide some comparisons.

Best wishes ... cheers, makyo
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux network destination host unreachable linuxguy08 Linux - Server 1 07-22-2009 06:23 PM
Destination Host Unreachable susankhya Linux - Networking 3 06-14-2006 02:14 AM
Destination Host Unreachable on Mandrake Linux 9.1 ?? mjhatamy Linux - Networking 0 08-05-2003 06:59 AM
Destination Host Unreachable thanos35 Linux - General 4 01-06-2003 06:48 AM
destination host unreachable jb1 Linux - Networking 3 11-27-2002 01:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration