为桥接接口分配 IP 地址真的有任何意义吗?注意:网桥是使用 brctl 创建的,然后将 IP 地址分配给创建的 br0。
为桥接接口分配 IP 地址有什么好处/用途
我想知道从刚刚从 DHCP 服务器获取 IP 地址的客户端(基于 Linux )获取 DHCP 服务器地址的最佳方法是什么?
我搜索了一下,在大多数文章中都发现了这一点,
less /var/lib/dhcp3/dhclient.leases
Run Code Online (Sandbox Code Playgroud)
但是,如果客户端是虚拟机,并且从某个外部 DHCP 服务器分配了 IP 地址,则文件“/var/lib/dhcp3/dhclient.leases”将不存在。
我尝试在客户端计算机中执行“ifconfig”,这是输出
eth0 Link encap:Ethernet HWaddr 00:0C:29:2C:3C:6A
inet addr:192.168.163.128 Bcast:192.168.163.255 Mask:255.255.255.0
Run Code Online (Sandbox Code Playgroud)
我可以看到广播(Bcast)地址,但无法在任何地方找到真正的 DHCP 服务器地址。
希望有人能为我提供一个好的解决方案。
谢谢并致以诚挚的问候。
我正在寻找一种方法将所有流量(到任何端口)从一台电脑转发到某个IP。
看看下面的规则:
iptables -t nat -A PREROUTING -p tcp --dport 443 --jump DNAT --to-destination 129.94.5.88:5000
Run Code Online (Sandbox Code Playgroud)
这告诉我所有发往端口 443 的流量都应该转移到129.94.5.88:5000. 我如何更改此规则以表示:
iptables -t nat -A PREROUTING -p tcp --dport "ANY DESTINATION PORT" --jump DNAT --to-destination 129.94.5.88:5000
Run Code Online (Sandbox Code Playgroud)
我还想知道如何根据目标IP而不是端口进行重定向。所以再次查看这条规则:
iptables -t nat -A PREROUTING -p tcp --dport 8443 --jump DNAT --to-destination 129.94.5.88:5000
Run Code Online (Sandbox Code Playgroud)
如何更改此设置以基于目标 IP(比如说8.8.8.8)而不是端口进行重定向?
我发现我的 VPN 连接从test-ipv6.com泄漏,显示我的 VPN 的 IPv4 地址但我的家庭路由器的 IPv6 地址。
我使用以下.ovpn文件设置了我的 VPN 连接,该文件是从privateinternetaccess.com下载的
client
dev tun
proto udp
remote ireland.privateinternetaccess.com 1197
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-256-cbc
auth sha256
tls-client
remote-cert-tls server
auth-user-pass
comp-lzo
verb 1
reneg-sec 0
crl-verify crl.rsa.4096.pem
ca ca.rsa.4096.crt
disable-occ
Run Code Online (Sandbox Code Playgroud)
如何配置和/或传递哪些标志openvpn以启用 IPv6 路由?
在 Centos7 上运行 logstash,我认为网卡可能已饱和。
从 logstash 服务器我也可以看到服务器发送日志的请求。但是我不确定根据我的设置请求 q 是否很高,或者 tcp 调整在这里是否对我有帮助。
一些信息:
sysctl -a | grep mem
net.core.optmem_max = 20480
net.core.rmem_default = 212992
net.core.rmem_max = 212992
net.core.wmem_default = 212992
net.core.wmem_max = 212992
net.ipv4.igmp_max_memberships = 20
net.ipv4.tcp_mem = 227763 303685 455526
net.ipv4.tcp_rmem = 4096 87380 6291456
net.ipv4.tcp_wmem = 4096 16384 4194304
net.ipv4.udp_mem = 229686 306249 459372
net.ipv4.udp_rmem_min = 4096
net.ipv4.udp_wmem_min = 4096
vm.lowmem_reserve_ratio = 256 256 32
vm.memory_failure_early_kill = 0
vm.memory_failure_recovery = 1
vm.nr_hugepages_mempolicy = 0
vm.overcommit_memory = 0
netstat -na …Run Code Online (Sandbox Code Playgroud) 我正在尝试启动并运行一个非常简单的 TFTP 服务器,以便用作 IPXE 引导服务器。但是,我似乎所做的一切似乎都无法使服务器能够与远程客户端进行通信。我可以让客户端通过 localhost 进行通信,这似乎很好用。
tftp $TFTP_SERVER -c get README
Run Code Online (Sandbox Code Playgroud)
虽然这在本地主机上效果很好,但它违背了拥有可以远程通话的服务器的目的。tftp 配置文件内容如下:
[root@ipxe tmp]# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = …Run Code Online (Sandbox Code Playgroud) 我目前无法从我的私有 Kubernetes 集群访问/ping/连接到 Google 之外的任何服务。Pod 正在运行 Alpine linux。
路由表
/sleepez/api # ip route show table all
default via 10.52.1.1 dev eth0
10.52.1.0/24 dev eth0 scope link src 10.52.1.4
broadcast 10.52.1.0 dev eth0 table local scope link src 10.52.1.4
local 10.52.1.4 dev eth0 table local scope host src 10.52.1.4
broadcast 10.52.1.255 dev eth0 table local scope link src 10.52.1.4
broadcast 127.0.0.0 dev lo table local scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local scope host src 127.0.0.1
local 127.0.0.1 …Run Code Online (Sandbox Code Playgroud) linux-networking kubernetes google-cloud-platform google-kubernetes-engine
我使用的是 Ubuntu 18.04,我在系统上启用了 UFW,而没有考虑添加规则,我对必须删除的恶意软件感到紧张。然后启用 UFW 后,我忘记添加规则,我重新启动了我的专用服务器,正如预期的那样,由于没有规则,服务器根本不响应 SSH。
我重新启动进入救援模式,fdisk -l给出了这些结果
磁盘 /dev/ram0:64 MiB,67108864 字节,131072 个扇区 单位:1 * 512 = 512 字节的扇区 扇区大小(逻辑/物理):512 字节/4096 字节 I/O 大小(最小/最佳):4096 字节/ 4096字节
磁盘 /dev/ram1:64 MiB,67108864 字节,131072 个扇区 单位:1 * 512 = 512 字节的扇区 扇区大小(逻辑/物理):512 字节/4096 字节 I/O 大小(最小/最佳):4096 字节/ 4096字节
磁盘 /dev/ram2:64 MiB,67108864 字节,131072 个扇区 单位:1 * 512 = 512 字节的扇区 扇区大小(逻辑/物理):512 字节/4096 字节 I/O 大小(最小/最佳):4096 字节/ 4096字节
磁盘 /dev/ram3:64 MiB,67108864 字节,131072 个扇区 单位:1 * 512 = 512 字节的扇区 扇区大小(逻辑/物理):512 字节/4096 字节 I/O …
我有一台具有两个接口的计算机,这两个接口具有不同的可路由 IPv4 地址。为了在正确的接口上返回流量,我使用了这个答案和评论,它有效:我可以使用任一 IP 地址 ssh 进入机器。(我不知道这是否有任何影响,但可能有。)
现在我使用此答案添加了以下用于反向代理/DNAT 的 iptables 规则。我的启动脚本现在看起来像:
# eth0 is automatically brought up and gets 192.168.1.2 as IP
sudo ip link set eth1 up
sudo ip addr add 192.168.2.2/24 dev eth1
sudo ip rule add from 192.168.2.2 table frometh1
sudo ip route add default via 192.168.2.1 dev eth1 table frometh1
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.0.0.1:443
sudo iptables -t nat -A …Run Code Online (Sandbox Code Playgroud) 我在连接到我的 VPN 时遇到问题,端口转发设置正确,因为我可以 VPN 连接到我的其他 lubuntu 机器,而且 UFW 也被禁用。有人可以指导我了解我的配置中缺少什么吗?另外,当我打开我的 UFW 时,我可以通过 google.com 之类的名称 ping WAN 或网站,但不能按名称 ping 工作组计算机,但只有当我添加带有计算机名称的“.local”后缀时,我才能 ping 局域网。
我希望上述问题与我的 openVPN 配置无关。由于这是网络问题,我觉得也要添加 UFW 问题。下面是我的详细配置:
嗨,这是我的 openvpn.log 文件:
Thu Jun 13 16:54:01 2019 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jan 9 2019
Thu Jun 13 16:54:01 2019 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08
Thu Jun 13 16:54:01 2019 Diffie-Hellman initialized with 2048 bit key
Thu Jun 13 16:54:01 2019 Outgoing …Run Code Online (Sandbox Code Playgroud) linux-networking ×10
linux ×5
networking ×3
centos ×2
iptables ×2
openvpn ×2
ubuntu-18.04 ×2
vpn ×2
bridge ×1
centos6 ×1
centos7 ×1
dhcp ×1
dhcp-server ×1
dnat ×1
ipv6 ×1
kubernetes ×1
redirect ×1
tcp ×1
tftp ×1
ufw ×1
vpn-client ×1