为 FastEthernet 分配 IP 地址

网络工程 思科 路由器 ip 纳特 IP地址
2021-08-03 11:05:11

我刚刚使用出厂设置启动了 Cisco 路由器 886VA。我愿意将端口分配FastEthernet 0给 IP 地址。这个端口连接到我的笔记本电脑,它充当路由器和 Cisco 机器之间的 NAT。所有 FastEthernet 端口都分配给VLAN1(默认情况下),当我尝试分配 IP 地址时,出现错误:

% IP addresses may not be configured on L2 links.

为什么会这样?


更新:

好吧,它仍然无法正常工作。

再次:我的设置如下:FastEthernet3连接到另一个家庭路由器,我应该为每个正在工作的 DHCP 检索 IP 地址 ( 192.168.1.8)。我将此端口分配给VLAN3,这应该是 NAT ousside,因为我想从 NATVLAN3VLAN1。现在,我192.168.100.1为另外 3 个端口的 3 个设置了一个 DHCP 池FastEthernet 0-2它们被分配给 VLAN1,即内部的 NAT。

我没有连接到我的计算机上FastEthernet 1(但仍然有池中的地址)。我该怎么办?

调试信息:NAT 转换失败!!!

总而言之,我正在尝试在VLAN1(内部)到VLAN3(外部)之间启用 NAT

为什么无法连接或根本无法 ping 家庭路由器???

将不胜感激任何帮助!

这是我的配置:

Building configuration...

Current configuration : 1689 bytes
!
! Last configuration change at 23:24:01 UTC Thu Jan 5 2017
version 15.3
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname x
!
boot-start-marker
boot-end-marker
!
!
enable secret 5 $1$34LK$ekdCKQuEmravI.qziPae7.
enable password xxxxxx!
!
no aaa new-model
memory-size iomem 10
!
!
!         
!
!
!


!
ip dhcp excluded-address 192.168.100.210 192.168.100.253
ip dhcp excluded-address 192.168.100.1 192.168.100.50
!
ip dhcp pool LAN
 network 192.168.100.0 255.255.255.0
 default-router 192.168.100.1 
 dns-server 8.8.8.8 
!
!
!
ip cef
no ipv6 cef
!
!
multilink bundle-name authenticated
license udi pid xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
!         
!
!
!
!
!
!
controller VDSL 0
!
! 
!
!
!
!
!
!
!
!
interface Ethernet0
 no ip address
 no ip route-cache
 shutdown
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
 isdn termination multidrop
!
interface ATM0
 no ip address
 shutdown
 no atm ilmi-keepalive
!
interface FastEthernet0
 no ip address
!
interface FastEthernet1
 no ip address
!
interface FastEthernet2
 no ip address
!
interface FastEthernet3
 description Extern-Router
 switchport access vlan 3
 no ip address
!
interface Vlan1
 description inside
 ip address 192.168.100.1 255.255.255.0
 no ip redirects
 ip nat inside
 ip virtual-reassembly in
 ip tcp adjust-mss 1412
!
interface Vlan3
 ip address dhcp
 ip nat outside
 ip virtual-reassembly in
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
ip route 0.0.0.0 0.0.0.0 192.168.1.1
!
!
!         
control-plane
!
!
!
line con 0
 no modem enable
line aux 0
line vty 0 4
 password xxxxxxxxxxxxxx
 login
 transport input all
!

它仍然无法正常工作,换句话说sh ip nat translations仍然没有显示任何内容!


更新:

哇它有效 - 非常感谢你!!!

1个回答

您的路由器有一个交换模块。交换模块的接口不是路由器接口,不能像路由器接口那样分配IP地址。

使用交换机接口,您需要分配 VLAN,并且您可以创建 SVI(交换机虚拟接口)来分配 IP 地址。例如:

interface Vlan1
 ip address 10.0.0.1 255.255.255.0
 no shutdown

SVI 将为您的 VLAN 定义网关地址。


编辑您的更新:

您尚未启用 NAT。是的,您在接口上ip nat insideipnat outside命令,但是您没有为感兴趣的流量创建 ACL,也没有在路由器上启用 NAT。那看起来像:

ip nat inside source list 10 interface Vlan3 overload
!
access-list 10 permit 192.168.100.0 0.0.0.255