网络(路由和交换),安全

网络工程 路由 纳特 交换 网络核心 网络访问
2021-07-25 14:31:20

在我的公司网络中,我正在安装新的 cisco2811 路由器,但出现问题,我的 LAN 网络无法 ping 和访问网络。我从ISP获得点对点互联网。

PTP IP192.186.86.200/24和它的交换机端口是图中所示的 15。

LAN 网络 IP 172.16.16.200/24DHCP。

我已经在路由器中配置了虚拟接口。

还实施了 NAT 规则,但我现在不知道如何访问互联网。

我的互联网 IP 是192.186.86.200/24.

我想我需要配置一个 NAT 规则,但不知道是哪种类型。

这是路由器配置:

Router#show running-config
Building configuration...


Current configuration : 3700 bytes
!
! Last configuration change at 18:10:56 UTC Thu Sep 20 2018
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
enable password Ylinx
!
no aaa new-model
!
!
dot11 syslog
ip source-route
!
!
ip cef
!
ip dhcp excluded-address 172.16.16.200
ip dhcp excluded-address 10.2.60.55
!
ip dhcp pool YLINX_LAN
 network 172.16.16.0 255.255.255.0
 dns-server 8.8.8.8
 default-router 172.16.16.200
 lease 10
 update arp
!
ip dhcp pool YLINX_SERVERS
 network 10.2.60.0 255.255.255.0
 dns-server 8.8.8.8
 default-router 10.2.60.200
 lease 10
 update arp
!
!
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
voice-card 0
!
crypto pki token default removal timeout 0
!
crypto pki trustpoint TP-self-signed-2879905090
 enrollment selfsigned
 subject-name cn=IOS-Self-Signed-Certificate-2879905090
 revocation-check none
 rsakeypair TP-self-signed-2879905090
!
!

    quit
!
!
license udi pid CISCO2811 sn FHK0902F4V6
username naseer secret 5 $1$w6HC$W9eoccnVIhNDKbMr91f2e0
!
redundancy
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.400
 encapsulation dot1Q 400
 ip address 192.168.86.200 255.255.255.0
 ip nat outside
 ip virtual-reassembly in
!
interface FastEthernet0/0.401
 encapsulation dot1Q 401
 ip address 192.168.1.200 255.255.255.0
!
interface FastEthernet0/0.402
 encapsulation dot1Q 402
 ip address 172.16.16.200 255.255.255.0
!
interface FastEthernet0/0.403
 encapsulation dot1Q 403
 ip address 10.2.60.200 255.255.255.0
!
interface FastEthernet0/1
 ip address 1.1.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface BRI0/1/0
 no ip address
 encapsulation hdlc
 shutdown
!
ip forward-protocol nd
ip http server
no ip http secure-server
!
!
ip nat outside source static 192.168.86.200 172.16.16.200
ip route 0.0.0.0 0.0.0.0 192.168.86.1 10
ip route 0.0.0.0 0.0.0.0 192.168.1.1 50
!
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp profile default
!
!
!
!
!
!
line con 0
 password Ylinx
 login
line aux 0
line vty 0 4
 password Ylinx
 login
 transport input all
line vty 5 15
 password Ylinx
 login
 transport input all
!
scheduler allocate 20000 1000
end

交换机接口配置:

interface GigabitEthernet1/0/15 
 description YLINX_PTP
 switchport access vlan 400
 switchport trunk encapsulation dot1q
 switchport mode access

interface GigabitEthernet1/0/16
 description YLINX_161_DIRECT
 switchport access vlan 402
 switchport trunk encapsulation dot1q
 switchport mode access

interface GigabitEthernet1/0/18
 description YLINX_CISCO_ROUTER
 switchport trunk encapsulation dot1q 
 switchport mode trunk

interface GigabitEthernet1/0/21 
 description YLINX_SERVERS
 switchport access vlan 403
 switchport trunk encapsulation dot1q
 switchport mode access
2个回答

欢迎来到网络工程!这里有一些错误:

  1. 没有内部 nat 语句。您在 fa 0/0.401 上有外部 NAT 语句。在您的内部 LAN 接口(无论哪个)上,您需要

    ip nat 里面

  2. 如果您只是想让内部主机访问 Internet,请将 NAT 语句更改为:

    源列表中的 ip nat 1 接口 FastEthernet0/0.401 过载

    访问列表 1 0.0.0.0 255.255.255.255

如果您希望外部主机连接到内部主机(如 Web 服务器),您需要不同的 NAT 语句,但您需要提供更多信息,然后我们才能推荐配置。

配置 ISP 分配的公共 ip 地址到路由器出口接口。并进一步配置了用于 Internet 访问(出站流量)的端口地址转换 (PAT)

静态 NAT 一对一用于入站流量

用于 PAT 配置

Router(config) # access-list 10 permit 172.16.16.0 0.0.0.0.255 any

Router(config) # ip nat inside source list 1 interfàce F0/1 overload