單網(wǎng)卡雙IP
1、兩網(wǎng)線(操作系統(tǒng)xp sp2)
假設(shè)外網(wǎng):透過NAT上網(wǎng)
ip:172.28.160.143
Mask:255.255.255.0
gateway:172.28.160.16
dns:172.24.96.110
假設(shè)內(nèi)網(wǎng):局域網(wǎng)
ip:192.168.1.99
mask:255.255.255.0
gateway:192.168.1.1
DNS:192.168.1.1
因為內(nèi)網(wǎng)外網(wǎng)不許同時上,只有一個網(wǎng)卡,兩根網(wǎng)線,網(wǎng)線來回?fù)Q
對本地連接進行如下配置:
IP Address. . . . . . . . . . . . : 172.28.160.143
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IP Address. . . . . . . . . . . . : 192.168.1.99
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
172.28.160.16
發(fā)現(xiàn)更換網(wǎng)線后網(wǎng)絡(luò)不能自動切換,執(zhí)行命令
route -p ADD 172.0.0.0 MASK 255.0.0.0 172.28.160.16 METRIC 1
route -p ADD 0.0.0.0 MASK 0.0.0.0 192.168.1.1 METRIC 1
這時候在網(wǎng)線更換后,等幾秒鐘網(wǎng)絡(luò)就聯(lián)通可以使用了,省去了修改ip設(shè)置的麻煩
此時的路由表
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 172.28.160.16 192.168.1.99 20
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.99 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
172.0.0.0 255.0.0.0 172.28.160.16 192.168.1.99 1
172.28.160.0 255.255.255.0 172.28.160.143 192.168.1.99 20
172.28.160.143 255.255.255.255 127.0.0.1 127.0.0.1 20
172.28.255.255 255.255.255.255 192.168.1.99 192.168.1.99 20
192.168.1.0 255.255.255.0 192.168.1.99 192.168.1.99 20
192.168.1.99 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.1.255 255.255.255.255 192.168.1.99 192.168.1.99 20
224.0.0.0 240.0.0.0 192.168.1.99 192.168.1.99 20
255.255.255.255 255.255.255.255 192.168.1.99 192.168.1.99 1
Default Gateway: 192.168.1.1
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
172.0.0.0 255.0.0.0 172.28.160.16 1
0.0.0.0 0.0.0.0 192.168.1.1 1
2、單網(wǎng)線
多WAN口的路由器
或者兩路交換機都連兩個路由器,然后每個pc端設(shè)置兩組ip并添加靜態(tài)