# cannot connect

## tony11235

I'm in China at the moment at a university. My roomate signed up for internet service in our room. They assigned an IP for his computer on the network. I really do not want to pay. So I decided to see if I could get by.  I took a look at his ethernet config, (he's using windows), with ip 192.168.3.155, netmask 255.255.255.0, gateway 192.168.3.1.  So I set my /etc/conf.d/net to match, and I faked my mac address to be his.  I've been playing around with this for a few days and I still have not been able to connect. What other information could the administrator have received from his machine? How can I get around this?

----------

## NeddySeagoon

tony11235,

A username and password probably.

----------

## tony11235

My roommate said they didn't even ask him for any information, password or user name.  Unless they just gave him one without his acknowledgement. I guess I'm screwed.  What really sucks is that there's no wireless networks around.

----------

## NeddySeagoon

tony11235,

If your roomate has two network interfaces, set up sharing.

----------

## tony11235

Stupid question, but are there any special settings that I might have to set my card to in order to connect to the ad-hoc shard network( which is the shared connection )?  I know you can manually specify ad-hoc in /etc/conf.d/net, and the essid, but is it necessary?

----------

## NeddySeagoon

tony11235,

You will need to specify the ESSID "any" and the mode as "ad-hoc" See Wireless Networking in the Gentoo handbook

----------

## tony11235

I can connect to the 'shared connection', but not ping anything.  Oh well. If I said anymore it would be off topic. Guess it's my rommate's windows problem.  At least I know what can be done.

----------

## NeddySeagoon

tony11235,

Whats in your /etc/resolv.conf ?

What does your 

```
route -n
```

 show ?

For completeness, post your /etc/conf.d/net file too

----------

## tony11235

Everything looks how it should. It's just not working for me.

 *Quote:*   

> 
> 
> # Wireless Network
> 
> #modules=( "wpa_supplicant" )
> ...

 

 *Quote:*   

> 
> 
> Kernel IP routing table
> 
> Destination      Gateway         Genmask         Flags  Metric Ref    Use Iface
> ...

 

 *Quote:*   

> 
> 
> # Generated by dhcpcd for interface eth1
> 
> search mshome.net
> ...

 

----------

## NeddySeagoon

tony11235,

Close but no cigar.

```
0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 eth0

0.0.0.0 192.168.0.1 0.0.0.0 UG 2000 0 0 eth1 
```

You have two default routes, thats a no no. Only the first one, over eth0 will ever be used, which if you are using wireless, is exactly wrong, since your wireless is eth1.

Remove the 

```
routes_eth0=( "default via 192.168.3.1" )
```

statement from your net file and restart eth0.

You appear to have the wireless running - dhcp has populated /etc/resolv.conf and found you a setting for eth1.

----------

## tony11235

Now my route -n looks like:

 *Quote:*   

> 
> 
> Kernel IP routing table
> 
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> ...

 

But I still can't succesfully get a ping reponse from google or browse.  Could there be anything on their network that could prevent this? even though i'm connecting with a shared connection?

----------

## NeddySeagoon

tony11235,

Lets try a traceroute. First from Windows.  On your roommates windows box, do Run|command.com to get a 'DOS Box' thats not unlike a Linux shell.

In the 'DOS box' run 

```
tracert google.com
```

or any internet IP. As long as ICMP packets (pings) are not dropped, you will get a list of IP addesses. You will see * * * if there is no response.

Now run 

```
netstat -r
```

on Windows to discover the IP addresses of the interfaces on the Windows box. Note them both. If its operating in bridged mode, there will only be one.

If you have traceroute on Gentoo, you can run that and see where it goes wrong but using ping manually may be better.

Your route to the internet is your own IP, the IPs (maybe only one) on the windows box, then the list of IPs you got from the Windows tracert.

First, a sanity check. Is your Linux IP address isn the same range as the Windows wireless IP ?

If not - thats a showstopper. It should be, your posts appear to claim that DHCP works.

Ping each IP in turn, starting with your own - this shows the ping at least runs.

Next ping the 'next hop' thats the Windows wireless IP

Now the next one, the Windows wired IP ...

Keep going until you get a response different to the Windows box - thats where it breaks.

Is there a firewall getting in the way ?

----------

## tony11235

Right now I can only comment on a few things, given I'm not in my room.  The window's wireless ip is 192.168.0.1, while the ip my linux box is getting is 192.168.0.* where * is determined from dhcp.  And yes of course I can ping the win wireless ip.

----------

## NeddySeagoon

tony11235,

Rule one - assume nothing.

I suspected you could ping the remote Wireless IP but I've never heard of Windows running DHCP before.

Are you sure you are connecting to what you think your are with the Wireless ?

Windows systems usually assign themselves an IP in the 172.x.x.x private network then tell other boxes about it.

Windows expects other boxes to do the same too, so I'm surprised you have dhcp from a Windows system.

----------

## tony11235

Ok I am unable to tracert google.com nor ping google.com (get a succesfful response back that is) from the windows machine, yet I can browse pages. And on the linux machine, traceroute google.com only goes as far as to 1 windowshostname 192.168.0.1 .  However I can ping the wired connection's ip, 192.168.3.155.  

This probably has nothing to do with my current problems, but I hate China's internet.  Funny, where I'm working, theres a bulding accross the street labled, China Training Center for Intellectual Property.

----------

## NeddySeagoon

tony11235,

I assume the next hop from the windows box drops ping packets. Thats easy to do with a firewall.

Its unusual to get different end points with ping and traceroute, as traceroute uses ping with successively longer time to lives.

Thats the number of hops before the packet is deemed lost and the host that has it sends a reply to that effect.

It sounds as if the windows box has a firewall set up. Are you able to drop it for a few minutes for testing ?

----------

## tony11235

Actually the firewall was never turned on in the first place.  I can't traceroute or get successfive pings at all on this network on either computer, from outside addresses that is.

----------

## NeddySeagoon

tony11235,

The loack of ping only tells that pings are blocked at the next hop.

----------

## tony11235

Well because I have nothing else left to really consider, I decided to see if it was due to my linux machine not belonging to the same domain.  But of course that's not the problem.

----------

## NeddySeagoon

tony11235,

Is the Windows box doing NAT, or only forwarding packets for you.

If its NAT, it should work, if its only forwarding packets, all your Linux packets are from the wrong subnet.

You need tcpdump on the Windows box to determine that. You need to look at whats going out of the Windows wired interface when the Linux box sends to the internet.

----------

## tony11235

Bingo! Ok after asking around, I finally found someone who paid attention to what the administrator did to their machine.  I had to setup a proxy of 192.168.3.1 on port 808, and do the same in firefox.  Now I can simply fake the MAC, run the static IP, and oh yeah, NOT PAY!  I'm probably feeling a little too happier than I should, but it's been a since I'm been able to use MY machine for internet purposes.

----------

## NeddySeagoon

tony11235,

You should still be able to connect through the Windows box.

----------

## tony11235

Yeah that's still a problem to figure out.  I SHOULD be able to to connect.

----------

## tony11235

http://www.gentoo.org/doc/en/home-router-howto.xml

Is this guide meant for eth0 and eth1 to both be wired ethernet ports?  Or can one be wired and the other wireless?

----------

## NeddySeagoon

tony11235,

Its not important. The guide is written for two wired ports.

There are no special settings in the guide that relate to the port type.

If you have eth0 and wlan0, map those interfaces onto the eth0 and eth1 in the guide.

----------

## tony11235

Ok with the proxy settings in tact, the shared connection with the windows machine works.

----------

