TIGER

双网卡同时上内外网设置教程
双网卡一个上内网,一个上外网的同时使用。这样即可保障内网的安全,又能解决电脑访问外网的问题。 首先需要有两块...
扫描右侧二维码阅读全文
07
2016/09

双网卡同时上内外网设置教程

双网卡一个上内网,一个上外网的同时使用。这样即可保障内网的安全,又能解决电脑访问外网的问题。

首先需要有两块网卡,分别接到两个路由上。

外网 internet 地址:192.168.1.1 子网掩码: 255.255.255.0, 网关: 192.168.1.1

内网地址:  192.168.42.129 子网掩码:255.255.255.0 网关:192.168.42.132

按正常的设置每块网卡的ip(或通过DHCP自动获取),再cmd下使用route print查看时会看到

即指向0.0.0.0的有两个网关,这样就会出现路由冲突,两个网络的访问都会出现问题。我们需要手动配置路由,才能实现同时访问两个网络。运行cmd(win需要管理员权限)

第一步: route delete 0.0.0.0   ::删除所有的0.0.0.0的路由

第二步:route -p add 0.0.0.0 mask 0.0.0.0 mask 192.168.1.1  ::添加0.0.0.0网络路由,这个是缺省时路由用192.168.1.1,加上-p的目的是设为静态(永久)路由,防止下次重起时配置消失。

第三步: route -p add 192.168.42.0 mask 255.255.255.0 192.168.42.132  ::添加192.168.42.0网段路由为192.168.42.132内网路由,可以根据需要调整ip段和子网掩码太到多网段内网路由的效果。

执行后,永久路由就多了二项了

因为上面我们添加的是静态路由,所以,重起后,tcp/ip设置里的默认网络会成为活动网关,这样也会造成路由冲突,所以,需要把内网的tcp/ip设置里的网关去掉。

Last modification:July 11th, 2018 at 09:45 pm
If you think my article is useful to you, please feel free to appreciate

9 comments

  1. zithromax

    I could not resist commenting. Very well written!

  2. trudyanton

    Appealing article , I am going to spend more hours learning about this subject.

  3. clement.maur

    This website is fantastic, i actually enjoy it.

  4. Google

    Google

    Just beneath, are many absolutely not connected web-sites to ours, nonetheless, they may be surely really worth going over.

  5. domenicgerstaecker

    I have been checking out a few of your stories and i must say nice stuff.
    I will certainly bookmark your site.

  6. donnychristmas

    Very informing story, saved your site for hopes to read more!

  7. lashawnrosenbaum

    I'm so thrilled that I stumbled on your website. You certainly know what you're talking about, and you made
    me feel like I ought to learn more about this.

  8. emiliehein

    This is something I actually have to try and do a lot of analysis into, thank you
    for the post

  9. 工控资料窝

    非常实用的教程,收藏了

Leave a Comment