Friday, May 12, 2017

Virtual Server - Setup Fix IP

Enable Wifi network in Virtual Server.

sudo lshw -class network  -> it show network disabled
ls /sys/class/net   -> show ubuntu internet interfce name; example :   enpp1203

enabled network interface enpp1203
sudo dhclient enpp1203

verify:
sudo lshw -class network
We can see the "disabled" word no longer there

More information
Hyper-V Virtual Server connect to internet using WIFI 


When I restart Virtual Server, network connection in Virtual Server lost ?
How to setup fix IP in Virtual Server?
1) sudo vim /etc/network/interfaces

2) add the below information inside interfaces
     auto enp0s10f0
     iface enp0s10f0 inet static
     address 192.168.0.160
     netmask 255.255.255.0
     broadcast 192.168.0.255
     gateway 192.168.0.1
     wpa-ssid ssidname
     wpa-psk passwordforwifi

3) restart network;
    sudo /etc/init.d/networking restart
    [ ok ] Restarting networking (via systemctl): networking.service.

4) try list available update, and it give all error, can't connect to internet
     sudo apt-get update
   Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:4 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease
  Could not resolve host: packages.microsoft.com
 5) add dns server name into /etc/network/interfaces
     sudo vim /etc/network/interfaces

auto enp0s10f0
iface enp0s10f0 inet static
   address 192.168.0.160
   netmask 255.255.255.0
   broadcast 192.168.0.255
   gateway 192.168.0.1
   dns-nameservers 8.8.8.8
   dns-nameservers 8.8.4.4

   wpa-ssid ssidname
    wpa-psk passwordforwifi
6) restart network after add dns name servers
    sudo /etc/init.d/networking restart
    [ ok ] Restarting networking (via systemctl): networking.service.

7) try list available update, and it and now ok
     sudo apt-get update
    Hit:1 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease
Hit:2 https://packages.microsoft.com/ubuntu/16.04/mssql-server xenial InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 2s (142 kB/s)
Reading package lists... Done

No comments: