openSUSE with Internet and static IP address by using YaST on VirtualBox

Published on October 20, 2018 by Daniel Lanza

 opensuse

An openSUSE virtual machine will be configured to have a static IP address and Internet connection on VirtualBox.

This scenario is really useful if you want to install a specific application in guest and you need to communicate from your host.

Therefore, the virtual machine will have two network adapters:

Steps

Settings for VirtualBox

First, create a Host Network Manager in VirtualBox. In this case, vboxnet0 with the following features:

Host network manager
Host network manager
Host network manager
Host network manager

Virtual machine network settings

Shutdown your virtual machine, and add two network adapters:

NAT adapter
NAT adapter
Host-only-adapter
Host-only-adapter

Settings for network devices

Start the virtual machine, and check the network devices available:

dlanza@linux-klr1:~> ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:4a:28:1b brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global noprefixroute dynamic eth5
       valid_lft 86250sec preferred_lft 86250sec
    inet6 fe80::5fa5:3dc:b8c0:52f4/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:b6:93:b5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.102/24 brd 192.168.56.255 scope global noprefixroute dynamic eth4
       valid_lft 1061sec preferred_lft 1061sec
    inet6 fe80::c12f:4627:19e4:79c5/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
````

The network devices are the following:

- eth5 -> NAT adapter (10.0.2.15)
- eth4 -> Host-only-adapter with **vboxnet0** configuration (dynamic IP - 192.168.56.102)

Now, let's going to set the following static IP address with YaST:

- eth5 -> NAT adapter (10.0.2.15)
- eth4 -> Host-only-adapter with **vboxnet0** configuration (static IP - 192.168.56.200)

terminal dlanza@linux-klr1:~> sudo yast


Go to System -> Network Settings.

Network settings
Network settings
By default, the network setup method is Network manager service. You will get a warning, since YaSY is unable to configure some options.
Warning Network manager
Warning Network manager
Change Network setup method to Wicked service.
Network manager service
Network manager service
Wicked service
Wicked service
The network devices for NAT and host-only adapters are not configured yet (**82540EM Gibabit Ethernet Controller**)
NAT network device
NAT network device
Let's modify the network device **eth4**: - Host-only-adapter with static IP address 192.168.56.200 - FQDN hostname server1.dalanzg.com
Host-only-adapter network device
Host-only-adapter network device
Static IP address
Static IP address
And, now the network device **eth5**: - NAT adapter with DHCP
NAT network device
NAT network device
NAT network device
NAT network device
Save changes and see that network devices are configured.
Network devices configured
Network devices configured
Now set hostname and DNS: - Hostname -> server1 - Domain -> dalanzg.com - DNS -> 8.8.4.4 (from Google)
Hostname and DNS
Hostname and DNS
And finally, save Network settings and reboot the virtual machine.
Save network settings
Save network settings
After reboot, check again the network devices.

terminal dlanza@server1:~> ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.18 scope host lo valid_lft forever preferred_lft forever inet6 ::1128 scope host valid_lft forever preferred_lft forever 2: eth5: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:4a:28:1b brd ff:ff:ff:ff:ff:ff inet 10.0.2.1524 brd 10.0.2.255 scope global eth5 valid_lft forever preferred_lft forever inet6 fe80::a00:27ff:fe4a:281b/64 scope link valid_lft forever preferred_lft forever 3: eth4: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:b6:93:b5 brd ff:ff:ff:ff:ff:ff inet 192.168.56.20024 brd 192.168.56.255 scope global eth4 valid_lft forever preferred_lft forever inet6 fe80::a00:27ff:feb6:93b5/64 scope link valid_lft forever preferred_lft forever ````

Next, check the FQDN hostname:

dlanza@server1:~> hostname
server1
dlanza@server1:~> hostname -f
server1.dalanzg.com
dlanza@server1:~> ping server1.dalanzg.com
PING server1.dalanzg.com (192.168.56.200) 56(84) bytes of data.
64 bytes from server1.dalanzg.com (192.168.56.200): icmp_seq=1 ttl=64 time=0.160 ms
64 bytes from server1.dalanzg.com (192.168.56.200): icmp_seq=2 ttl=64 time=0.064 ms
^C
--- server1.dalanzg.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.064/0.112/0.160/0.048 ms

And finally, the Internet connection:

dlanza@server1:~> ping www.google.com
PING www.google.com (216.58.201.164) 56(84) bytes of data.
64 bytes from mad08s06-in-f4.1e100.net (216.58.201.164): icmp_seq=1 ttl=63 time=7.83 ms
64 bytes from mad08s06-in-f4.1e100.net (216.58.201.164): icmp_seq=2 ttl=63 time=6.73 ms
64 bytes from mad08s06-in-f4.1e100.net (216.58.201.164): icmp_seq=3 ttl=63 time=7.50 ms
^C
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 6.739/7.360/7.835/0.469 ms
comments powered by Disqus

See also

How to install Apache HTTPD in openSUSE

This tutorial will explain how to install Apache HTTPD in openSUSE 15. The original documentation is found in The Apache HTTP Server Project. And the official documentation for openSUSE is in The Apache HTTP Server. Requirements You will need the following: openSUSE Leap 15 Steps Set hostname and domain Install Apache HTTPD Start and stop Apache Start Apache automatically at boot time Set hostname and domain Files /etc/hostname and /etc/hosts will be modified to resolve the following:

Read more

How to install Oracle 12c R2 in openSUSE

This tutorial will explain how to install Oracle Database 12c R2 in openSUSE Leap 42.3. Requirements You will need the following: openSUSE Leap 42.3 -> Install openSUSE virtual machine with VirtualBox Oracle 12c R2 database installation file -> linuxx64_12201_database.zip Steps Install libraries Set hostname and domain Create groups and users Grant oracle user access to X server Configuring Kernel Parameters and Resource Limits Create directory for Oracle Database Install Oracle Database Configuration of Oracle Listener Configuration of Oracle Database Create user for database Create table for database Connect to Oracle database with SQL Developer Start database when server is restarted Install libraries According to Supported SUSE Linux Enterprise Server 12 in Oracle documentation, install the following libraries by using YaST or zypper command:

Read more

How to install SAP NetWeaver 7.51 as ABAP Developer Edition in openSUSE

This tutorial will explain how to install SAP NetWeaver as ABAP server in a virtual machine to develop your own custom ABAP objects. Requirements You will need the following: An openSUSE virtual machine with VirtualBox (Check this link Download SAP NetWeaver compress files from SAP NetWeaver AS ABAP Developer Edition Steps Set port forwarding Set hostname and hosts Install uuidd Mount SAP NetWeaver files Install SAP NetWeaver Install SAP GUI in your host machine SAP GUI for JAVA logon Check SAP NetWeaver license Stop SAP NetWeaver Start SAP NetWeaver Set port forwarding Forward from the Host IP and ports to the following Guest IP and ports in the virtual machine settings:

Read more