DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th June 2022
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,133
Default VM gets a 192.168.222.xxx address instead of my local 10.19.14.0/24 prefix

I started my VM 'cloudnine' while my other VM 'alix' was running and unexpectedly got a 192.168.222.xxx/16 address and not one from my local 10.19.14.0/24 prefix.

From /var/log/daemon
Code:
Jun 27 03:38:59 cloudnine ntpd[84843]: adjusting clock frequency by -0.169169 to -2.967284ppm
Jun 27 04:01:22 cloudnine ntpd[84843]: adjusting clock frequency by -0.117141 to -3.084425ppm
Jun 28 03:04:37 cloudnine dhcpleased[48199]: adding 192.168.222.244 to vio0 (lease from 192.168.222.10)
Jun 28 03:04:37 cloudnine dhcpleased[48199]: adding nameservers 8.8.8.8 192.168.2.254 (lease from 192.168.222.10 on vio0)
Jun 28 03:04:37 cloudnine resolvd[86118]: rebuilding: route proposals
Jun 28 03:04:37 cloudnine ntpd[79994]: ntp engine ready
Jun 28 03:04:38 cloudnine ntpd[79994]: constraint reply from 9.9.9.9: offset 0.783134
Strange .....

Also in the status it shows that the state is 'stopped', although I am using it
Code:
 lenap$ vmctl status
   ID   PID VCPUS  MAXMEM  CURMEM     TTY        OWNER    STATE NAME
    1 28285     1    1.0G    988M       -   root:wheel  stopped cloudnine
    2 14840     1    1.0G    991M   ttyp7 adriaan:wheel  running alix
I can log in with ssh:
Code:
cloudnine# w
 4:35AM  up  1:32, 2 users, load averages: 0.00, 0.00, 0.00
USER    TTY FROM              LOGIN@  IDLE WHAT
root     00 -                 3:05AM     0 w 
adriaan  p0 192.168.222.242   3:55AM    39 -ksh
The x.x.x.242 is my workstation and host for these two VMs.

There are two tap interfaces and they are members of the bridge0 interface.
Code:
lenap$ ifconfig tap

tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        lladdr fe:e1:ba:d0:fd:ad
        description: vm2-if0-alix
        index 7 priority 0 llprio 3
        groups: tap
        status: active
        inet 10.19.14.2 netmask 0xfffffffe
tap1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        lladdr fe:e1:ba:d1:98:3f
        description: vm1-if0-cloudnine
        index 8 priority 0 llprio 3
        groups: tap
        status: active

lenap$ ifconfig bridge0 

bridge0: flags=41<UP,RUNNING> mtu 1500
        description: switch1-adanak
        index 5 llprio 3
        groups: bridge
        priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp
        designated: id 00:00:00:00:00:00 priority 0
        tap1 flags=3<LEARNING,DISCOVER>
                port 8 ifpriority 0 ifcost 0
        tap0 flags=3<LEARNING,DISCOVER>
                port 7 ifpriority 0 ifcost 0
        bge0 flags=3<LEARNING,DISCOVER>
                port 1 ifpriority 0 ifcost 0
        Addresses (max cache: 100, timeout: 240):
                00:0d:b9:2a:bf:e1 bge0 1 flags=0<>

lenap$ arp -an

Host                                 Ethernet Address    Netif Expire    Flags
10.19.14.2                           fe:e1:ba:d0:fd:ad    tap0 permanent l
192.168.222.10                       00:0d:b9:2a:bf:e1    bge0 17m51s    
192.168.222.242                      a0:1d:48:97:5b:74    bge0 permanent l
192.168.222.244                      fe:e1:bb:d1:67:e9    bge0 49s
My vm.conf:
Code:
lenap$ cat /etc/vm.conf
# --- vm.conf
# J65nko - daemonforums.org June 2022


socket owner adriaan:wheel

local prefix 10.19.14.0/24

# --- Macros
installsets="/var/www/htdocs/OpenBSD/7.1/amd64/"

# --- Virtual machines ---

# Hetzner cloud

vm "cloudnine" {
        owner adriaan:wheel
        disable
        #boot $installsets "bsd.rd"
        memory 1G
        disk "/home/adriaan/VIRTUALIZATION/hetzner_disk.img"
        # Second disk from OpenBSD contains the install sets
        disk $installsets "install71.img"
        local interface { switch "adanak" }
}

# Alix router 

vm "alix" {
        owner adriaan:wheel
        disable
        memory 1G
        #boot $installsets "bsd.rd"
        disk "/home/adriaan/VIRTUALIZATION/alix.qcow2"
        local interface { switch "adanak" }
}

switch "adanak" {
    interface bridge0
}

# --- end of vm.conf
Somebody has a guess or explanation what is going on here?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #2   (View Single Post)  
Old 28th June 2022
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,133
Default

Code:
cloudnine# date
Tue Jun 28 04:51:44 CEST 2022
cloudnine# shutdown -hp now
Shutdown NOW!
shutdown: [pid 99454]

*** FINAL System shutdown message from adriaan@cloudnine.my.domain ***
System going down IMMEDIATELY

cloudnine#
System shutdown time has arrived
Connection to 192.168.222.244 closed by remote host.
Connection to 192.168.222.244 closed.

lenap$ vmctl status

   ID   PID VCPUS  MAXMEM  CURMEM     TTY        OWNER    STATE NAME
    2 14840     1    1.0G    991M   ttyp7 adriaan:wheel  running alix
lenap$
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 28th June 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,989
Default

The DHCP server was running on 192.168.222.10:
Code:
Jun 28 03:04:37 cloudnine dhcpleased[48199]: adding 192.168.222.244 to vio0 (lease from 192.168.222.10)
You are configuring both local interfaces and a switch (bridge). I'd recommend using one or the other, not both.
Reply With Quote
  #4   (View Single Post)  
Old 28th June 2022
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,133
Default

192.168.222.10 is the internal interface of my Alix router/pf firewall. Is is also the default gateway and the DHCP server is always running.

Both VMs have the same configuration for the interface:
Code:
local interface { switch "adanak" }
and both have
Code:
cloudnine# cat /etc/hostname.vio0
inet autoconf

alix# /etc/hostname.vio0                                              
inet autoconf
But only VM 'cloudnine' gets a 192.168.222.xx address. VM 'alix' with the exact same config gets a local 10.19.14.2 address. That is what I don't understand.

I notice that sometimes a VM is very busy with generating a new random kernel and is slow in accepting my login. When it is accepted I see
Code:
# ps ax
[snip]
98126 ??  Sp       0:00.11 make newbsd
38700 ??  Sp       0:00.00 /bin/sh -ec size newbsd ; umask 007;  echo mv newbsd
84550 ??  Sp       0:00.04 /bin/sh /usr/bin/ctfstrip -S -o newbsd newbsd.gdb
31627 ??  Rp       0:08.59 objcopy -g --add-section .SUNW_ctf=/tmp/.ctf.sY6q6Ul
 4214 00- Ip       0:00.03 /bin/ksh /usr/libexec/reorder_kernel
Maybe a race condition 192.168.222.10 dhcp server winning from the dhcp server from [file[vmd[/b]?

Anyway, per your advice I removed the local from the interface directive in both VMs and now both are getting 192.168.222.xxx addresses from my 192.168.222.10 DHCP server (renamed VM alix to alix_new):
Code:
alix_new$ ifconfig vio0
vio0: flags=808b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
        lladdr fe:e1:bb:d1:ce:da
        index 1 priority 0 llprio 3
        groups: egress
        media: Ethernet autoselect
        status: active
        inet 192.168.222.240 netmask 0xffffff00 broadcast 192.168.222.255
alix_new$ ^D
Connection to 192.168.222.240 closed.
cloudnine# ifconfig vio0
vio0: flags=808b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
        lladdr fe:e1:bb:d1:39:72
        index 1 priority 0 llprio 3
        groups: egress
        media: Ethernet autoselect
        status: active
        inet 192.168.222.244 netmask 0xffffff00 broadcast 192.168.222.255
Now I am going to make these VMs get a 'fixed" IP address through DHCP ....
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 28th June 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,989
Default

You had competing DHCP servers configured. Your own daemon, and the "local interfaces" DHCP service provided to guests by vmd(8).
Reply With Quote
Reply

Tags
vm, vm.conf

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PF and NAT: Specify SRC IP Address? jasonvp FreeBSD Security 5 25th November 2015 08:04 PM
pkg_add --PREFIX ? sharris FreeBSD General 2 25th July 2011 04:31 PM
log from rc.conf.local and rc.local sdesilet OpenBSD General 1 21st January 2010 02:37 AM
MAC address to IP rex FreeBSD General 9 11th November 2008 07:06 PM
cvs-supfile default prefix maxrussell FreeBSD General 2 24th May 2008 10:49 AM


All times are GMT. The time now is 02:58 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick