Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1849  / 1 Year ago, sat, march 4, 2023, 2:04:13

  • Host machine: Ubuntu 12.04 LTS

  • Guest machine: Ubuntu 12.04 LTS

  • Networking mode: NAT + Host Network only.



Settings of my VM:



cat /etc/network/interfaces:


Output:



auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.0.0.4
netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp


When I run : ping 8.8.8.8, I get: connect: network is unreachable.



Note: I run the necessary things such as: sudo /etc/init.d/networking restart and sudo service network-interface restart INTERFACE=eth0/eth1, and even sudo ifconfig eth0/eth1 down/up.


I also edited the necessary files: /etc/hosts where I added my ip (10.0.0.4) and I added my dns namserver (that i also definied for eth0 - I just do not want to post it here) to /etc/resolv.conf.



When I run route -n, I get this output:

enter image description here


ifconfig gives me this:


enter image description here




How could I connect to internet using a static address of my choice ?


More From » 12.04

 Answers
5

I resolved the problem this way:



auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 10.0.0.4
netmask 255.255.255.0


and I run sudo ifconfig eth1 up


[#24125] Saturday, March 4, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
motivengry

Total Points: 459
Total Questions: 112
Total Answers: 108

Location: Bonaire
Member since Sat, May 1, 2021
3 Years ago
motivengry questions
Tue, Oct 4, 22, 10:02, 2 Years ago
Wed, May 31, 23, 14:33, 12 Months ago
;