急啊双线负载均衡,双ip,单网关不好搞,请帮我看看
大哥们,我不想多发贴,工作完不成,工作就丢了啊
http://bbs.chinaunix.net/forum/viewtopic.php?t=598731&show_type=
帖子被老大锁了
我参照的是http://61.142.213.50:8180/bbs/read.php?tid=10093
这里情况不一样的是 这里2个ip的网关一样,反而难做了
isp1:61.185.81.222 gateway:61.185.81.1
isp2:61.185.81.112 gateway:61.185.81.1
ip:192.168.1.1
系统是redhat es3.0
按资料的做,停到这里碰到困难了.
执行 ip route replace default via 61.185.81.1 dev eth0 table 10 和
ip route replace default \nexthop via 61.185.81.1 dev eth0 weight 4 \nexthop via 61.185.81.1 dev eth2 weight 1
提示出错都是
RTNETLINK answers: Network is unreachable
所以我的工作就停止到这里了。哪个大哥给看看怎么
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
老大别在锁了,我以后在不敢了。真的
[root@hygateway root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:4C:E1:93:EB
inet addr:61.185.81.222 Bcast:61.185.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:86 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9856 (9.6 Kb) TX bytes:4492 (4.3 Kb)
Interrupt:5 Base address:0x7000
eth1 Link encap:Ethernet HWaddr 00:E0:4C:81:10:2B
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:292081 errors:0 dropped:0 overruns:0 frame:0
TX packets:341156 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60981067 (58.1 Mb) TX bytes:183247655 (174.7 Mb)
Interrupt:11 Base address:0x9000
eth2 Link encap:Ethernet HWaddr 00:E0:4C:20:06:99
inet addr:61.185.81.122 Bcast:61.185.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:349709 errors:0 dropped:0 overruns:0 frame:0
TX packets:288443 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:183707653 (175.1 Mb) TX bytes:60688966 (57.8 Mb)
Interrupt:9 Base address:0xb000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:134 (134.0 b) TX bytes:134 (134.0 b)
linux能把一个网段ip配到两个网卡上去吗?
大哥什么意思啊?
谁帮帮我啊 qq47162298
ip route
贴一下结果
呵,我也试过,两个ADSL同样的网关,死都搞不定。
电信为了节约地址,这样搞法,害死好多人.
我现在在试验
1.服务器redhat es3.0 3网卡
isp1: eth0:192.168.1.239 gw:192.168.1.1
isp2: eth2:192.168.1.217 gw:192.168.1.1
内网: eth1:192.168.100.1
内网计算机:192.168.100.128 gw:192.168.100.1 winxp系统
2 .vi /etc/rc.d/rc.local
touch /var/lock/subsys/local
#!/bin/sh
#dhcpd eth0
/sbin/modprobe ip_tables
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp
/sbin/iptables -F
/sbin/iptables -F -t nat
/sbin/iptables -X
/sbin/iptables -Z
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
echo "1">; /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
/sbin/iptables -A FORWARD -s 0/0 -d 0/0 -j ACCEPT
3.[root@test root]# ip route ls
192.168.100.0/24 dev eth1 scope link
192.168.1.0/24 dev eth2 scope link
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.217
169.254.0.0/16 dev eth2 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.1.1 dev eth2
4.[root@test root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 * 255.255.255.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth2
192.168.1.0 * 255.255.255.0 U 0 0 0 eth2
169.254.0.0 * 255.255.0.0 U 0 0 0 eth2
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth2