Macvlan and port in ubuntu 18.04


#1

Hi,
I have an lxd instance with a macvlan ip 10.0.0.192, the default ssh can be checked:

telnet localhost 22
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.2

but do it from another pc:
telnet 10.0.0.192 22
got : connection refused

ufw in the instance as well as the host machine all ‘inactive’, any idea why? the lxd instance info as follow:

lxc info bom
Name: bom
Remote: unix://
Architecture: i686
Created: 2019/02/26 13:13 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 11917
Ips:
eth0: inet 10.114.5.166 vethLNXU25
eth0: inet6 fd42:87c1:7a4b:98db:216:3eff:feef:bf9c vethLNXU25
eth0: inet6 fe80::216:3eff:feef:bf9c vethLNXU25
eth1: inet 10.0.0.192
eth1: inet6 fe80::216:3eff:feb5:8044
lo: inet 127.0.0.1
lo: inet6 ::1
Resources:
Processes: 43
CPU usage:
CPU usage (in seconds): 12
Memory usage:
Memory (current): 71.93MB
Memory (peak): 72.59MB
Network usage:
lo:
Bytes received: 7.75kB
Bytes sent: 7.75kB
Packets received: 105
Packets sent: 105
eth0:
Bytes received: 12.37kB
Bytes sent: 9.75kB
Packets received: 129
Packets sent: 110
eth1:
Bytes received: 38.82kB
Bytes sent: 936B
Packets received: 412
Packets sent: 12


#2

turned out, ufw inactive , all ports seem closed, have to do following:
sudo ufw enable
sudo ufw allow ssh

this fix the issue