我有基本的 ubuntu 背景,但不熟悉我正在查看的 CentOS 服务器上 ifconfig 的输出,有人可以解释一下这里的eth0:cp1
、和eth0:cp2
条目吗?
它们在 iptables 中是如何处理的?
eth0 Link encap:Ethernet HWaddr 00:30:48:CD:B7:C6
inet addr:72.51.xx.xxx Bcast:72.51.xx.255 Mask:255.255.255.192
inet6 addr: xxxx::xxx:xxxx:xxxx:b7c6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4743057 errors:0 dropped:0 overruns:0 frame:0
TX packets:3884102 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1495909136 (1.3 GiB) TX bytes:1596842222 (1.4 GiB)
Memory:da020000-da040000
eth0:cp1 Link encap:Ethernet HWaddr 00:30:48:CD:B7:C6
inet addr:69.174.xxx.xx Bcast:69.174.xxx.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:da020000-da040000
eth0:cp2 Link encap:Ethernet HWaddr 00:30:48:CD:B7:C6
inet addr:216.157.xxx.xxx Bcast:216.157.xxx.235 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:da020000-da040000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:745806 errors:0 dropped:0 overruns:0 frame:0
TX packets:745806 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:267688406 (255.2 MiB) TX bytes:267688406 (255.2 MiB)
答案1
这些是子接口,是一种将其他 IP 地址及其子网添加到接口的方法。冒号后的部分是任意的。
iptables 不能引用子接口,因此所需的任何规则都应基于 IP 地址,但如果需要则绑定到物理接口。