发布网友 发布时间:2022-04-23 11:07
共3个回答
热心网友 时间:2022-04-12 21:20
你这个需要用到NAT,独臂路由,
先帮你写独臂路由的:
交换机划分2个VLAN : VLAN 10 ,VLAN 20
路由器:
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#in
Router(config)#interface f0/0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#in
Router(config-if)#exit
Router(config)#in
Router(config)#interface f0/0.10
%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to upRouter(config-subif)#enc
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 192.168.1.254 255.255.255.0
Router(config-subif)#exit
Router(config)#in
Router(config)#interface f0/0.20
%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to upRouter(config-subif)#enc
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 192.168.2.254 255.255.255.0
Router(config-subif)#end
独臂路由就这么配完了
下面我们配NAT地址转换:
Router(config)#interface s0/0/0
Router(config-if)#ip address 219.219.223.133 netmask 255.255.255.252
Router(config-if)#ip nat outside
Router(config)#interface f0/0
Router(config-if)#ip nat inside
Router(config)#access-list 1 permit 192.168.1.0 0.0.0.255
Router(config)#access-list 1 permit 192.168.2.0 0.0.0.255//配置ACL 控制访问列表
Router(config)#ip nat pool globalnet 219.219.223.133 219.219.223.133 netmask 255.255.255.252
Router(config)#ip nat inside source list 1 pool globalnet overload
Router(config)#end
这样应该就可以了,不知道上面命令有没有打错,有问题还是希望提出一起解决,虽然楼主分给的有点低,但是我还是 希望能够帮到你
如果需要配置DHCP和DNS的 我也可以帮你
热心网友 时间:2022-04-12 22:38
比较繁琐!2个网络共存上网!共存享用服务器!需要一项设置!
热心网友 时间:2022-04-13 00:13
还需要外部网关地址啊·