12-07-2013 02:46 AM - edited 03-07-2019 04:58 PM
router just has fa0.
can i use subinterfaces to setup nat on the router and provide internet to clients ?
12-07-2013 03:33 AM
Yes, you can do NAT on subinterfaces or you could do NAT on a stick. If you make a topology and provide some informaiton we can help you find the best solution.
Daniel Dib
CCIE #37149
12-07-2013 03:40 AM
I have a cisco 1700 router with just fa0.
internet cable modem will provide public ip via dhcp to the router.
internal network will be 192.168.1.0/24
default gw for clients will be 192.168.1.1
the switch is a linksys home wireless so it doesnt do vlans
modem -------------- switch ------------router
|
clients
can someone give a config for this ? I've tried but not getting thru:
Router(config)#int fa0
Router(config-if)#no ip add
Router(config-if)#int fa0.1
Router(config-subif)#encapsulation dot1Q 1
Router(config-subif)#ip add dhcp
Router(config-subif)#int fa0.2
Router(config-subif)#ip add 192.168.1.1 255.255.255.0
% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.
Router(config-subif)#encapsulation dot1Q 1
%Configuration of multiple subinterfaces of the same main
interface with the same VID (1) is not permitted.
This VID is already configured on FastEthernet0.1.
12-07-2013 11:18 PM
You need to put another VLAN on fa0.2:
int fa0.2
encapsulation dot1q 2
But your switch does not support VLANs so it doesn't matter.
You could try a solution called NAT on a stick but it requires to configure a secondary IP on your interface. We can't match DHCP and static addresses. Can you use a static IP on your router?
Daniel Dib
CCIE #37149
12-08-2013 03:12 AM
when u say the switch does not support VLANs so it doesn't matter, do u mean it will work ?
12-08-2013 07:29 AM
It means that solution won't work. What you need is to put multiple subnets in the same broadcast domain. It's not best practice but for a home network it should be fine.
However you can't mix DHCP and static on the same interface. So if you can put a static IP on the router that would be better. It should be part of the same subnet as the modem.
Daniel Dib
CCIE #37149
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide