Static Networking Address in Centos 7 on a virtual box VM

Issues related to configuring your network
chrisgauthier2017
Posts: 5
Joined: 2017/09/20 18:25:57

Static Networking Address in Centos 7 on a virtual box VM

Postby chrisgauthier2017 » 2017/09/20 21:48:38

Greetings, all -- this is my first post and first time working with CENTOS 7, so please bare with me!

I have a windows 10 host and a CENTOS 7 guest OS.

I have a cable modem that provides wireless access to all devices on my network, so it is the gateway to the internet (192.168.0.1).

Windows 10 host is wireless, a desktop is a standalone wireless install of ubuntu 17.04 and a VM off of the windows 10 host is also wireless running CENTOS 7.

I am looking to connect all these devices together on one /24 (192.168.0.0/24).

I've configured the standalone desktop as 192.168.0.2 through the CLI configuration files and i have access to it throughout the /24.
I've setup my guest CENTOS 7 VM as 192.168.0.254 through the /etc/sysconfig/network-scripts/ifcfg-enp0s3 file :

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFOUTE="yes"
IPVR_FAILURE_FATAL="yes"
IPV6INIT="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp0s3"
DEVICE="enp0s3"
IPADDR="192.168.0.254"
PREFIX="24"
GATEWAY="192.168.0.1"
DNS1="8.8.8.8"
IPV6_PRIVACY="no"

I think that's a standard config from my research on the subject.

an ip a on the interface shows me that the network is being configured properly as per the config file above:

enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 100
link/ether 08:00:27:a8:b2:e2 brd ff:ff:ff:ff:ff:ff:
inet 192.168.0.254/24 brd 192.168.0.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::b5bd:74e2:96b5:4a15/64 scope link
valid_lft forever preferred_lft forever


I can ping the IP attatched to that interface correctly.

The problem seems to be a routing problem, however, because IMHO, i should be able to ping 192.168.0.1 OR 192.168.0.2 (the other hosts on that /24).

ping 192.168.0.1
From 192.168.0.254 icmp_sq=1 Destination Host Unreachable
From 192.168.0.254 icmp_sq=1 Destination Host Unreachable
From 192.168.0.254 icmp_sq=1 Destination Host Unreachable

So I check my routing tables and find this:

default via 192.168.0.1 dev enp0s3 proto static metric 100
192.168.0.0/24 via 192.168.0.1 dev enp0s3 proto static metric 1
192.168.0.0/24 dev enp0s3 proto kernel scope link src 192.168.0.254 metric 100

Which seems to be correct to me and at this point i need help to troubleshoot.

Anyone have any ideas?

markkuk
Posts: 729
Joined: 2007/09/07 10:56:28
Location: Finland

Re: Static Networking Address in Centos 7 on a virtual box VM

Postby markkuk » 2017/09/21 08:00:57

Can you ping the other addresses from the Windows 10 host? Check your wireless router configuration to see that wireless isolation isn't turned on.

chrisgauthier2017
Posts: 5
Joined: 2017/09/20 18:25:57

Re: Static Networking Address in Centos 7 on a virtual box VM

Postby chrisgauthier2017 » 2017/09/21 12:40:13

Yes, from my windows 10 host, i can ping the ubuntu desktop just fine.

I thought initially it might be a firewall or filter issue, but disabling the firewall on the centos 7 host didn't allow pings to that device either.

Im not sure where to go from here...

chrisgauthier2017
Posts: 5
Joined: 2017/09/20 18:25:57

Re: Static Networking Address in Centos 7 on a virtual box VM

Postby chrisgauthier2017 » 2017/09/21 22:10:28

Ok, an update. One thing I noticed on my working ubuntu system is that I am using a wireless interface (wlp2s0). On my centos7 vm I am using an ethernet interface (enp1s0). My ubuntu system is configured for the 192.168.0.0/24 network and Im not sure how to configure my centos7 vm to use a wireless interface.

In the networking config manager i only have the option for wired interfaces and not for a wireless interface.

The VM appears to piggy back onto the ethernet interface (used to be eth0 back in the day), but does seem to allow traffic out onto the 192.168.0.0/24 network.

Any help would be appreciated,

Chris

chrisgauthier2017
Posts: 5
Joined: 2017/09/20 18:25:57

Re: Static Networking Address in Centos 7 on a virtual box VM

Postby chrisgauthier2017 » 2017/09/22 13:40:46

Ok, i've solved this problem.

For anybody that runs into the same issue, here is the solution:

1) In your virtual box settings configuration, click on Network.

2) Under adapter 1, click "enable network adapter"

3) Select "Bridged Adapter" from the attached to box

4) Select the wireless NIC you have attached to your motherboard.

Then once you start your install, you should see the installer select an address from the /24 you're on.

This is the ifcfg-enp0s3 file for the ethernet interface:

TYPE="ETHERNET"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp0s3"
DEVICE="enp0s3"
ONBOOT="yes"
IPADDR="192.168.0.3" (this will change with your addressing scheme)
NETMASK="255.255.255.0"
GATEWAY="192.168.0.1" (this will also change with your addressing scheme)
DNS1="8.8.8.8" (google dns servers, substitute your own if required)