You are not logged in.
Hi,
I've set up Arch in Virtualbox, and after fiddling with the configs yesterday i managed to get it up and running with host-only with static IP and NAT network. I want to do this in order to have the vbox accessible from the host machine at a static IP as well as being visible in the network. Right now both the network interfaces show up when i do a ip addr in the terminal. The ip of the host machine (192.168.56.1) is reachable, but I'm unable to reach for instance 8.8.8.8 (Googles DNS server).
The vbox is set up with two network adapters:
NAT (eth0)
Virtualbox network adapter settings:
Network CIDR: 10.0.2.0/24
Checked options: Supports DHCP
host-only (enp0s8)
Virtualboc network adapter settings:
IPv4 Address: 192.168.56.1
IPv4 Network Mask: 255.255.255.0
DHCP is disabled (since I'll be using static IP anyway).
I'm new to Arch, so I'm not really shure where to start looking. I guess there's something obvious I'm missing..
When running ip addr on the guest machine
[kribrabr@arch ~]$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:1e:7a:09 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe1e:7a09/64 scope link
valid_lft forever preferred_lft forever
inet6 fe80::51a6:1d54:4dc8:1d41/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:70:8f:b2 brd ff:ff:ff:ff:ff:ff
inet 192.168.56.56/24 brd 192.168.56.255 scope global enp0s8
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe70:8fb2/64 scope link
valid_lft forever preferred_lft forever
inet6 fe80::7dda:4dec:5b2d:efbe/64 scope link
valid_lft forever preferred_lft forever
Pinging the host from the guest
[kribrabr@arch ~]$ ping 192.168.56.1
PING 192.168.56.1 (192.168.56.1) 56(84) bytes of data.
64 bytes from 192.168.56.1: icmp_seq=1 ttl=64 time=0.282 ms
^C
--- 192.168.56.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.282/0.282/0.282/0.000 ms
Pinging google DNS from guest
[kribrabr@arch ~]$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3017ms
Running ip route on the guest machine
[kribrabr@arch ~]$ ip route
default via 192.168.56.1 dev enp0s8
default via 10.0.2.2 dev eth0 metric 202
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 metric 202
192.168.56.0/24 dev enp0s8 proto kernel scope link src 192.168.56.56
Any help would be most helpful. I'm all set with x and awesome and eager to start, but now stuck with stupid network problems
Offline
I spotted the error myself - the routes were not right;
default via 192.168.56.1 dev enp0s8
default via 10.0.2.2 dev eth0 metric 202
If I understand it correctly this setup tells Arch to use 192.168.56.1 as a route for reaching the internet. Since that is the host-only network it won't work. It started working again after a run this:
$ ip route del default via 192.168.56.1
But after rebooting Arch, the route was back in there. After digging around in the configuration for the interfaces (mine are located in /etc/netctl/static and /etc/netctl/dhcp) it turned out I had to comment out the gateway line. After doing that, I had the following configs;
/etc/netctl/static:
Description='A basic static ethernet connection'
Interface=enp0s8
Connection=ethernet
IP=static
Address=('192.168.56.56/24')
/etc/netctl/dhcp:
Description='A basic dhcp ethernet connection'
Interface=eth0
Connection=ethernet
IP=dhcp
After rebooting, everything worked. Sweet!
Last edited by kbrabrand (2014-09-13 11:31:52)
Offline