AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-513757

Mike's questions

Martin Hope
Mike
Asked: 2024-06-18 00:14:47 +0800 CST

NetworkManager 未在 Debian 12 上初始化 VLAN 接口

  • 5

运行 Debian 12 时,我的以太网卡使用 DHCP 获取 IP,我想向同一接口 VLAN 30 添加 VLAN 配置,并为其分配静态 IP。这是我的 /etc/network/interfaces:

auto lo
iface lo inet loopback

# The primary network interface
auto enp0s25
allow-hotplug enp0s25
iface enp0s25 inet dhcp

#VLAN
auto enp0s25.30
iface enp0s25.30 inet static
  address 192.168.30.2
  netmask 255.255.255.0
  gateway 192.168.30.1
 vlan-raw-device enp0s25

无论重新启动 NetworkManager 还是重新启动,都无法激活 enp0s25.30 接口。NetworkManger 日志仅显示与 .30 VLAN 相关的这一行:

NetworkManager[2239]: <info>  [1718593439.7242] ifupdown: guessed connection type (enp0s25.30) = 802-3-ethernet

请注意,我的安装使用 NetworkManager 和 dhclient 来配置接口。我没有安装 ifupdown。我没有在 dhclient.conf 中配置任何内容,因为我假设 NetworkManager 会注意到“inet static”并使用它。

另请注意,我在 NetworkManager.conf 中进行了以下设置:

[ifupdown]
managed=true

如果我手动运行,我可以启动界面:

ip link add link enp0s25 name enp0s25.30 type vlan id 30
ip addr add 192.168.30.2/24 dev enp0s25.30
ip link set dev enp0s25.30 up

但当然,重启后这种情况不会持续

任何帮助使其工作完成的帮助都将受到感谢。

debian
  • 2 个回答
  • 104 Views
Martin Hope
Mike
Asked: 2020-04-04 13:39:01 +0800 CST

Time Machine 的 Samba4 问题:无法在 Samba 共享上创建新备份

  • 2

注意:最初发布在 StackExchange 上。我不确定哪个位置更合适,如果重复导致问题,我深表歉意。

TL;DR:Time Machine 无法在我的共享驱动器上创建新备份,但可以添加到现有备份。

我正在运行 macOS Catalina,我的 Time Machine 使用 NetAtalk 和 Avahi 备份到 Debian 10 服务器。由于 Mavericks macOS 更喜欢 SMB,并且考虑到 SMB 稍微快一些,我决定改用 SMB 来获取 Time Machine 共享。在新的 AFP 共享上,我可以在“系统偏好设置”中启动新的 Time Machine 备份,它会创建一个新的 .sparseimage,而不会抱怨。

如果我使用完全相同的目录 (/usr/local/smb)、相同的权限等,并创建一个 samba 共享,当 Time Machine 尝试创建新备份时,它会给出错误:“Time Machine 无法完成备份到 SERVER.local。无法创建备份磁盘映像。”

如果我首先使用 AFP 连接到共享并进行初始备份,然后我可以连接 SMB 并添加后续增量备份而不会出错。我认为可能是权限问题,但出于调试目的,我将 /usr/local/smb 设置为 0777 并且仍然出现错误。

ls -la显示共享点的权限:

drwxrwxrwx  5 root smbusers 4096 Apr  3 12:35 smb

我在日志中发现以下可能有用的错误:

Failed to create '/Volumes/.timemachine/SERVER._smb._tcp.local/DDE06691-7411-41DD-8419-24FEFC21CE29/TimeMachine Set A - SMB/8E394711-7E3F-520B-800C-192D4F680177.sparsebundle', results: {
}, error: 13 Permission denied

afp.conf:

[Global]
; Global server settings
vol preset = default_for_all
log file = /var/log/netatalk.log
uam list = uams_dhx2.so,uams_clrtxt.so
save password = no

[default_for_all]
file perm = 0664
directory perm = 0774
cnid scheme = dbd

[Time Machine Set A - AFP]
path = /usr/local/smb
time machine = yes
vol size limit = 4000000

我正在使用这个 GitHub 中建议的一些 smb.conf 选项:https ://gist.github.com/ChloeTigre/4c2022c0d1a281deedba6f7539a2e3ae

smb.conf:

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP
   wins support = yes

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d

###MacOS compatability stuff
guest account = smbguest
min protocol = SMB2
map acl inherit = yes
vfs objects = catia fruit streams_xattr  
fruit:metadata = netatalk
fruit:model = MacSamba
fruit:posix_rename = yes 
fruit:veto_appledouble = yes

durable handles = yes
kernel oplocks = no
kernel share modes =no
posix locking = no
smb2 leases = yes


#Turned off for testing compatability
#fruit:wipe_intentionally_left_blank_rfork = yes 
#fruit:delete_empty_adfiles = yes 

####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller". 
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<[email protected]> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

######Security#######
security = user
valid users = @smbusers
username map = /etc/samba/users.map
guest ok = no

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

[TimeMachine Set A - SMB]
path = /usr/local/smb
comment = SMB Time Machine Destination Set A
browsable = yes
writeable = yes
create mode = 0664     #tried turning this off, no fix
directory mode = 0777  #tried turning this off, no fix
vfs objects = catia fruit streams_xattr
fruit:aapl = yes
fruit:time machine = yes
#guest ok = yes
fruit:time machine max size = 3.9T  #tried turning this off, no fix
inherit acls = yes
debian samba time-machine netatalk samba4
  • 2 个回答
  • 6498 Views
Martin Hope
Mike
Asked: 2019-03-11 17:32:43 +0800 CST

UFW 在允许的端口上记录块

  • 4

我的电流ufw status如下。UFW 设置为默认拒绝。

[ 1] SSH                        ALLOW IN    10.1.0.0/16               
[ 2] DNS                        ALLOW IN    10.1.0.0/16               
[ 3] DNS                        ALLOW IN    192.168.0.0/16            
[ 4] 1900,3478,10001/udp        ALLOW IN    10.1.0.0/16                # UniFi UDP ports
[ 5] 6789,8080,8443,8843,8880,27117/tcp ALLOW IN    10.1.0.0/16                # UniFi TCP ports
[ 6] 5353/udp                   ALLOW IN    10.1.0.0/16                # Multicast DNS aka Bonjour

因此,从 10.1.0.0/16 块到端口 8080 的传入 TCP 数据包都应该被允许,但是在我的 ufw.log 中,我看到以下内容不断重复:

Mar 10 18:28:48 pi-hole kernel: [97820.380848] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:ef:23:6a:b4:fb:e4:28:d2:48:08:00:45:00:00:34:52:72:40:00:40:06:d1:51 SRC=10.1.1.1 DST=10.1.1.254 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=21106 DF PROTO=TCP SPT=36656 DPT=8080 WINDOW=245 RES=0x00 ACK FIN URGP=0 
Mar 10 18:29:10 pi-hole kernel: [97841.880829] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:ef:23:6a:b4:fb:e4:28:d2:48:08:00:45:00:00:34:55:42:40:00:40:06:ce:81 SRC=10.1.1.1 DST=10.1.1.254 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=21826 DF PROTO=TCP SPT=36657 DPT=8080 WINDOW=245 RES=0x00 ACK FIN URGP=0 
Mar 10 18:29:31 pi-hole kernel: [97863.530929] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:ef:23:6a:b4:fb:e4:28:d2:48:08:00:45:00:00:34:87:7d:40:00:40:06:9c:46 SRC=10.1.1.1 DST=10.1.1.254 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=34685 DF PROTO=TCP SPT=36658 DPT=8080 WINDOW=245 RES=0x00 ACK FIN URGP=0 

暗示它正在阻止从 10.1.1.1 到端口 8080 的传入 TCP 数据包。

我尝试跑步ufw reload无济于事。我也尝试过允许来自任何 IP 地址的 8080,同样的问题。

我什至使用apt purge ufw并重新安装和重建了我的规则完全删除了 UFW,但仍然遇到同样的问题。

有任何想法吗?

ufw
  • 1 个回答
  • 8040 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve