使用道具 举报
Post by rapidccn;1990234 首先要说明的是,由于我的服务器部分用于商业用途,所以在这里我打算为帮助我解决问题的大侠提供¥100元的报酬。 虽然¥100元的并不足以感谢能够帮助我的大侠。但是由于财力有限,仅以此代表我对技术和知识的敬仰。 问题描述: 我新租用了一台双线双IP的服务器,上面最小化安装了Debian5操作系统及openSSH。 机房给我分配了两个IP,一个网通的(eth1)一个电信的(eht0),如下: allow-hotplug eth0 iface eth0 inet static address 123.55.248.121 netmask 255.255.255.0 network 123.55.248.0 broadcast 123.55.248.255 gateway 123.55.248.1 allow-hotplug eth1 iface eth1 inet static address 61.163.209.230 netmask 255.255.255.128 network 61.163.209.128 broadcast 61.163.209.255 gateway 61.163.209.129 通过ifconfig查看两个网卡都是UP的: eth0 Link encap:Ethernet HWaddr 00:24:1d:31:63:3a inet addr:123.55.248.121 Bcast:123.55.248.255 Mask:255.255.255.0 inet6 addr: fe80::224:1dff:fe31:633a/64 Scopeink UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1932940 errors:0 dropped:3791385337 overruns:0 frame:0 TX packets:415774 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:221204491 (210.9 MiB) TX bytes:285036242 (271.8 MiB) Interrupt:221 Base address:0x4000 eth1 Link encap:Ethernet HWaddr 00:b0:c4:02:5a:1d inet addr:61.163.209.230 Bcast:61.163.209.255 Mask:255.255.255.128 inet6 addr: fe80::2b0:c4ff:fe02:5a1d/64 Scopeink UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:231 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:13968 (13.6 KiB) Interrupt:20 Base address:0xd000 lo Link encapocal 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:8923 errors:0 dropped:0 overruns:0 frame:0 TX packets:8923 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:862000 (841.7 KiB) TX bytes:862000 (841.7 KiB) 现在的问题是网通的IP无法访问,电信的正常,只能当成单线服务器用了,十分不爽。 这个服务器刚交给我的时候还是两个IP都可以访问的,过了两天网通的IP就不通了,重启也不行。 我是linux新手,不会处理这个问题,服务器又等着用,所以想请有办法解决此问题的大侠帮我处理一下。 ------------------------------------------------------------------------------------------------------------
Post by sanyork;1990247 哥们,这么舍得花本钱,豪迈啊! 告诉你原因吧,那就是你只能设置一个网关,一台电脑上有两个网卡,设置两个默认网关,肯定有一个不通的。
Post by cyxhome;1990299 不知道楼主是在哪个机房? 据我知道的情况,一般双线机房都是在三层交换机上做设置,电信IP走电信的网关,网通IP走网通的网关。 用户在配置网络时,只用一个网关IP就行了,IP出了你的服务器,再由机房的三层交换机决定从哪个网关出去。 机房只给每台机器一条网线,就可以实现双IP的。对用户来说,只要在单网卡上配置双IP就行了,不需要使用两块网卡。 假设网线是插在eth0卡口上: 编辑/etc/network/interfaces文件 auto lo iface lo inet loopback auto eth0 iface eth0 inet static address xxx.xxx.xxx.xxx电信IP netmask xxx.xxx.xxx.xxx掩码 gateway xxx.xxx.xxx.xxx电信网关 auto eth0:1 iface eth0:1 inet static address xxx.xxx.xxx.xxx网通IP netmask xxx.xxx.xxx.xxx掩码 不用写网通的网关地址 dns-nameservers xxx.xxx.xxx.xxxDNS的IP auto eth1 iface eth1 inet dhcp 这个用不到,就让它先dhcp吧
本版积分规则 发表回复 回帖后跳转到最后一页