内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

CentOS7下怎么配置虛擬路由器-創(chuàng)新互聯(lián)

這篇文章主要介紹“CentOS7下怎么配置虛擬路由器”,在日常操作中,相信很多人在CentOS7下怎么配置虛擬路由器問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”CentOS7下怎么配置虛擬路由器”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

為定州等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及定州網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計、定州網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!

一、環(huán)境及需求說明

CentOS7下怎么配置虛擬路由器

本地測試環(huán)境,由于win7+vmware這臺機器網(wǎng)卡太新,無法被vmware exsi識別,無奈之下就直接裝了個win7,然后再上面基于vmware workstation 12開啟了一些臨時測試的虛擬機。其次本地直連網(wǎng)段192.168.1.0 ip有限,而又希望直接從本機(如圖win10) ssh連接到這些虛擬機,因此考慮使用linux的ip轉(zhuǎn)發(fā)功能來實現(xiàn)。


上述圖片中已經(jīng)列出了各個節(jié)點的ip信息,紅色的虛擬機充當(dāng)軟路由,配置好之后,實現(xiàn)win10 直接ssh到虛擬機。

二、虛擬路由服務(wù)器配置

###查看網(wǎng)卡信息
[root@centos7-router ~]# ip addr
1: lo: <loopback,up,lower_up> mtu 65536 qdisc noqueue state unknown 
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
  inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eno16777728: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state up qlen 1000
  link/ether 00:0c:29:9c:eb:2d brd ff:ff:ff:ff:ff:ff
  inet 172.24.8.254/24 brd 172.24.8.255 scope global eno16777728
   valid_lft forever preferred_lft forever
  inet6 fe80::20c:29ff:fe9c:eb2d/64 scope link 
   valid_lft forever preferred_lft forever
3: eno33554960: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state up qlen 1000
  link/ether 00:0c:29:9c:eb:37 brd ff:ff:ff:ff:ff:ff
  inet 192.168.1.175/24 brd 192.168.1.255 scope global dynamic eno33554960
   valid_lft 82384sec preferred_lft 82384sec
  inet6 fe80::20c:29ff:fe9c:eb37/64 scope link 
   valid_lft forever preferred_lft forever

###查看路由表
[root@centos7-router ~]# route -n
kernel ip routing table ###缺省情況下,每塊網(wǎng)卡都有一個基于本網(wǎng)段的路由記錄
destination  gateway    genmask    flags metric ref  use iface
0.0.0.0    192.168.1.1  0.0.0.0    ug  100  0    0 eno33554960
172.24.8.0   0.0.0.0    255.255.255.0 u  100  0    0 eno16777728
192.168.1.0  0.0.0.0    255.255.255.0 u  100  0    0 eno33554960

###使用ip命令方式查看路由
[root@centos7-router ~]# ip route list
default via 192.168.1.1 dev eno33554960 proto static metric 100 
172.24.8.0/24 dev eno16777728 proto kernel scope link src 172.24.8.254 metric 100 
192.168.1.0/24 dev eno33554960 proto kernel scope link src 192.168.1.175 metric 100 

###開啟ip forward
[root@centos7-router ~]# cp /usr/lib/sysctl.d/50-default.conf /usr/lib/sysctl.d/50-default.conf.bk
[root@centos7-router ~]# echo "net.ipv4.ip_forward = 1" >>/usr/lib/sysctl.d/50-default.conf
[root@centos7-router ~]# grep ip_forward /usr/lib/sysctl.d/50-default.conf
net.ipv4.ip_forward = 1
[root@centos7-router ~]# sysctl -p ###如不生效重啟一下os

三、centos7-a主機下添加路由

###查看當(dāng)前主機ip 信息
[root@centos7-a ~]# ip addr list
1: lo: <loopback,up,lower_up> mtu 65536 qdisc noqueue state unknown 
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
  inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eno16777728: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state up qlen 1000
  link/ether 00:0c:29:57:26:9d brd ff:ff:ff:ff:ff:ff
  inet 172.24.8.131/24 brd 172.24.8.255 scope global dynamic eno16777728
   valid_lft 1088sec preferred_lft 1088sec
  inet6 fe80::20c:29ff:fe57:269d/64 scope link 
   valid_lft forever preferred_lft forever

###查看當(dāng)前主機路由信息   
[root@centos7-a ~]# ip route list
172.24.8.0/24 dev eno16777728 proto kernel scope link src 172.24.8.131 metric 100 

[root@centos7-a ~]# # author : leshami
[root@centos7-a ~]# # blog : http://blog.csdn.net/leshami
[root@centos7-a ~]# ip route add default via 172.24.8.254
[root@centos7-a ~]# ip route list
default via 172.24.8.254 dev eno16777728 
172.24.8.0/24 dev eno16777728 proto kernel scope link src 172.24.8.131 metric 100 

###測試到虛擬路由器網(wǎng)關(guān)ip連通性
[root@centos7-a ~]# ping 172.24.8.254 -c 2       
ping 172.24.8.254 (172.24.8.254) 56(84) bytes of data.
64 bytes from 172.24.8.254: icmp_seq=1 ttl=64 time=0.268 ms
64 bytes from 172.24.8.254: icmp_seq=2 ttl=64 time=0.302 ms

--- 172.24.8.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.268/0.285/0.302/0.017 ms

###測試到虛擬路由器ip連通性
[root@centos7-a ~]# ping 192.168.1.175 -c 2
ping 192.168.1.175 (192.168.1.175) 56(84) bytes of data.
64 bytes from 192.168.1.175: icmp_seq=1 ttl=64 time=0.475 ms
64 bytes from 192.168.1.175: icmp_seq=2 ttl=64 time=0.443 ms

--- 192.168.1.175 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.443/0.459/0.475/0.016 ms

四、windows 10下配置路由

###當(dāng)前環(huán)境
c:\>systeminfo | findstr build
os version:        10.0.14393 n/a build 14393
os build type:      multiprocessor free

###查看當(dāng)前的路由信息
c:\>route print -4
===========================================================================
interface list
 7...54 ab 3a xx b8 ea ......intel(r) ethernet connection i219-v
21...ac 2b 6e 5f 3b 57 ......microsoft wi-fi direct virtual adapter
            ......
===========================================================================
ipv4 route table
===========================================================================
active routes:
network destination    netmask     gateway   interface metric
     0.0.0.0     0.0.0.0   192.168.1.1  192.168.1.242  35
    127.0.0.0    255.0.0.0    on-link    127.0.0.1  331
    127.0.0.1 255.255.255.255    on-link    127.0.0.1  331
 127.255.255.255 255.255.255.255    on-link    127.0.0.1  331
   172.24.10.0  255.255.255.0    on-link   172.24.10.1  291
   172.24.10.1 255.255.255.255    on-link   172.24.10.1  291
  172.24.10.255 255.255.255.255    on-link   172.24.10.1  291
   192.168.1.0  255.255.255.0    on-link  192.168.1.242  291
  192.168.1.242 255.255.255.255    on-link  192.168.1.242  291
  192.168.1.255 255.255.255.255    on-link  192.168.1.242  291
  192.168.16.0  255.255.255.0    on-link   192.168.16.1  291
  192.168.16.1 255.255.255.255    on-link   192.168.16.1  291
 192.168.16.255 255.255.255.255    on-link   192.168.16.1  291
    224.0.0.0    240.0.0.0    on-link    127.0.0.1  331
    224.0.0.0    240.0.0.0    on-link  192.168.1.242  291
    224.0.0.0    240.0.0.0    on-link   192.168.16.1  291
    224.0.0.0    240.0.0.0    on-link   172.24.10.1  291
 255.255.255.255 255.255.255.255    on-link    127.0.0.1  331
 255.255.255.255 255.255.255.255    on-link  192.168.1.242  291
 255.255.255.255 255.255.255.255    on-link   192.168.16.1  291
 255.255.255.255 255.255.255.255    on-link   172.24.10.1  291
===========================================================================
persistent routes:
 none

###添加持久化路由 
c:\>route add 172.24.8.0 mask 255.255.255.0 192.168.1.175 -p
ok!

c:\>route print -4

ipv4 route table
===========================================================================
active routes:
network destination    netmask     gateway   interface metric
     0.0.0.0     0.0.0.0   192.168.1.1  192.168.1.242  35
    127.0.0.0    255.0.0.0    on-link    127.0.0.1  331
    127.0.0.1 255.255.255.255    on-link    127.0.0.1  331
 127.255.255.255 255.255.255.255    on-link    127.0.0.1  331
   172.24.8.0  255.255.255.0  192.168.1.175  192.168.1.242  36
   172.24.10.0  255.255.255.0    on-link   172.24.10.1  291
   172.24.10.1 255.255.255.255    on-link   172.24.10.1  291
  172.24.10.255 255.255.255.255    on-link   172.24.10.1  291
   192.168.1.0  255.255.255.0    on-link  192.168.1.242  291
  192.168.1.242 255.255.255.255    on-link  192.168.1.242  291
  192.168.1.255 255.255.255.255    on-link  192.168.1.242  291
  192.168.16.0  255.255.255.0    on-link   192.168.16.1  291
  192.168.16.1 255.255.255.255    on-link   192.168.16.1  291
 192.168.16.255 255.255.255.255    on-link   192.168.16.1  291
    224.0.0.0    240.0.0.0    on-link    127.0.0.1  331
    224.0.0.0    240.0.0.0    on-link  192.168.1.242  291
    224.0.0.0    240.0.0.0    on-link   192.168.16.1  291
    224.0.0.0    240.0.0.0    on-link   172.24.10.1  291
 255.255.255.255 255.255.255.255    on-link    127.0.0.1  331
 255.255.255.255 255.255.255.255    on-link  192.168.1.242  291
 255.255.255.255 255.255.255.255    on-link   192.168.16.1  291
 255.255.255.255 255.255.255.255    on-link   172.24.10.1  291
===========================================================================
persistent routes: ###以下為添加的持久化路由記錄
 network address     netmask gateway address metric
   172.24.8.0  255.255.255.0  192.168.1.175   1 
===========================================================================

五、驗證兩邊連通性

###從linux端ping windows 10
[root@centos7-a ~]# ping 192.168.1.242 -c 2   
ping 192.168.1.242 (192.168.1.242) 56(84) bytes of data.
64 bytes from 192.168.1.242: icmp_seq=1 ttl=63 time=1.70 ms
64 bytes from 192.168.1.242: icmp_seq=2 ttl=63 time=1.10 ms

--- 192.168.1.242 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 1.101/1.404/1.707/0.303 ms

###從windows 10端ping linux
c:\>ping 172.24.8.131 -t

pinging 172.24.8.131 with 32 bytes of data:
reply from 172.24.8.131: bytes=32 time=1ms ttl=63
reply from 172.24.8.131: bytes=32 time=1ms ttl=63

注,如果測試有問題,請考慮是否被防火墻攔住。


到此,關(guān)于“CentOS7下怎么配置虛擬路由器”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

當(dāng)前名稱:CentOS7下怎么配置虛擬路由器-創(chuàng)新互聯(lián)
本文地址:http://www.rwnh.cn/article16/ppodg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、網(wǎng)站營銷、外貿(mào)網(wǎng)站建設(shè)、域名注冊、網(wǎng)站策劃網(wǎng)站排名

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化
工布江达县| 三门峡市| 科尔| 象山县| 全椒县| 年辖:市辖区| 河北区| 广东省| 平阳县| 上栗县| 偏关县| 个旧市| 襄垣县| 横山县| 衡东县| 澎湖县| 弥勒县| 应用必备| 长春市| 巴东县| 潞城市| 庄河市| 浮山县| 芮城县| 秭归县| 沁水县| 太保市| 佛山市| 平邑县| 井冈山市| 海宁市| 思南县| 南江县| 日照市| 宜丰县| 舒兰市| 萝北县| 隆昌县| 广宁县| 平舆县| 樟树市|