- 论坛徽章:
- 0
|
我有一个集群,其中一个节点有双网卡,我想用一个节点作为内网节点,另一个作为访问外网地址,开始设置了ip后,内网没有问题。
[root@note1 ~]# ifconfig
em1 Link encap:Ethernet HWaddr C8:1F:66:BF:F2:50
inet addr:10.10.1.1 Bcast:10.10.255.255 Mask:255.255.0.0
inet6 addr: fe80::ca1f:66ff:febf:f250/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11189 errors:0 dropped:0 overruns:0 frame:0
TX packets:5153 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:986198 (963.0 KiB) TX bytes:459499 (448.7 KiB)
Interrupt:16
em2 Link encap:Ethernet HWaddr C8:1F:66:BF:F2:51
inet addr:10.24.1.1 Bcast:10.24.1.255 Mask:255.255.255.0
inet6 addr: fe80::ca1f:66ff:febf:f251/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1337 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:114048 (111.3 KiB) TX bytes:748 (748.0 b)
Interrupt:17
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:256 errors:0 dropped:0 overruns:0 frame:0
TX packets:256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24154 (23.5 KiB) TX bytes:24154 (23.5 KiB)
但是,外网就无法连接了。
我按照http://linux.chinaunix.net/techd ... 07/02/1014693.shtml,重新设置了路由,结果也不成,报
[root@note1 ~]# ping 10.24.172.142
PING 10.24.172.142 (10.24.172.142) 56(84) bytes of data.
From 10.10.1.1 icmp_seq=2 Destination Host Unreachable
From 10.10.1.1 icmp_seq=3 Destination Host Unreachable
From 10.10.1.1 icmp_seq=4 Destination Host Unreachable
From 10.10.1.1 icmp_seq=6 Destination Host Unreachable
From 10.10.1.1 icmp_seq=7 Destination Host Unreachable
From 10.10.1.1 icmp_seq=8 Destination Host Unreachable
From 10.10.1.1 icmp_seq=10 Destination Host Unreachable
From 10.10.1.1 icmp_seq=11 Destination Host Unreachable
From 10.10.1.1 icmp_seq=12 Destination Host Unreachable
From 10.10.1.1 icmp_seq=14 Destination Host Unreachable
From 10.10.1.1 icmp_seq=15 Destination Host Unreachable
From 10.10.1.1 icmp_seq=16 Destination Host Unreachable
From 10.10.1.1 icmp_seq=18 Destination Host Unreachable
From 10.10.1.1 icmp_seq=19 Destination Host Unreachable
但是,外网的网关是通的,
[root@note1 ~]# ping 10.24.1.250
PING 10.24.1.250 (10.24.1.250) 56(84) bytes of data.
64 bytes from 10.24.1.250: icmp_seq=1 ttl=255 time=0.617 ms
64 bytes from 10.24.1.250: icmp_seq=2 ttl=255 time=0.645 ms
64 bytes from 10.24.1.250: icmp_seq=3 ttl=255 time=0.653 ms
64 bytes from 10.24.1.250: icmp_seq=4 ttl=255 time=0.626 ms
64 bytes from 10.24.1.250: icmp_seq=5 ttl=255 time=0.616 ms
64 bytes from 10.24.1.250: icmp_seq=6 ttl=255 time=0.606 ms
64 bytes from 10.24.1.250: icmp_seq=7 ttl=255 time=0.583 ms
路由设置如下:
[root@note1 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.24.1.0 * 255.255.255.0 U 1 0 0 em2
10.10.1.0 * 255.255.255.0 U 0 0 0 em1
10.10.0.0 * 255.255.0.0 U 0 0 0 em1
link-local * 255.255.0.0 U 1002 0 0 em1
default note1 0.0.0.0 UG 0 0 0 em1
请大家帮忙看看,我怎么能够ping通10.24.172.142, 另外,我down了em1后,是可以,觉得还是两个网卡是冲突,还有,我打开了/proc/sys/network/ipv4/ip_forward,值是1 |
|