I have decided to install the cento OS via virtual box in my dedicated windows online server which i am accessing it through RDP. I have 5 ipv4 attached to the windows server.
My ipconfig file output is below:
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::5964:102:b4ca:d22%12
IPv4 Address. . . . . . . . . . . : 79.195.157.66
Subnet Mask . . . . . . . . . . . : 255.255.255.252
Default Gateway . . . . . . . . . : fe80::219:a9ff:fe80:7400%12
79.195.157.65
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::d2:24be:d862:14c2%24
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Tunnel adapter Local Area Connection* 11:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Tunnel adapter Local Area Connection* 12:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2002:45c3:9d42::45c3:9d42
Default Gateway . . . . . . . . . : 2002:c058:6301::1
Tunnel adapter isatap.{CE18702E-41F3-4A46-AA41-33647FD7EC47}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Can anyone guide me how to attach the static ip to the centos virtual box install so that i can make it internet facing server?
During the centos instalation, i have configured the lan network adapter like this:
https://i.imgur.com/GOmjSSX.png
I am not sure whether it will help me achieve the static ip for the centos but my centos vm can't even access the internet.
yum update return unable to access the mirror server
Can anybody point me how to attach the static ip and make the linux internet facing?
Under virtual box you can also go to file--> host network manager and create another adapter with a static IP, this way you can use them independently or bridge them if need be.
First of all you should check the VirtualBox config.
Later on, login to Centos and modify the following file as root
sudo vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
I like use VIM, but you can use your favourite, editor.
Later inside that file you should change/or add the following fields
BOOTPROTO="static"
IPADDR=<<THE IP YOU WANT>>
GATEWAY=<<YOUR NETWORK GATEWAY IP>>
NETMASK=255.255.255.0
DNS1=8.8.8.8
DNS2=8.8.4.4
Later you can reboot the VM and you should have internet on it
8.8.8.8or8.8.4.4- Valentin Bajrami