Windows路由表配置:双网卡路由分流

一、windows 路由表解释

route print -4

===========================================================================
Interface List
 19...78 dd 08 a4 40 f4 ......Bluetooth Device (Personal Area Network)
11...00 27 10 5b 26 fc ......Intel(R) Centrino(R) Advanced-N 6200 AGN
 13...f0 de f1 08 58 f4 ......Intel(R) 82577LM Gigabit Network Connection
 15...00 50 56 c0 00 01 ......VMware Virtual Ethernet Adapter for VMnet1
 16...00 50 56 c0 00 08 ......VMware Virtual Ethernet Adapter for VMnet8
  1...........................Software Loopback Interface 1
 23...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 12...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
 21...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
 17...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #4
 20...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #5
 22...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #6
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.0.1     192.168.1.12     26
       10.108.0.0      255.255.0.0      10.108.58.1     10.108.58.18     21
      10.108.58.0    255.255.255.0         On-link      10.108.58.18    276
     10.108.58.18  255.255.255.255         On-link      10.108.58.18    276
    10.108.58.255  255.255.255.255         On-link      10.108.58.18    276
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
       172.16.0.0      255.255.0.0      10.108.58.1     10.108.58.18     21
      192.168.0.0    255.255.252.0         On-link      192.168.1.12    281
     192.168.1.12  255.255.255.255         On-link      192.168.1.12    281
    192.168.3.255  255.255.255.255         On-link      192.168.1.12    281
     192.168.10.0    255.255.255.0         On-link      192.168.10.1    276
     192.168.10.1  255.255.255.255         On-link      192.168.10.1    276
   192.168.10.255  255.255.255.255         On-link      192.168.10.1    276
    192.168.159.0    255.255.255.0         On-link     192.168.159.1    276
    192.168.159.1  255.255.255.255         On-link     192.168.159.1    276
  192.168.159.255  255.255.255.255         On-link     192.168.159.1    276
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link      10.108.58.18    276
        224.0.0.0        240.0.0.0         On-link     192.168.159.1    276
        224.0.0.0        240.0.0.0         On-link      192.168.10.1    276
        224.0.0.0        240.0.0.0         On-link      192.168.1.12    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link      10.108.58.18    276
  255.255.255.255  255.255.255.255         On-link     192.168.159.1    276
  255.255.255.255  255.255.255.255         On-link      192.168.10.1    276
  255.255.255.255  255.255.255.255         On-link      192.168.1.12    281
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
      172.21.10.0    255.255.255.0    172.16.56.190       1
       10.108.0.0      255.255.0.0      10.108.58.1       1
       172.16.0.0      255.255.0.0      10.108.58.1       1
===========================================================================

Interface List: 网络卡列表

Active Routes: 活动路由

Network Destination: 目的网段

Netmask: 子网掩码,与目的网段共同定义了此条路由适用的网络地址

Gateway: 网关,又称下一跳路由器,在发送IP数据包时,网关定义了针对特定的网络目的地址,数据包发送到的下一跳服务器

Interface: 接口,接口定义了针对特定的网络目的地址,本地计算机用于发送数据包的网络接口

Metric: 跳数,跳数用于指出路由的成本,通常情况下代表到达目标地址所需要经过的跳跃数量,一个跳数代表经过一个路由器。跳数越低,代表路由成本越低,优先级越高

Persistent Routes: 手动配置静态路由

二、windows 路由命令

Manipulates network routing tables.

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.

  -6           Force using IPv6.

  command      One of these:
                 PRINT     Prints  a route
                 ADD       Adds    a route
                 DELETE    Deletes a route
                 CHANGE    Modifies an existing route
  destination  Specifies the host.
  MASK         Specifies that the next parameter is the ‘netmask‘ value.
  netmask      Specifies a subnet mask value for this route entry.
               If not specified, it defaults to 255.255.255.255.
  gateway      Specifies gateway.
  interface    the interface number for the specified route.
  METRIC       specifies the metric, ie. cost for the destination.

All symbolic names used for destination are looked up in the network database
file NETWORKS. The symbolic names for gateway are looked up in the host name
database file HOSTS.

If the command is PRINT or DELETE. Destination or gateway can be a wildcard,
(wildcard is specified as a star ‘*‘), or the gateway argument may be omitted.

If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The ‘*‘ matches any string,
and ‘?‘ matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.

Pattern match is only allowed in PRINT command.
Diagnostic Notes:
    Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
    Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
             The route addition failed: The specified mask parameter is invalid.
 (Destination & Mask) != Destination.

Examples:

    > route PRINT
    > route PRINT -4
    > route PRINT -6
    > route PRINT 157*          .... Only prints those matching 157*

    > route ADD 157.0.0.0 MASK 255.0.0.0  157.55.80.1 METRIC 3 IF 2
             destination^      ^mask      ^gateway     metric^    ^
                                                         Interface^
      If IF is not given, it tries to find the best interface for a given
      gateway.
    > route ADD 3ffe::/32 3ffe::1

    > route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2

      CHANGE is used to modify gateway and/or metric only.

    > route DELETE 157.0.0.0
    > route DELETE 3ffe::/32

route print: 打印当前的路由表

route delete:删除一条路由

route add: 增加一条路由, 如果最后加上 –p 选项,表示永久增加静态路由,重启后不会失效

route change: 更改一条路由

三、双网卡配置实便

1. 网络环境:

有线:可连接公司内网,不能连接Internet

无线:可连接Internet,不能连接公司内网  默认网关为 192.168.0.1

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

2. 配置

:删除默认设置
route delete 0.0.0.0
:外网路由,全走无线
route add 0.0.0.0 mask 0.0.0.0 192.168.0.1 –p
:公司内网全部在10.108.*.*网段,增加此路由
route add 10.108.0.0 mask 255.255.0.0 10.108.58.1 -p

就是这么简单,结果如下(还有另外几个路由配置是做其它用途的)

PING下试试

原文地址:https://www.cnblogs.com/lcword/p/8149668.html

时间: 2024-08-29 15:45:34

Windows路由表配置:双网卡路由分流的相关文章

Windows Server 2012 R2配置双网卡绑定

生产环境的服务器硬件设备:2块网卡,分别接入2根网线 需要实现的效果:无论拔掉哪1根网线,都不会中断网络,实现网络的负载均衡,保证网络的持续可用. 前提条件:与这2块网卡相连的交换机必须做特殊配置(即这2个端口应该采取聚合方式),因为绑定的这2块网卡是使用同一个MAC地址. 1.在VMware Workstation中新增1块网卡,并查看网卡设备: 2.将2块网卡的IP地址都设置为"自动获得IP地址": Ethernet0: Ethernet1: 3.设置NIC组合: 点击NIC组合后

windows server 2012R2 双网卡绑定

windows server 2012R2 双网卡绑定 在目前的工作当中,对于双网卡绑定应用还是比较广泛的.双网卡绑定的好处在于,它可以实现网络的容错(主主模式.主备模式),还可以实现带宽的绑定.下面我们通过实验来实现双网卡的绑定. 实验准备:准备两个虚拟机,server01用来做目标服务器,需要两块网卡,并清除网卡上的所有配置.server02做测试服务器. 步骤一:准备至少两块网卡 首先在server01上添加一块网卡.,右键单击server01,选择配置,点击添加 选择网络适配器,下一步

vmvare虚拟机配置双网卡

最近想在windows上pc端安装一个VMware来准备几个linux系统测试环境玩玩 在配置网络上遇到点小问题,特在此处记录下 虚拟网络设置 首先点击VMware--->编辑---->虚拟网络设置 配置过程如下: 在clone好的虚拟机器上添加网络适配器 配置双网卡: 新clone的虚拟机里,配置好网卡,重启报错如下: 解决办法:cat /etc/udev/rules.d/70-persistent-net.rules 原因clone虚拟机器时,clone后的虚拟机保留了源虚拟机网卡的mac

Ubuntu 配置双网卡绑定,实现负载均衡

Ubuntu 配置双网卡绑定,实现负载均衡 1.Bond的工作模式 Linux bonding驱动提供了一个把多个网络接口设备捆绑为单个的网络接口设置来使用,用于网络负载均衡及网络冗余. bonding一共有7种工作模式(mode): 1).bond=0,(balance-rr) Round-robin policy: (平衡轮询策略):传输数据包顺序是依次传输,直到最后一个传输完毕,此模式提供负载平衡和容错能力. 2).bond=1,(active-backup) Active-backup

virtualbox 最小化安装centos7 配置双网卡(nat和桥接)记录----已经过期

该文章已经过期 请参考另一篇文章:virtualbox 安装centos7 配置桥接网卡,实现主机和虚拟机互通,虚拟机可以访问外网,解决无法上网问题 先说明一下为什么要配置双网卡? 配置nat网络, 虚拟机可以通过主机访问外网, 通过桥接网络, 虚拟机绑定静态ip,可以和其他虚拟机通信 改正:虚拟机可以通过配置一个桥接网卡,访问外网, 不需要配置两个网卡 最小化安装后,nat网卡没有启用,需要修改ifcfg-enp0s3 [[email protected] network-scripts]#

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

原文来自:http://www.cnblogs.com/lightnear/archive/2013/02/03/2890835.html 一.windows 路由表解释 route print -4 =========================================================================== Interface List 19...78 dd 08 a4 40 f4 ......Bluetooth Device (Personal Ar

linux配置双网卡双路由

CentOS双网卡双IP设置   系统环境:CentOS Linux 网络环境: 两个IP地址,10.4.34.31和10.4.35.31,掩码是255.255.255.0, 这两个子网的网关地址分别是10.4.34.1和10.4.35.1.   1. 为网卡eth0配置ip地址10.4.34.31,为网卡eth1配置ip地址为10.4.35.31配置文件为: /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scr

转:CentOS 7使用nmcli配置双网卡聚合LACP

进入CentOS 7以后,网络方面变化比较大,例如eth0不见了,ifconfig不见了,其原因是网络服务全部都由NetworkManager管理了,下面记录下今天下午用nmcli配置的网卡聚合,网络上资料比较多,这里仅记录以备忘,更详细的说明可以参考rhel7和centos7使用nmcli命令管理配置网络. CentOS7使用ip link代替ifconfig命令,使用teamd处理双网卡聚合,使用nmcli命令行配置网络. 实战发现team driver在重启时会有些问题,会漏掉设置混杂模式

Ubuntu 配置双网卡的问题

一台双网卡电脑拥有两个网关是不可能的,因为默认网关(default gateway)只能是一个.给Ubuntu Linux服务器安装两块网卡,分别设置不同的ip和网关(内网和外网),外网的通过外网网卡来访问,内网的通过内网网卡来访问,似乎实现起来很简单,但有些问题,因为默认网关(default gateway)只能是一个! 解决的办法就是: 1.将其中一块网卡(如外网)设置默认网关,另外一块网卡eth1不设置网关 sudo vi /etc/network/interfaces # The loo