You are not logged in.

#1 2012-07-06 22:28:09

fluffvvy
Member
Registered: 2012-07-06
Posts: 3

Internet share and device configuration

I am trying to set up a connection between machine0 and machine1 using this guide - https://wiki.archlinux.org/index.php/Internet_Share.

The guide works, and I get a working internet connection on machine1, which comes from the eth0 of machine0 (which itself comes from the wlan0 of machine0). However, setting the required IP on eth0 of machine0 ("ip addr add 192.168.1.23/24 dev eth0") makes both machine0 (and consequently machine1) unable to see any of the machines/IPs on the network other than themselves. I am testing this by using "nmap -sP 192.168.1.1-254". I have also tried setting the eth0 IP via rc.conf and via ifconfig. I have tried adding the correct broadcast address using "ip addr..." as well. I have also tried all this on another Arch machine and that also has the same issue, with nmap going blind. When machine1 is connected to machine0, using "nmap -sP 192.168.1.1-254" on a third machine in the subnet lets me see machine0, machine1, and everything else (the router, other machines), so they are visible. But the visibility seems to be only one-way, on the outside looking in.

Is there a way of stopping this from happening? Am I misunderstanding something basic here? Is there another way of configuring machine0 eth0? Can I connect to machine0 eth0 with machine1 without needing a static IP address?

Last edited by fluffvvy (2012-07-07 05:11:41)

Offline

#2 2012-07-07 07:48:04

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Internet share and device configuration

What's the general layout of your network (in terms of ip addressing) outside of your Archbox and the box it shares to? Also, what does the route table on the Archbox look like (ip route)?


Burninate!

Offline

#3 2012-07-07 14:58:08

fluffvvy
Member
Registered: 2012-07-06
Posts: 3

Re: Internet share and device configuration

An "nmap -sP 192.168.1.1-254" from the third machine shows these (I cannot copy and paste the nmap as I use machine1, but there are no oddities):

192.168.1.20 = router
192.168.1.23 = machine0 eth0
192.168.1.26 = third machine
192.168.1.29 = machine0 wlan0
4 hosts up, scanned in 4.45 seconds

However, 192.168.1.25, machine1 eth0, is not actually being seen like I thought it was. Sorry about that.

"ip route" from machine0 shows this:

default via 192.168.1.20 dev wlan0  metric 303
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.23
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.29  metric 303

EDIT: To clarify, my network is a wireless N router, 2 desktop machines (machine0 with a wireless PCI ath9k card, and machine1), and a third laptop. machine0 connects to machine1, ethernet to ethernet.

Last edited by fluffvvy (2012-07-07 15:42:39)

Offline

#4 2012-07-07 22:18:20

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,542

Re: Internet share and device configuration

Do you have your iptables working?
I'm thinking that there is a possible issue with the way things are being subnetted.
Eth0 and wlan0 seem to be getting their addresses from the router?
machine0 connects to machine1 via ethernet.  Does this mean ... through a hub or a crossover cable?
If machine1 has a wireless card it won't have a need for machine0.  If you connect machine0 and machine1 via ethernet through your router you also wouldn't need machine0 to do that. 

machine0 has the wireless card connecting to the wireless router.
machine1 is connected to machine0 via ethernet so that machine1 is using machine0 to connect through the wireless connection.
machine0 eth0 would be getting a dhcp address from the router.
machine1 eth0 would be getting a dhcp address from machine0.
To share machine0's internet connection with machine1, iptables would need to be set to allow it to forward machine1 through machine0 to the router.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2012-07-09 04:25:52

fluffvvy
Member
Registered: 2012-07-06
Posts: 3

Re: Internet share and device configuration

Yes, iptables is working in that machine1 does get a working net connection from machine0, as I said. Doing that is part of the internet share guide.

But the issue is really very simple. I have 3 machines running Arch that have eth0 and wlan0. On all of them, when I set a static IP for eth0 and bring eth0 up, whilst connected to my router via wlan0, the rest of the network suddenly becomes invisible to them. This happens the moment eth0 is brought up.

Offline

#6 2012-07-09 20:03:50

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,542

Re: Internet share and device configuration

fluffvvy wrote:

"ip route" from machine0 shows this:

default via 192.168.1.20 dev wlan0  metric 303
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.23
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.29  metric 303

These addresses look like they are coming from the same place, which would confuse which interface to use unless it was subnetted properly. 
If I'm trying to serve an internet connection to machine1 through machine0 I would want a static address on eth0 on machine0, and a dhcp server serving eth0.  I would want it to have a different subnet than the one I'm getting through wlan0.  Even if the 192.168.1.x/24 part is good for 1-25 (whatever) on wlan0, the subnet on eth0 for use between machine0 and machine1, can still be 192.168.1.x/24, but it has to split according to the subnet in use.  With /24, you probably have to change it to 192.168.2.x for the eth0 on machine0 for it to work properly.

Last edited by nomorewindows (2012-07-09 20:16:39)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB