Не может SSH к машине в Локальной сети (испытывать таймаут), может SSH от озида LAN

У меня есть Поле 'нечто', которое имеет выполнение sshd. Я желаю к ssh к этой машине через Поле 'панели'. Поле 'нечто' имеет IP-адрес 10.0.0.100, и Поле 'панель' имеет IP 10.0.0.109. Шлюз для обеих из этих машин 10.0.0.10. Если я вне LAN, я могу ssh к Полю 'нечто' очень хорошо.

Я боюсь, что это имеет некоторое отношение к моей работе iptables шлюза. Кто-то может проверить мою работу дважды для меня? Я не могу понять это.

Кажется, поскольку нет никакого маршрута между машинами на LAN. Должен упомянуть, что Поле 'нечто' подключено к шлюзу через eth1 (шлюз), и Поле 'панель' соединено через wlan0 (шлюз). Оба этих интерфейса соединяются мостом как 'br0'.

У меня есть брандмауэр на поле 'нечто' однако, это было отключено для тестирования.

Править

Я выяснил, что путем изменения политики от Отбрасывания для Передачи на iptables на шлюзе соединение позволяется еще раз. Теперь мой вопрос состоит в том, как я могу вставить правило, которое позволяет соединениям LAN происходить при хранении polic Форварда на Отбрасывании?

$ cat /etc/ssh/sshd_config ## ON BOX 'foo'

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel VERBOSE

# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# Subsystem sftp /usr/lib/openssh/sftp-server #out 2/20/16

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

# Allow limited users access to server
AllowUsers foouser XXXXXXXXXX  # <--- Censored

# SFTP Subsystem  
Subsystem sftp internal-sftp
Match group XXXXXXXXXX  #  <--- Censored
ChrootDirectory /srv/sftp
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

...

# iptables -nvL ## ON gateway

Chain INPUT (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
  703 52346 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:2022
    7   757 LOGNDROP   all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  110 21617 ACCEPT     all  --  eth0   br0     0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  126 16289 ACCEPT     all  --  br0    eth0    0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            10.0.0.100            tcp dpt:22 state NEW,RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0           
  590  173K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED

Chain LOGNDROP (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    7   757 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            LOG flags 0 level 4 prefix "iptables: "
    7   757 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0
0
задан 28 May 2016 в 08:04

1 ответ

Решенный моя собственная проблема, вопрос я имел после "редактирования".

При добавлении этого правила к моему Вперед цепочка в iptables решила проблему

iptables -A FORWARD -i br0 -o br0 -j ACCEPT
1
ответ дан 23 December 2019 в 17:29

Другие вопросы по тегам:

Похожие вопросы: