Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 8544  / 2 Years ago, sun, march 20, 2022, 7:11:35

I have Ubuntu 12.04 Server installed in VMWare Workstation 10.0 on host Windows 8.1



/etc/network/interfaces


configuration is as follows.



# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.171.132
netmask 255.255.255.0
gateway 192.168.171.1


and Network Adapter is set to Custom: VMnet 8 (NAT)



From Windows, my host, I can see that VMNet 8 has IPv4 : 192.168.171.1 that should be the gateway in /etc/network/interfaces and that is.



If I set it to DHCP, I can connect to internet from VM and get assigned an IP of 192.168.171.131



But the problem is that I cannot connect to internet when I set it static.



Please tell me where I am getting wrong?


More From » 12.04

 Answers
7

If you set a static IP address in /etc/network/interfaces, you are also responsible to set up DNS nameservers. I suggest you try:



# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.171.132
netmask 255.255.255.0
gateway 192.168.171.1
dns-nameservers 8.8.8.8 192.168.171.1


Then get the system to re-read the file and use the changes:



sudo ifdown eth0 && sudo ifup eth0


Check:



ping -c3 www.google.com

[#26124] Tuesday, March 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tialmes

Total Points: 14
Total Questions: 108
Total Answers: 102

Location: Oman
Member since Thu, Jun 16, 2022
2 Years ago
;