01-17-2014 12:21 PM - edited 03-07-2019 05:38 PM
Hi,
Got a project at work where we're on site and have a cable that assigns a DHCP IP address to say a laptop. I've been asked if we can share this IP address with anything plugging into the router.
Boviously its nt good practice to route to or NAT private IPs but I need to. Are there any implications or show stopping issues that might happen if I set a default route on the default VLAN (where all clients plug into) that routes all traffic through the LAN port that is assigned the DCHP address (essentially this is the WAN port)
I would guess that the DHCP information assigned would supply a default gateway.
Hope this makes sense,
Any feedback great.
James
Solved! Go to Solution.
01-18-2014 04:00 AM
James
As an example 192.168.5.0/24 is used for your internal clients
router config
=============
int gi0/0 <-- this is the interface connecting to your switch
ip address 192.168.5.1 255.255.255.0
ip nat inside
int gi0/1 <-- this connects to your cable modem
ip address x.x.x.x y.y.y.y
ip nat outside
access-list 101 permit ip 192.168.5.0 0.0.0.255
ip nat inside source list 101 interface gi0/1 overload
ip route 0.0.0.0 0.0.0.0
couple of points -
1) i'm not clear on how the router gets it's gi0/1 IP address. If it is via DHCP then the config for gi0/1 would need to be modified.
In addition if it is DHCP then you may need to modify the default route as well ie. either -
a) if the cable modem sends the route as welll use that although you may need to tell your router to do that
or
b) if there is no route passed back and you do not know the IP of the cable modem the default route could point out of the gi0/1 interface rather than to an IP address. This is less efficient but it would work.
2) all your 192.168.5.x addresses are translated to the gi0/1 IP address. This is so you do not need to add a route to the cable modem for the 192.168.5.0/24 network.
Any problems, further queries, please come back
Jon
01-17-2014 12:35 PM
James
Sorry, but for me at least, i am not understanding your setup.
What do you mean by "a cable" for example ?
Can you perhaps explain all the devices and how they connect up and what you want to happen to traffic and where that traffic is coming from and going to ?
Like i say, it could just be me, so please don't take it personally
Jon
01-17-2014 12:42 PM
Sorry Jon, perhaps a bit vague there
OK by cable I mean, if you can picture your home broadband, plugging the cable into your internal router where by you have an Ethernet connection and say for example your laptop is assigned an internal IP address along with a subnet mask, gateway and some DNS servers.
I need to share this connection by using an interface on my router as the WAN. If the interface (lets call it interface 0/1) is given an IP addess 192.168.1.50\24 and workstations pluggin into the same router come from a different IP range(that is assigned to the LAN interface on my router) Can I router between interfaces without any issues???
Hope this makes sense...
01-17-2014 01:25 PM
James
So it looks like this -
clients -> gi0/0 router gi0/1 -> cable modem -> internet
and you want clients sending traffic to gi0/0 to be able to go out through the router ?
Can you just confirm as i don't want to babble on if i have got it wrong (sorry, it's been a long day )
So if the above is right your clients will connect to a switch which connects to gi0/0 and your cable modem device does NAT for the internal clients to a public IP ?
Jon
01-18-2014 01:22 AM
Thats pretyy much it, just missed one thing.
You said:
So if the above is right your clients will connect to a switch which connects to gi0/0 and your cable modem device does NAT for the internal clients to a public IP ?
The only thing different in my situaltion that that the Device is doing NAT to a private IP address not a public address, before passing traffic on to the cable modem.
HTH
James
01-18-2014 01:32 AM
Missed a bit: Interface Gi0/1 is getting a private IP address from the cable modem...
01-18-2014 04:00 AM
James
As an example 192.168.5.0/24 is used for your internal clients
router config
=============
int gi0/0 <-- this is the interface connecting to your switch
ip address 192.168.5.1 255.255.255.0
ip nat inside
int gi0/1 <-- this connects to your cable modem
ip address x.x.x.x y.y.y.y
ip nat outside
access-list 101 permit ip 192.168.5.0 0.0.0.255
ip nat inside source list 101 interface gi0/1 overload
ip route 0.0.0.0 0.0.0.0
couple of points -
1) i'm not clear on how the router gets it's gi0/1 IP address. If it is via DHCP then the config for gi0/1 would need to be modified.
In addition if it is DHCP then you may need to modify the default route as well ie. either -
a) if the cable modem sends the route as welll use that although you may need to tell your router to do that
or
b) if there is no route passed back and you do not know the IP of the cable modem the default route could point out of the gi0/1 interface rather than to an IP address. This is less efficient but it would work.
2) all your 192.168.5.x addresses are translated to the gi0/1 IP address. This is so you do not need to add a route to the cable modem for the 192.168.5.0/24 network.
Any problems, further queries, please come back
Jon
01-18-2014 05:09 AM
Thanks for your reply, Jon. This makes sense now. I don't and wont know the IP address the Cable modem will be assigning so will go with the default route through the interface.
I've got a lab so will test things out - thanks for your help
James
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