You are not logged in.

#1 2016-02-29 21:13:05

Guybrush1973
Member
Registered: 2015-06-01
Posts: 11

Hardcore LAN setting

So, this will be my LAN, if I will be able to setting it up:

ISP  ---DSL--->   ROUTER   ---WIFI--->   DONGLE   ---USB--->   PC   ---ETHERNET--->   ROUTER   ---WIFI--->   PC   ---ETHERNET--->   PC

and this is my data:
1) internet gateway is 192.168.1.1 (main router, the one on the left)
2) the PC connected to main router has static IP: 192.168.1.40
3) secondary router has static IP: 192.168.1.45

What I can easily get is the first 3 step (from ISP to first PC). Now, how can I share internet from dongle wifi to router??
My router is a Linksys Cisco, and it provide bridge functionality on first ethernet, but I don't know the exact setting as IP and gateway.
I don't know neither how can I set up central PC (witch one with dongle and router connected). I tried "Shared to other computer" with no luck.

Some IT expert can maybe help me??

Thanks in advance


P.S.: any PC could switch from debian to arch and reverse, if needed

Offline

#2 2016-02-29 21:25:00

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,785

Re: Hardcore LAN setting

Guybrush1973 wrote:

3) secondary router has static IP: 192.168.1.45

You will want that to be on a different subnet.  Maybe 192.168.2.xx.
You will need to enable NAT forwarding on that PC.
How are you planning on managing IP addresses on the second LAN segment?  It might be best to run a DHCP server on the second PC to manage the 192.168.2.xx subnet

Same thing goes for that third link between the middle and last PC,  That is yet another subnet, 

You may want to study this


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2016-02-29 21:55:03

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Hardcore LAN setting

You need to understand routing and subnetting as ewaller has pointed you to. Have a read over this and this may assist.

Offline

#4 2016-03-01 21:17:58

Guybrush1973
Member
Registered: 2015-06-01
Posts: 11

Re: Hardcore LAN setting

Ok, I have basic NET knowledge, so I think I can do it ;-)

What I understand today:
Basically each segment need different subnet, so what i get is this

USB DOGLE <-- (192.168.1.40) PC (192.168.2.1) --> (192.168.2.10) ROUTER (192.168.3.1) --> multiple machines managed by DHCP router (192.168.3.100~192.168.3.199)

And I think main PC is almost configured, but I have some trouble yet!
I need router provide NAT forwarding from 192.168.3.* to 192.168.2.1. How can I archive this? I have a Cisco WAG160Nv2 Linksys router. I basically can chose from this options in WAN section: bridged mode only, rfc 2684 routed, rfc 2684 bridged and canonical IPoA, PPPoA and PPPoE. A good news could be in Ethernet section: use 1st ethernet port as WAN. Could it be useful? I don't know. I set static ip (192.168.2.10/24) and getaway (192.168.2.1) router side, and add ip address using

ip addr add 192.168.2.1/24 dev eth0

but I can't ping 192.168.2.10 from PC (connected to 1st eth port). Why???

Offline

#5 2016-03-01 22:18:51

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Hardcore LAN setting

I can't make sense of any of that mess. One question at a time; what is your first problem? Let's resolve that then we can move on the second.

Offline

#6 2016-03-02 01:07:19

Guybrush1973
Member
Registered: 2015-06-01
Posts: 11

Re: Hardcore LAN setting

Well, next step will be some kind of wi-fi connection with static IP from my smartphone to router, cabled via ethernet to PC dongled to wi-fi connected to ISP.
Already working parts: ISP to dongle to PC ; router connected to smartphone in wi-fi.
What I need: connecting 2 LAN (192.168.1.x <--> 192.168.3.x, jumping from 1.x to 2.x to 3.x if I understood IP)

Could it be more clear?

Offline

#7 2016-03-02 01:17:18

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Hardcore LAN setting

A picture would help.

The PC has internet access, and is routing between the USB dongle interface and the ethernet interface that connects to Router1?
1. Can you ping 192.168.2.10 and 192.168.3.1 from the PC? I suspect you're probably missing a route there.
2. Are the "multiple machines" getting a DHCP lease in the 192.168.3./24 subnet?
3. Can those machines ping 192.138.3.1 and 192.168.2.1? Post the output of `ping -c3 192.168.3.1` and `ping -c3 192.168.2.10` and `ping -c3 192.168.2.1` from one of those machines.

Offline

#8 2016-03-02 14:24:43

Guybrush1973
Member
Registered: 2015-06-01
Posts: 11

Re: Hardcore LAN setting

Ok, let me assign some arbitrary name, in order:
- connected dongle: A
- main PC (between dongle and router): B
- router: C
- wifi router clients: Dx (D1, D2, ..., Dn)
----
- lan 192.168.1.x: LAN alfa
- lan 192.168.2.x: LAN beta
- lan 192.168.3.x: LAN gamma

Today update:
Fixing 1st router ethernet port as WAN port (static ip in lan beta), I can ping 192.168.1.40 from lan gamma (192.168.3.5 a smartphone wifi connected to router), but I can still ping 192.168.1.1
I think this could be a step forward in right direction. Next step: I provide NAT forwarding in PC B? What I'm doing is iptables with this simple conf file:

*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o wlan1 -j MASQUERADE
COMMIT

wlan1 is dongle A, so I think it's correct. Iptables service starts without issues, but no luck...

Offline

#9 2016-03-02 14:36:07

Guybrush1973
Member
Registered: 2015-06-01
Posts: 11

Re: Hardcore LAN setting

fukawi2 wrote:

A picture would help.

The PC has internet access, and is routing between the USB dongle interface and the ethernet interface that connects to Router1?
1. Can you ping 192.168.2.10 and 192.168.3.1 from the PC? I suspect you're probably missing a route there.
2. Are the "multiple machines" getting a DHCP lease in the 192.168.3./24 subnet?
3. Can those machines ping 192.138.3.1 and 192.168.2.1? Post the output of `ping -c3 192.168.3.1` and `ping -c3 192.168.2.10` and `ping -c3 192.168.2.1` from one of those machines.

By now:
1. This is a little bit complex. If PC B is connected to 1st router eth, I can't ping nothing, but nmap says router is there and it's up. With router port 2~5 is lan gamma, so I can ping all connected devices in lan, and nmap as well.
2. No DHCP now. My main task is to understand routing protocols and how implement it in real devices. So let's start with fixed IP, when all goes well I can easily switch to some automated mechanisms.
3. As said in last post, from lan gamma (192.168.3.0/24) I can now rich almost all local network's machines (lan beta, lan gamma and 192.168.1.40):

From 192.168.3.5 (smartphone):
ping -c 3 192.168.1.40
PING 192.168.1.40 (192.168.1.40) 56(84) bytes of data.
64 bytes from 192.168.1.40: icmp_seq=1 ttl=63 time=30.8ms
64 bytes from 192.168.1.40: icmp_seq=2 ttl=63 time=2.62ms
64 bytes from 192.168.1.40: icmp_seq=3 ttl=63 time=12.4ms

--- 192.168.1.40 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev =  2.624/15.319/30.854/11.699 ms

Offline

#10 2016-03-02 15:19:53

Guybrush1973
Member
Registered: 2015-06-01
Posts: 11

Re: Hardcore LAN setting

I'm trying this
This is output:

iptables -L
Chain INPUT (policy ACCEPT)
target          prot  opt  source              destination

Chain FORWARD (policy ACCEPT)
target          prot  opt  source              destination
ACCEPT          all   --   anywhere            anywhere                ctstate RELATED,ESTABLISHED
ACCEPT          all   --   anywhere            anywhere

Chain OUTPUT (policy ACCEPT)
target          prot  opt  source              destination

No luck...

Last edited by Guybrush1973 (2016-03-02 15:22:16)

Offline

#11 2016-03-02 21:49:31

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Hardcore LAN setting

Please don't keep replying to your own posts -- there is an 'Edit' button for a reason.

Guybrush1973 wrote:

2. No DHCP now. My main task is to understand routing protocols and how implement it in real devices. So let's start with fixed IP, when all goes well I can easily switch to some automated mechanisms.

Guybrush1973 wrote:

USB DOGLE <-- (192.168.1.40) PC (192.168.2.1) --> (192.168.2.10) ROUTER (192.168.3.1) --> multiple machines managed by DHCP router (192.168.3.100~192.168.3.199)

You said you were using DHCP, so I assumed DHCP was set up. What else have you said that is inaccurate?

Guybrush1973 wrote:

1. This is a little bit complex. If PC B is connected to 1st router eth, I can't ping nothing, but nmap says router is there and it's up. With router port 2~5 is lan gamma, so I can ping all connected devices in lan, and nmap as well.
...
3. As said in last post, from lan gamma (192.168.3.0/24) I can now rich almost all local network's machines (lan beta, lan gamma and 192.168.1.40):

1 and 3 contradict each other. You say you can ping from 192.168.3.0/24 to 192.168.1.40, but then you say is the PC is connected then you can't ping anything. From what you've said, the PC is the only way 192.168.1.0/24 and 192.168.3.0/24 are connected, so how can you ping without that PC connected?

EDIT: Don't "name" your networks ("alpha" etc). That just makes it more complicated to try and understand what you've done. This is a networking issue and networking involves subnets.

Offline

Board footer

Powered by FluxBB