实验范图

实现PC机之间互通


1)配置PC的IP地址和网关
2) 配置SW1/5/6的vlan为10/20/30,交换机之间的链路为Trunk,与PC间为Access
3)配置SW2/3/7的vlan为40/50,交换机之间的链路为Trunk,与PC间为Access
4) 配置SW4/8/9的vlan为60/70/80,交换机之间的链路为Trunk,与PC间为Access
5)配置R1/R2/R3的接口IP地址
6)配置每个 VLAN 的网关接口IP地址
interface vlanif 10
ip address 192.168.10.254 24
quit
interface vlanif 20
ip address 192.168.20.254 24
quit
interface vlanif 30
ip address 192.168.30.254 24
quit
interface vlanif 40
ip address 192.168.40.254 24
quit
interface vlanif 50
ip address 192.168.50.254 24
quit
interface gi0/0/0.60
dot1q termination vid 60
arp broadcast enable
ip address 1921.68.60.254 24
quit
interface gi0/0/0.70
dot1q termination vid 70
arp broadcast enable
ip address 1921.68.70.254 24
quit
interface gi0/0/0.80
dot1q termination vid 80
arp broadcast enable
ip address 1921.68.80.254 24
quit
7)在SW1与R1之间添加 vlan 100,实现两者互通
vlan 100
quit
interface gi0/0/1
port link-type access
port default vlan 100
quit
interface vlanif 100
ip address 192.168.100.100 24
quit
ip route-static 0.0.0.0 0 192.168.100.1
interface gi0/0/0
ip address 192.168.100.1 24
quit
ip route-static 192.168.10.0 24 192.168.100.100
ip route-static 192.168.20.0 24 192.168.100.100
ip route-static 192.168.30.0 24 192.168.100.100
ip route-static 192.168.40.0 24 192.168.12.2
ip route-static 192.168.50.0 24 192.168.12.2
ip route-static 192.168.60.0 24 192.168.12.2
ip route-static 192.168.70.0 24 192.168.12.2
ip route-static 192.168.80.0 24 192.168.12.2
8)在SW2与R2之间添加 vlan 400,实现两者互通
vlan 400
quit
interface gi0/0/1
port link-type access
port default vlan 400
quit
interface vlanif 400
ip address 192.168.200.3 24
quit
ip route-static 0.0.0.0 0 192.168.200.2
interface gi0/0/0
ip address 192.168.200.2 24
quit
ip route-static 192.168.40.0 24 192.168.200.3
9)在SW3与R2之间添加 vlan 500,实现两者互通
vlan 500
quit
interface gi0/0/1
port link-type access
port default vlan 500
quit
interface vlanif 500
ip address 192.168.255.3 24
quit
ip route-static 0.0.0.0 0 192.168.255.2
interface gi4/0/0
ip address 192.168.255.2 24
quit
ip route-static 192.168.50.0 24 192.168.255.3
ip route-static 192.168.10.0 24 192.168.12.1
ip route-static 192.168.20.0 24 192.168.12.1
ip route-static 192.168.30.0 24 192.168.12.1
ip route-static 192.168.60.0 24 192.168.23.3
ip route-static 192.168.70.0 24 192.168.23.3
ip route-static 192.168.80.0 24 192.168.23.3
10)在R3上配置路由条目信息,实现与其他PC所在的网段的互通
ip route-static 192.168.10.0 24 192.168.23.2
ip route-static 192.168.20.0 24 192.168.23.2
ip route-static 192.168.30.0 24 192.168.23.2
ip route-static 192.168.40.0 24 192.168.23.2
ip route-static 192.168.50.0 24 192.168.23.2
ip route-static 192.168.60.0 24 192.168.23.2
11)测试不同网段的PC之间的连通性

经测试PC机全部互通
参考命令

Rails2.3可以选择随时使用RouteSet#add_configuration_file添加更多路由。是否可以在Rails3项目中做同样的事情? 最佳答案 在config/application.rb中:config.paths.config.routes在Rails3.2(也可能是Rails3.1)中,使用:config.paths["config/routes"] 关于ruby-on-rails-Rails3中的多个路由文件,我们在StackOverflow上找到一个类似的问题
我没有找到太多关于如何执行此操作的信息,尽管有很多关于如何使用像这样的redirect_to将参数传递给重定向的建议:action=>'something',:controller=>'something'在我的应用程序中,我在路由文件中有以下内容match'profile'=>'User#show'我的表演Action是这样的defshow@user=User.find(params[:user])@title=@user.first_nameend重定向发生在同一个用户Controller中,就像这样defregister@title="Registration"@user=Use
我真的为这个而疯狂。我一直在搜索答案并尝试我找到的所有内容,包括相关问题和stackoverflow上的答案,但仍然无法正常工作。我正在使用嵌套资源,但无法使表单正常工作。我总是遇到错误,例如没有路线匹配[PUT]"/galleries/1/photos"表格在这里:/galleries/1/photos/1/edit路线.rbresources:galleriesdoresources:photosendresources:galleriesresources:photos照片Controller.rbdefnew@gallery=Gallery.find(params[:galle
1.在Python3中,下列关于数学运算结果正确的是:(B)a=10b=3print(a//b)print(a%b)print(a/b)A.3,3,3.3333...B.3,1,3.3333...C.3.3333...,3.3333...,3D.3.3333...,1,3.3333...解析: 在Python中,//表示地板除(向下取整),%表示取余,/表示除(Python2向下取整返回3)2.如下程序Python2会打印多少个数:(D)k=1000whilek>1: print(k)k=k/2A.1000 B.10C.11D.9解析: 按照题意每次循环K/2,直到K值小于等
Rails中有没有一种方法可以提取与路由关联的HTTP动词?例如,给定这样的路线:将“users”匹配到:“users#show”,通过:[:get,:post]我能实现这样的目标吗?users_path.respond_to?(:get)(显然#respond_to不是正确的方法)我最接近的是通过执行以下操作,但它似乎并不令人满意。Rails.application.routes.routes.named_routes["users"].constraints[:request_method]#=>/^GET$/对于上下文,我有一个设置cookie然后执行redirect_to:ba
路由有如下代码:resources:orders,only:[:create],defaults:{format:'json'}resources:users,only:[:create,:update],defaults:{format:'json'}resources:delivery_types,only:[:index],defaults:{format:'json'}resources:time_corrections,only:[:index],defaults:{format:'json'}是否可以使用1个字符串为所有资源设置默认格式,每行不带“默认值”散列?谢谢。
我正在使用rails3和cucumber,除了这个小问题,一切都很顺利GivenIamonthe"editautomobile"pageNoroutematches{:controller=>"automobiles",:action=>"edit"}(ActionController::RoutingError)现在路径在paths.rb中设置为edit_automobile_path在routes.rb中我有汽车作为资源,我搭建了它所以请告诉我我遗漏了什么,清楚地定义了路线并且匹配,因为我运行了rake路线并看到了路线。请指出正确的方向 最佳答案
有什么方法可以为url/path助手提供默认值吗?我有一个可选范围环绕我的所有路线:#config/routes.rbFoo::Application.routes.drawdoscope"(:current_brand)",:constraints=>{:current_brand=>/(foo)|(bar)/}do#...allotherroutesgohereendend我希望用户能够使用这些URL访问网站:/foo/some-place/bar/some-place/some-place为了方便起见,我在我的ApplicationController中设置了一个@current
我如何将像“root_path”这样的Rails路由助手作为类方法添加到像my_model.rb这样的类中?所以我的课是这样的:ClassMyModeldefself.fooreturnself.root_pathendendMyModel.foo以上不起作用,因为ClassMyModel不响应root_path这是我所知道的:我可以使用includeRails.application.routes.url_helpers,但这只会将模块的方法添加为实例方法我试过扩展Rails.application.routes.url_helpers但它没用请随时给我上课:)
尝试从我的AngularJS端将数据发布到Rails服务器时出现问题。服务器错误:ActionController::RoutingError(Noroutematches[OPTIONS]"/users"):actionpack(4.1.9)lib/action_dispatch/middleware/debug_exceptions.rb:21:in`call'actionpack(4.1.9)lib/action_dispatch/middleware/show_exceptions.rb:30:in`call'railties(4.1.9)lib/rails/rack/logg