关于单网卡双ip的问题

由 cobranail 在 06-17-2004 19:28 发表:

关于单网卡双ip的问题

现在有一块网卡,一个固定的ip 172.18.x.x,还有一个通过pppoe得到的动态ip:172.31.x.x

固定ip只能访问内网,ppp的ip只能访问外网

网卡设备是eth0,ppp的设备是ppp0,把固定的ip绑在eth0上,然后重启network service,用ifconfig查看,发现ppp0的ip没有变化,还是172.31.x.x,但是外网却已经不通了

有没有办法让这两个ip同时起作用?

系统:fc2


由 abby 在 06-17-2004 20:29 发表:


route -n

的输出写出来看看


由 cobranail 在 06-17-2004 20:44 发表:


未绑定固定ip时的

> quote: > > * * * > >
>
> [root@inferno user]# /sbin/ifconfig
>
> eth0 Link encap:Ethernet HWaddr 00:E0:4C:62:44:F3
>
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>
> RX packets:22662 errors:0 dropped:0 overruns:0 frame:0
>
> TX packets:10443 errors:0 dropped:0 overruns:0 carrier:0
>
> collisions:2529 txqueuelen:1000
>
> RX bytes:11107602 (10.5 Mb) TX bytes:1580599 (1.5 Mb)
>
> Interrupt:11 Base address:0x1000
>
>
>
> 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:27438 errors:0 dropped:0 overruns:0 frame:0
>
> TX packets:27438 errors:0 dropped:0 overruns:0 carrier:0
>
> collisions:0 txqueuelen:0
>
> RX bytes:4798266 (4.5 Mb) TX bytes:4798266 (4.5 Mb)
>
>
>
> ppp0 Link encap:Point-to-Point Protocol
>
> inet addr:172.31.0.77 P-t-P:24.24.24.24 Mask:255.255.255.255
>
> UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
>
> RX packets:8393 errors:0 dropped:0 overruns:0 frame:0
>
> TX packets:8149 errors:0 dropped:0 overruns:0 carrier:0
>
> collisions:0 txqueuelen:3
>
> RX bytes:7709185 (7.3 Mb) TX bytes:1155801 (1.1 Mb)
>
>
>
>
>
> [root@inferno user]# /sbin/route -n
>
> Kernel IP routing table
>
> Destination Gateway Genmask Flags Metric Ref Use Iface
>
> 24.24.24.24 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
>
> 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 lo
>
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
>
> 0.0.0.0 24.24.24.24 0.0.0.0 UG 0 0 0 ppp0
>
> > > * * *

绑定固定ip后的

> quote: > > * * * > >
>
> [root@inferno user]# /sbin/ifconfig
>
> eth0 Link encap:Ethernet HWaddr 00:E0:4C:62:44:F3
>
> inet addr:172.18.57.123 Bcast:172.18.57.255 Mask:255.255.255.0
>
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>
> RX packets:22858 errors:0 dropped:0 overruns:0 frame:0
>
> TX packets:10475 errors:0 dropped:0 overruns:0 carrier:0
>
> collisions:2537 txqueuelen:1000
>
> RX bytes:11131094 (10.6 Mb) TX bytes:1582799 (1.5 Mb)
>
> Interrupt:11 Base address:0x1000
>
>
>
> 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:27440 errors:0 dropped:0 overruns:0 frame:0
>
> TX packets:27440 errors:0 dropped:0 overruns:0 carrier:0
>
> collisions:0 txqueuelen:0
>
> RX bytes:4798366 (4.5 Mb) TX bytes:4798366 (4.5 Mb)
>
>
>
> ppp0 Link encap:Point-to-Point Protocol
>
> inet addr:172.31.0.77 P-t-P:24.24.24.24 Mask:255.255.255.255
>
> UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
>
> RX packets:8413 errors:0 dropped:0 overruns:0 frame:0
>
> TX packets:8169 errors:0 dropped:0 overruns:0 carrier:0
>
> collisions:0 txqueuelen:3
>
> RX bytes:7710225 (7.3 Mb) TX bytes:1156841 (1.1 Mb)
>
>
>
>
>
> [root@inferno user]# /sbin/route -n
>
> Kernel IP routing table
>
> Destination Gateway Gen

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus