我试图在两个以太网端口上设置四个IP。 我想我会分配一个,然后为其余两个创build别名。
这是我用我有限的networking知识所做的:
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 90.70.200.200 netmask 255.255.255.192 # network # broadcast gateway 90.70.200.254 auto eth0:0 iface eth0:0 inet static address 90.70.200.239 netmask 255.255.255.192 auto eth1 iface eth1 inet static address 90.70.200.240 netmask 255.255.255.192 auto eth1:0 iface eth1:0 inet static address 90.70.200.241 netmask 255.255.255.192
该设置只能部分工作。 我可以从外部ping所有的IP,但不能通过eth0的任何地方到达外部世界。 我确实希望能够做到这一点。
两个注意事项:我没有触及原来的eth0configuration,configuration人员只给我提供了IP和networking掩码,所以我推测我不需要添加任何东西。
用例:通过多个IP点击亚马逊产品广告API的工作人员群。
我究竟做错了什么?
我有同样的问题,我发现这从debian张贴。 它为我工作得很好。
auto eth0 iface eth0 inet static address 90.70.200.200 netmask 255.255.255.192 broadcast 90.70.200.255 gateway 90.70.200.254 # the "up" lines are executed verbatim when the interface is brought up up ip addr add 90.70.200.239 brd 90.70.200.255 dev eth0 label eth0:0 up ip addr add 90.70.200.240 brd 90.70.200.255 dev eth0 label eth0:1