Windows路由表配置:双网卡同时上公司内外网

一、windows 路由表解释

route print -4

Interface List: 网络卡列表
Active Routes: 活动路由
Network Destination: 目的网段
Netmask: 子网掩码,与目的网段共同定义了此条路由适用的网络地址
Gateway: 网关,又称下一跳路由器,在发送IP数据包时,网关定义了针对特定的网络目的地址,数据包发送到的下一跳服务器
Interface: 接口,接口定义了针对特定的网络目的地址,本地计算机用于发送数据包的网络接口
Metric: 跳数,跳数用于指出路由的成本,通常情况下代表到达目标地址所需要经过的跳跃数量,一个跳数代表经过一个路由器。跳数越低,代表路由成本越低,优先级越高
Persistent Routes: 手动配置静态路由

二、windows 路由命令

ROUTE [-f] [-p] [-4|-6] command [destination]
                  [MASK netmask]  [gateway] [METRIC metric]  [IF interface]
  -f           Clears the routing tables of all gateway entries.  If this is
               used in conjunction with one of the commands, the tables are
               cleared prior to running the command.
  -p           When used with the ADD command, makes a route persistent across
               boots of the system. By default, routes are not preserved
               when the system is restarted. Ignored for all other commands,
               which always affect the appropriate persistent routes. This
               option is not supported in Windows 95.
  -4           Force using IPv4.

route print: 打印当前的路由表
route delete:删除一条路由
route add: 增加一条路由, 如果最后加上 –p 选项,表示永久增加静态路由,重启后不会失效
route change: 更改一条路由

三、双网卡配置实便

1. 网络环境:

外网网关:192.168.1.1

内网网关:10.10.20.1

我们的目的就是同时连接这两个网络,并自动选择路由实现内外网都可以访问。

2. 配置

:删除默认设置

route delete 0.0.0.0

:外网路由
route  add  0.0.0.0  mask  0.0.0.0  192.168.1.1  -p

:公司内网全部在10.108.*.*网段,增加此路由
route  add  10.108.0.0  mask  255.255.0.0  10.10.20.1  -p

3.验证

ping www.baidu.com

ping 10.108.0.11

  • 3
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

周易宅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值