双网卡同时上内网和外网的问题
双网卡
原来内网的IP设置:
IP: 192.168.12.229
子网: 255.255.255.0
网关: 192.168.12.254
外网:
IP 和MAC地址绑定通过路由器上网
ip: 192.168.1.21
子网: 255.255.255.0
网关: 192.168.1.254
---------------------------------------------------------------
我参考了相关资料,进行如下操作:
1. 内网设置好IP,网关不变,掩码,
外网只设置好 IP,子网掩码,DNS
2. 然后运行CMD,在DOS下根据资料如此操作 :
C:\Documents and Settings\Owner>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x3 ...00 e0 4c b0 04 f0 ...... Realtek RTL8139/810x Family Fast Ethernet NIC -
数据包计划程序微型端口
0x20002 ...00 13 d3 59 4f a3 ...... Realtek RTL8139 Family PCI Fast Ethernet NIC
- 数据包计划程序微型端口
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.12.254 192.168.12.229 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.0 255.255.255.0 192.168.1.21 192.168.1.21 20
192.168.1.21 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.1.255 255.255.255.255 192.168.1.21 192.168.1.21 20
192.168.12.0 255.255.255.0 192.168.12.229 192.168.12.229 20
192.168.12.229 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.12.255 255.255.255.255 192.168.12.229 192.168.12.229 20
224.0.0.0 240.0.0.0 192.168.1.21 192.168.1.21 20
224.0.0.0 240.0.0.0 192.168.12.229 192.168.12.229 20
255.255.255.255 255.255.255.255 192.168.1.21 192.168.1.21 1
255.255.255.255 255.255.255.255 192.168.12.229 192.168.12.229 1
Default Gateway: 192.168.12.254
===========================================================================
Persistent Routes:
None
C:\Documents and Settings\Owner>route -p add 192.168.1.21 mask 255.255.255.0 192
.168.1.254 metric 1
The route addition failed: The specified mask parameter is invalid. (Destination
& Mask) != Destination.
却添加不成功!好象是子网掩码的问题,但是我的内外网掩码都是255.255.255.0啊
不知道该怎么操作才行?