Set vm of Virtual Box to access internet

[root@docker01 ~]# ping www.google.com
^C
[root@docker01 ~]# nslookup www.google.com

[root@docker01 ~]# more /etc/resolv.conf
# Generated by NetworkManager
search opasia.dk
nameserver 193.162.153.164
nameserver 194.239.134.83
nameserver ::

VirtualBox–setting–Network—
Adapter1: Bridged Adapter, Promiscuous Mode:Deny, Cable Connected:enabled.
Adapter2: Nat, Cable Connected:enabled.

nmtui
ifconfig
more /etc/resolv.conf
more /etc/sysconfig/network-scripts/ifcfg-enp0s3
more /etc/sysconfig/network-scripts/
cd /etc/sysconfig/network-scripts/
ls
ls -lrt
ifconfig
ls
more ifcfg-lo
[root@docker01 ~]# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:c7:a9:c8:7d txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

docker_gwbridge: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:0b:94:92:45 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.36 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::c12b:bce6:da1c:dd81 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:c6:f7:6c txqueuelen 1000 (Ethernet)
RX packets 5636 bytes 574249 (560.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1854 bytes 262765 (256.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.3.15 netmask 255.255.255.0 broadcast 10.0.3.255
inet6 fe80::d8b6:d08d:27c6:c45a prefixlen 64 scopeid 0x20<link>
ether 08:00:27:6f:eb:3d txqueuelen 1000 (Ethernet)
RX packets 49 bytes 7863 (7.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 87 bytes 9774 (9.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2905 bytes 310562 (303.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2905 bytes 310562 (303.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:32:84:a5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Solution:

[root@docker01 ~]# service network restart
Restarting network (via systemctl): [ OK ]
[root@docker01 ~]#

Leave a Reply

Your email address will not be published. Required fields are marked *