Configure iptables to forward subnets data on Linux

  • source: 192.168.1.0/24
  • destination: 172.16.1.0/24
  • policy: SNAT
iptables -A FORWARD -s 192.168.1.0/24 -d 172.16.1.1/24 -j ACCEPT
iptables -A FORWARD -s 172.16.1.0/24 -d 192.168.1.0/24 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 172.16.1.0/24 -[......]

继续阅读

How to change timezone in a running Docker Container

  • The timezone info folder is /usr/share/zoneinfo
  • The current timezone info file is /etc/localtime
  • The current zoneinfo is a link file point to a special timezone file in the timezone info filder. So, we can change the link file point to another timezone like following example
ln -s /usr/share/zone[......]

继续阅读

Solution to slow boot time (systemd-networkd-wait-online.service)

#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or[......]

继续阅读