0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LinuxNICの設定変えたらsamba繋がらくなってハマったメモ

Last updated at Posted at 2022-01-13

はじめに

この記事はじぶん用です。忘れてどうしようってなったとき用に残してます。

環境

KernelVersion
$ uname -r
3.10.0-1160.25.1.el7.x86_64
OSVersion
$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
かなり省略
$ ip a
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP>
    link/ether xx:xx:xx:xx:9d:2d brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP>
    link/ether xx:xx:xx:xx:9d:2d brd ff:ff:ff:ff:ff:ff
4: nm-bond: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> 
    link/ether xx:xx:xx:xx:9d:2d brd ff:ff:ff:ff:ff:ff
    inet xx.xx.xx.190/22 brd 172.21.83.255 scope global noprefixroute nm-bond
    inet xx.xx.xx.250/22 brd 172.21.83.255 scope global secondary noprefixroute nm-bond
    inet xx.xx.xx.129/22 scope global secondary nm-bond
    inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link noprefixroute
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> 
    link/ether 52:54:00:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet xx.xx.xx.xx/24 brd xx.xx.xx.255 scope global virbr0
(以下略)
$ rpm -q samba
samba-4.10.16-13.el7_9.x86_64

Issue

急にファイルサーバに繋がらなくなった。
直前にやったことといえば、サーバがハングってたので再起動したくらい。。。
そういえば昨日物理NICのアドレスを全部論理インターフェイスに纏めたなぁ

image.png

Resolve

/etc/samba/smb.conf の接続元インターフェイスを指定する部分にボンドインターフェイス(nm-bond)を追加してなかったので追加。

/etc/samba/smb.conf
-         interfaces = lo 127.0.0.0/8 eth0 eth1 172.xxx.xxx.xxx/xx
+         interfaces = lo 127.0.0.0/8 eth0 eth1 nm-bond 172.xxx.xxx.xxx/xx

troubleshooting memo

# 合否 確認箇所 確認方法(コマンド)
Ping OK ネットワークOK ping ${IP}
Name Resolve - IPv4アドレス直打ちなので関係無い
Firewall OK interfaces: nm-bond sudo firewall-cmd --list-all
OK services: samba sudo firewall-cmd --list-all
ServiceOnline OK Active: active (running) systemctl status smb nmb
ServiceListen OK tcp LISTEN 0 50 172.xx.xx.xx:445 *:* ss -ltun
CLI接続 NG do_connect: Connection to 172.xx.xx.xx failed (Error NT_STATUS_CONNECTION_REFUSED smbclient -m SMB3 //172.xx.xx.xx/temp
OK smb: \> ls smbclient -m SMB3 //localhost/temp

ローカルホストは行けるけど、アドレスがダメ・・・
F/W・・・?いや許可されてたし。。。後はなんだー…
そうだ。sambaの受付ポートの設定やってないやってことで確認

/etc/samba/smb.conf
[global]
        workgroup = WORKGROUP
        #smb ports = 445 139
        interfaces = lo 127.0.0.0/8 eth0 eth1 172.xxx.xxx.xxx/xx

とりあえず、interfacesnm-bond追加してみる。(そしてサービス再起動(sudo systemctl restart smb nmb))
エラーはなかった。CLIでつないで見る。。。いけた :)

Windowsからアクセスしてみる。行けた!

ちなみに

インターフェイスのボンド化はnmtui使ってやった。おそらくnmcliでもできそうだけど、とりあえずこれでいいや
image.png
image.png

各アドレス(参考)

8.8.8.8 ... Google public DNS (Primary)
8.8.4.4 ... Google public DNS (Secondary)
199.85.126.10 ... Norton Public DNS (Primary)
199.85.127.10 ... Norton Public DNS (Secondary)

あれ、Norton ConnectSafe サ終してんじゃん...orz
まだDNS解決してくれるけど・・・(別端末で確認済み)

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?