Hi Steemians
Virtualbox network interface
By default Virtualbox will connect your virtual machine over a nat interface. This will
show up as a 10.0.2.15 (or similar).
[root@server33 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast s
tate UP qlen 1000
link/ether 08:00:27:1c:f5:ab brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 86399sec preferred_lft 86399sec
inet6 fe80::a00:27ff:fe1c:f5ab/64 scope link
valid_lft forever preferred_lft forever
You can change this to bridge (over your wi-fi or over the ethernet cable) and thus make it
appear as if your virtual machine is directly on your local network (receiving an ip address
from your real dhcp server).
You can make this change while the vm is running, provided that you execute this command:
[root@server33 ~]# systemctl restart network
[root@server33 ~]# ip a s dev enp0s3
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast s
tate UP qlen 1000
link/ether 08:00:27:1c:f5:ab brd ff:ff:ff:ff:ff:ff
inet 192.168.1.110/24 brd 192.168.1.255 scope global dynamic enp0s3
valid_lft 7199sec preferred_lft 7199sec
inet6 fe80::a00:27ff:fe1c:f5ab/64 scope link
valid_lft forever preferred_lft forever
[root@server33 ~]#
configuring the network
The new way of changing network configuration is through the nmtui tool. If you want to
manually play with the files in /etc/sysconfig/network-scripts then you will first need to
verify (and disable) NetworkManager on that interface.
Verify whether an interface is controlled by NetworkManager using the nmcli command
(connected means managed bu NM).
[root@server33 ~]# nmcli dev status
DEVICE TYPE STATE CONNECTION
enp0s3 ethernet connected enp0s3
lo loopback unmanaged --
Disable NetworkManager on an interface (enp0s3 in this case):
echo 'NM_CONTROLLED=no' >> /etc/sysconfig/network-scripts/ifcfg-enp0s3
You can restart the network without a reboot like this:
[root@server33 ~]# systemctl restart network
Also, forget ifconfig and instead use ip a.
[root@server33 ~]# ip a s dev enp0s3 | grep inet
inet 192.168.1.110/24 brd 192.168.1.255 scope global dynamic enp0s3
inet6 fe80::a00:27ff:fe1c:f5ab/64 scope link
[root@server33 ~]#
adding one static ip address
This example shows how to add one static ip address to your computer.
[root@server33 ~]# nmtui edit enp0s3
In this interface leave the IPv4 configuration to automatic, and add an ip address just below.
IPv4 CONFIGURATION < Automatic > < Hide >
Addresses 10.104.33.32/16__________ < Remove >
Execute this command after exiting nmtui.
[root@server33 ~]# systemctl restart network
And verify with ip (not with ifconfig):
[root@server33 ~]# ip a s dev enp0s3 | grep inet
inet 192.168.1.110/24 brd 192.168.1.255 scope global dynamic enp0s3
inet 10.104.33.32/16 brd 10.104.255.255 scope global enp0s3
inet6 fe80::a00:27ff:fe1c:f5ab/64 scope link
[root@server33 ~]#
package management
Even with a network install, CentOS 7 did not install the latest version of some packages.
Luckily there is only one command to run (as root). This can take a while.
*[root@server33 ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
- base: centos.weepeetelecom.be
- extras: centos.weepeetelecom.be
- updates: centos.weepeetelecom.be
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7
will be updated
... (output truncated)*
You can also use yum to install one or more packages. Do not forget to run yum update
from time to time.
[root@server33 ~]# yum update -y && yum install vim -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base: centos.weepeetelecom.be
... (output truncated)
Refer to the package management chapter for more information on installing and removing
packages
logon from Linux and MacOSX
You can now open a terminal on Linux or MacOSX and use ssh to log on to your virtual
machine.
paul@debian8:~$ ssh [email protected]
[email protected]'s password:
Last login: Sun Nov 2 11:53:57 2014
[root@server33 ~]# hostname
server33.netsec.local
[root@server33 ~]#
logon from MS Windows
There is no ssh installed on MS Windows, but you can download putty.exe from http://
www.chiark.greenend.org.uk/~sgtatham/putty/download.html (just Google it).
Use putty.exe as shown in this screenshot (I saved the ip address by giving it a name
'server33' and presing the 'save' button).
The first time you will get a message about keys, accept this (this is explained in the ssh
chapter).
Enter your userid (or root) and the correct password (nothing will appear on the screen when
typing a password).
@linux , @learning , @MacOSX , @crypto , @education , @technology
Hope you like this content ... it's going to continue... .
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
http://linux-training.be/funhtml/ch05.html
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit