How to setup DD-WRT between two routers with NAT - networking

I have two networks.
Network A has both wired and wireless clients and is connected to the internet. DHCP ENABLED (10.0.0.1 with subnet 255.255.255.0)
Network B has both wired and wireless clients and is NOT connected to internet. DHCP ENABLED (192.168.1.1 with subnet 255.255.255.0) This means the WAN port of this network is not connected.
I need to connect the WAN port of Network 2 WIRELESSLY to Network A such that Network B shows up as nothing but a client in Network A. Since BOTH networks have wireless clients it's to assume that WPA is used for security.
Can anyone tell me how to set this up using DD-WRT.
Thanks

you should connect your network B device to network A device and add a static route to route client on router B reach to internet , and config router B DHCP to get the user the new gateway which is the router A ip address.

Related

Wifi router with DHCP enabled to a network

I have this very cheap all in one machine (modem + wifi router) provided by my service provider. I have disabled the wifi on it and bought a netgear nighthawk. Now i am trying to set it up that some devices are connected to wifi and some are connected using wire to the modem. I am trying to figure out how i can have DHCP enabled on both machine and also have access to machines connected to modem. So my setup is as follow.
Modem has 4 LAN ports and have 3 devices and the the nighthawk wifi router connected to it. The access IP of the modem is 192.168.1.1 and starting IP is 192.168.1.2 with subnet mask 255.255.255.0 and have DHCP enabled to provide IPs to everything connected to it.
The WIFI router access IP is IP 192.168.0.1 has starting IP 192.168.0.2 with subnet mask 255.255.255.0 and DHCP enabled to provide IP to everything connected to it.
I would like devices connected to WIFI router to have access to devices connected to Modem and vice versa.
Can someone help me figure this out.
On your configuration you have 2 NAT one from the ISP and another one from your access point/router (nighthawk). Meaning that you have 2 networks with different IP ranges.
This is how I configure the LAN when I have multiple routers to extend the coverage.
Assign an IP address to the nighthawk on the range of 192.168.1.x/255.255.255.0 ex 192.168.1.2
Disable the DHCP on the nighthawk
Connect your ISP router to a LAN interface on the Nighthawk.
What will happen is that your nighthawk will be just an access point, all the DHCP will be at the ISP router meaning that all ips will be on the same range. If you connect your ISP to the Nighthawk WAN interface it is going to go nowhere because some of them are programmed to do a NAT between the Lan an Wan interfaces.
I also configure the DHCP to assign ip's from 192.168.1.100 to 192.168.1.200 range, all devices from 1 to 99 are routers, access points, servers, cameras, printers or devices that need an static ip address. Then I have segments ex. routers are 1-9, printers 10-29, etc etc. By doing this I will now what device is or their purpose on the network.
Hope it helps.

Wireless not working with different subnet

1.Internet Router ip 192.168.0.1 (LAN) - There are 3 more computers connect to this router (ip 192.168.0.2, 192.168.0.3, 192.168.0.4) .
Wireless Router connected to the internet router with ip 192.168.0.5 . The wireless Router send out DHCP ip range 192.168.1.1-100
Wireless printers connected to wireless router 192.168.1.1 .
All 3 computers can't add the printers !!! why ? thanks
I recommend changing the router mode on the wireless router from NAT mode to access point mode if it is possible. The clients on the wired network cannot access the printer behind the wireless router because of NAT or firewall policies.

Accessing connected devices to a local network wirelessly

Hello Everyone!
I want to know that is there any way to access a photocopier machine which is connected to a computer through Ethernet wire and that computer is connected to my WiFi network?
P.S: What if I don't know the IP assigned to that Photocopier machine?
If the wireless network is part of the wired network you should have any problem reaching the photocopier.
If you don't know the IP address, you can reach it by host name if the DHCP and DNS are working properly. If you are on an Active Directory infrastructure and DHCP and DNS are integrated it should be transparent.
If you are on your home with a "home" router they usually do the hostname to IP resolve (DNS).
You can nslookup hostname in your machine to see if your dns is resolving the ip address. you can also ping hostname or ping ip address to test that you can reach the desired host. Some hosts block ping (ICMP) requests, please note that ping is ping does not respond is not a definitive solution.
Please note that in your home router you should use your router or default gateway to be the DNS also, and then add the google public DNS or your ISP.
Also when connecting the access point to an existing network you may have 2 DHCP servers providing IP addresses to hosts, you should disable DHCP on the Access Point and connect the AP to the network using the switch port and not the WAN port (the WAN port will try to do NAT and assign a different set of IP addresses).

Wrong IP from DHCP server on wifi

I've determined that the DHCP range of my access point is 192.165.. but when I connect with my Ralink wireless card to the Access Point it receives an IP address of 169.254.178.92.
What is going wrong with the connection process?
169.254.*.* is a Local-Link Address. It is a pseudo-random IP address assigned by the OS when it is unable to obtain an IP address via DHCP on the network. This allows for an unconfigured network to still allow communication between devices because each devices picks a random address and then broadcasts to find out what other devices are also on the local network segment.
In short, something is wrong with the DHCP server on your network such that it is not serving addresses to your wireless clients.

How do two computers connect to same external address through NAT?

If I have two internal computers connecting to the same external IP address through a NAT router, how is the router able to get the traffic to the correct internal computer? It is my understanding that NAT forwards incoming packets to the computer that recently sent outgoing packets to the [incoming packet's] sender's IP address. Since both computers are sending to the same address, does the router forward the packet to both? If that is the case, is it the responsibility of the client software to determine which packets are relevant?
Is it possible if both computers are attempting to connect to the same port?
When you open a socket, you need to address a port of the destination system and open a conjugate listening port on your own system to receive any response. You have to send the destination system your listening port.
Having more than one system using the same modem
When you start a web browser, and go to www.google.com:80, your browser obtains/searches for a free non-system conjugate port from the system for listening. Let us say, the conjugate port is 10000. The listener port is for receiving the http stream back from google.
Then your kid sitting next to you incidentally also browses www.google.com:80 and his/her google session of the play station or xbox-whatever also incidentally is assigned conjugate port 10000.
Both of you are sitting behind a cable modem, and behind the cable modem is your wireless router. And both of your systems are behind the wireless router - All sitting in that sequence, network topology-wise.
To prevent port address collision on the router/modem
Let us say that your cable company DHCP assigns your modem ip4 adress 72.72.72.72. But your wireless router DHCP assigns 192.168.0.10 to your system and to 192.168.0.11 to your kid's system.
When the frame carrying the information of your listener ports passes thro your NAT router, it would translate either one or both listening- ports. Let's say port 15000 for your page and port 16000 for your kid's page.
Your wireless router then sends your requests to google server as coming from 72.72.72.72:15000 and 72.72.72.72:16000.
The google server then responds individually to 72.72.72.72:15000 and 72.72.72.72:16000 and when you wireless router encounters the response, it reaches into the mapping that it has stored and translates 72.72.72.72:15000 to 192.168.0.10:10000 to reach your system but translates 72.72.72.72:16000 to 192.168.0.11:10000 to reach your kid's system.
Running web/game/ftp/etc servers
But what if you have a web server or an ftp server running on your system. What if you have two systems and both have a web server and both web servers are listening on port 80?
Let us say the local ip addresses registered/assigned with your wireless router of your first web server system is 192.168.0.30 and your second web server system is 192.168.0.40.
The wireless router would have a configuration web page usually by default 192.168.0.1:80, unless you changed it. There would be a tab to on the page where you could define/reserve application port mappings.
You could register with your wireless router to reserve the mapping
192.168.0.30:80 => outgoing port 8080
192.168.0.40:80 => outgoing port 8088
So that you have to phone your friends your web/game servers are addressable through
72.72.72.72:8080 and 72.72.72.72:8088 respectively,
where the wireless router would preclude its port 8080 and 8088 from its own dynamic NAT usage.
Of course, 72.72.72.72 is as good as only before your ISP DHCP decide to renew the ip4 address of your modem to say, 72.72.90.200. After which you would have to phone/email your friends and say
Hey, the servers' addresses have changed to 72.72.90.200:8080 and 72.72.90.200:8088 respectively. Or you could subscribe to dynamic dns (ddns) service to use a named domain where the ddns service will need you to install a simple heartbeat utility on your system to help them monitor the address variation. DDNS translation is a separate issue/strategy.
NAT modems
Newer ISP contracts supply you with a modem that has NAT. If so, you have to switch off either the one on your modem or the one on your wireless router. You should not use both - what's the point in translating twice because NAT is simply to prevent address collision. When you switch off NAT from your wireless router, it can operate as a hub switch and not a router anymore so that you could connect it to the modem using one of its LAN socket instead of thro its WAN socket.
The router manages "source" ports that are separate for each computer. While you may be connecting to port 80 on the "destination" the router may assign the source port to some high number port.
Wikipedia sums it up as
Network address translation involves
re-writing the source and/or
destination IP addresses and usually
also the TCP/UDP port numbers of IP
packets as they pass through the NAT.
Checksums (both IP and TCP/UDP) must
also be rewritten to take account of
the changes.
Already good answers are provided, but here is another example:
HOST A addr HOST B addr
10.1.0.2:4040 10.1.0.3:4040
-----------------------------------------
NAT 200.50.50.28:4040 200.50.50.28:4041 (what external host sees)
200.50.50.28 is router's global (internet) IP.
Every port number is unique in the NAT table. And of course the router does all the dirty job of modifying the source and destination addresses transparently.
It uses different ports for incoming external traffic, and the NAT then routes the packets on one port to one internal IP address, and the packets from the other port to the other internal IP address... The iniital request from each internal computer, when it goes through the NAT on the way out, establishes which port will be used for the incoming traffic from the external ip address, and it tells the external server what port to send it's traffic back on for that connection.
RFC3022 provides a lot of information on how this works
Since public facing or external IP Address that was given by Internet Service Provider (ISP) has been discussed, I would like to add on this.
You can ask your ISP to have your public IP Address not change. It will become static, so that you do not have to inform your friends to change the IP Address if they want to access your server inside your Network Address Translator (NAT).
As of this writing, static IP Address cost around 100 bucks. Most of the ISP they call it business account.
You can determine your public facing IP Address by googling "what is my ip address".

Resources