LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-04-2009, 08:57 AM   #16
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550

Heh looks like you're working on this as I post!

Your script looks good to me at a glance (if it runs error free, that's a good sign you wrote it right) and if it WORKS, that's another plus. Nice job.

If you still have troubles, or want/need to continue troubleshooting, let us know! (Or if anything in my last post strikes a chord, we can continue fiddling!)

Sasha
 
Old 08-04-2009, 11:12 AM   #17
gregorian
Member
 
Registered: Apr 2006
Location: India
Posts: 473

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by GrapefruiTgirl View Post
  • `route -n` from both the DHCP machine, AND the wireless machine.
I won't be allowed to access my ISP's DHCP machine.
Quote:
  • `ifconfig wlan0` on the wireless machine (or of `iwconfig wlan0` if that's what would be used on the wireless)
It's mentioned above.iwconfig will provide different information from ifconfig
Quote:
  • Which & what versions of DHCP and DHCPCD are running on the DHCP Server and the wireless machine.
I'm not sure what you mean by wireless machine, but if you're referring to my computer it says dhcpcd 2.0 at the bottom of the man page. I don't know if that's the man page version.

Quote:
  • Windows does some bizarre magic that makes it work, even though technically it should not work.
I assume windows obtains the routing information automatically after the IP address is obtained (as route print on windows displays). I don't know if this information is provided by the DHCP server or the gateway (although they're the same machine in my place).
[/quote]
Quote:
  • The DHCP server is not providing enough info to the Linux wireless system for it to properly config itself.
Must the DHCP server care if I'm using Windows or Linux?
Quote:
  • If you can make it work properly, in a consistent manner WITHOUT USING DHCP, it would lead us in a good direction from here.
How do I get an IP without DHCP? I cannot obtain a static address.
Quote:
I do like troubleshooting though
No surprise there. You're a Slacker, just like me

Regarding the shell script - It's the first one I've ever written, so I don't know if there is a flaw in the code where it may break. I'd like to know if you could extract the IP in a cleaner way. The last part of the pipelined commands is a very unclean way of extracting the IP from
172.16.254.250 BCast (cut -f1 -dB)

I was wondering if you could tell me why adding myself as a gateway allowed me to detect my ISP gateway. This was my thought process: I cannot ping 172.16.1.1, but I can ping myself (not ping localhost). ping must not know how to get to 172.16.1.1, but obviously dhcpd does, otherwise it could not have obtained the ip address nor could it have written to /etc/resolve.conf. Why doesn't ping know? Because ping doesn't know how to send the packet. Why is that? Because whatever process ping depends on doesn't know how to forward the packet. The word 'route' popped up in my mind. The only address I could ping was my own, so I added myself to the routing tables. I was able to ping 172.16.1.1 after that so I immediately added it. Ergo, I'm here. What I'd like to know is why am I a gateway. Do applications need to go 'through' me before they can go anywhere else? It appears like packet -> myself -> gateway -> somewhere. I think it was a mistake to assume that we could talk to the gateway directly. I know only what the terms dns, dhcp and routing mean. Whatever you read above was a layman's analysis, so please feel free to tell me that I have no idea of what I'm talking about and correct me. I have a networking course this semester. Maybe I won't sound so ignorant after that.

Last edited by gregorian; 08-04-2009 at 11:41 AM.
 
Old 08-04-2009, 12:45 PM   #18
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Dupe.

Last edited by GrapefruiTgirl; 08-04-2009 at 12:47 PM.
 
Old 08-04-2009, 12:45 PM   #19
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by The OP
Summarising,

1. I need to know why my status is always disabled in dmesg, even though my light glows. ( I don't have bluetooth)
2. I need to know why the second command doesn't always work. Remember, it DID work once.
3. Even though DHCP set my nameserver in /etc/resolv.conf and gave me an IP address, why couldn't I do anything? Couldn't even ping my DHCP server (which also happens to be my DNS server and GATEWAY). The first one's random. But the second one isn't.
My mistake -- I took #3 above to mean that YOU have the DNS/DHCP/Gateway machine at your location.
Quote:
I assume windows obtains the routing information automatically after the IP address is obtained (as route print on windows displays). I don't know if this information is provided by the DHCP server or the gateway (although they're the same machine in my place).Must the DHCP server care if I'm using Windows or Linux?
Theoretically, NO. But, it has been known to occur on occasion that the DHCP information provided by an ISP is not quite up to snuff, or provides information in such a way so as to screw up the DHCP transaction. This is what happened to me, for example, when trying to send DHCP information from my DHCP server to my roommates WInXP machine. For the life of us, we could NOT get her machine to accept DHCP info/lease from my Slack machine. Eventually, I upgraded (or downgraded, I can't recall) my DHCP server to a different version, and instantly her WinXP machine got an IP from that day on. I don't know what/how to explain what the problem may have been-- the configuration file was identical for both versions of DHCP, but one worked and one didn't. So it stands to reason that it's *possible* for the same thing to be happening in the case of your ISP vs. your Linux machine.

Quote:
How do I get an IP without DHCP? I cannot obtain a static address
You would do it manually, using i[f|w]config, such as:

ifconfig eth0 123.234.343.222 netmask 255.255.255.255

or

iwconfig wlan0 123.123.1212.122 netmask ...

The ISP doesn't necessarily care what your IP is, BUT it needs to know that xxx IP address is associated with yyy machine/connection. So if the ISP assigns you aaa.bbb.ccc.ddd, that's what it knows you by; if you change your IP to aaa.bbb.ccc.def then the ISP no longer knows who the heck you are, and won't communicate with you.

So, in this case, where you get an IP from the ISP, you would (1) need to know what IP it was trying to give you, and then (2) manually assign it to your NIC, and configure the rest of the stuff (routing, nameservers, ...) yourself. This is kinda what I do--- I get my IP from my ISP into my DHCP/DNS machine, then I use my little script to set up routing, (maybe nameservers), and Gateway(s) for my LAN.

As for your last big paragraph above: I think you're doing a great job of diagnostics here, layman or otherwise.

I will grab my script off my Firewall/DHCP machine, and show you the (maybe no less unclean) way I extracted the IP information. IIRC it's similar to yours, but not the same. Give me a few minutes, I need to FTP it over from there to my desktop.

Sasha

Last edited by GrapefruiTgirl; 08-04-2009 at 12:47 PM. Reason: messed up quotes
 
Old 08-04-2009, 12:54 PM   #20
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Code:
#!/bin/bash

# Script called by kppp when dialing out/connected/hanging up.
# Sets up gateway(s), re-starts Firewall

#Before dialing ISP:
#1 - shut down network (rc.inet1)
#2 - stop firewall
dialing () {
  killall pppd 1>/dev/null 2>&1 
  /etc/rc.d/rc.inet1 stop
  /etc/rc.d/rc.lutelwall stop
  sleep 1
  # ready to dial
}

# Once we're connected:
# bring up network (rc.inet1)
# bring up 'default gateway' on ppp0
# start firewall
connected () {
  /etc/rc.d/rc.inet1 start
  sleep 5
  gwaddr=`ip addr show ppp0 | gawk '/^[ ]*inet /{ print $2 }'`
  [ -n "$gwaddr" ] && `route del default gateway "$gwaddr"`
  sleep 1
  route add default gateway "$gwaddr"
  sleep 1
  /etc/rc.d/rc.lutelwall start
}

# After disconnect from ISP, nothing critical, but..
disconnected () {
  killall pppd 1>/dev/null 2>&1 # kill any zombie pppd's
  /etc/rc.d/rc.lutelwall stop
}

case $1 in
dialing) dialing ;;
connected) connected ;;
disconnected) disconnected ;;
*)
echo "Please use $0  dialing|connected|disconnected" ;;
esac
So I use KPPP to dial my DHCP/DNS/Firewall machine out to my ISP.

I have KPPP configured to execute this script when KPPP is dialing, connected, or disconnected.

The bold text is how I get the gateway address that was assigned by my ISP to my DHCP machine. NOTE: The Gateway for my DHCP machine is actually the remote IP address of my ISP whereas in your case, the Gatweay address for YOUR local machine, ought to be the same: the IP address of your ISP.. So, I'm *guessing* that is you substituted wlan0 where I put ppp0 you would end up with the same result.
Sasha

Last edited by GrapefruiTgirl; 08-04-2009 at 01:05 PM.
 
Old 08-04-2009, 12:54 PM   #21
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Freakin' Dupe Again

Last edited by GrapefruiTgirl; 08-04-2009 at 12:59 PM.
 
Old 08-04-2009, 01:10 PM   #22
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Also, here's what the routing table looks like on my DHCP machine, after having dialed out and run the script:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
142.177.114.251 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         142.177.12.113  0.0.0.0         UG    0      0        0 ppp0
The GREEN address is my local address assigned by the ISP. The ORANGE address is my ISP's address.

Sasha

Last edited by GrapefruiTgirl; 08-04-2009 at 10:43 PM. Reason: I had the ISP and local addresses backwards.
 
Old 08-04-2009, 01:27 PM   #23
gregorian
Member
 
Registered: Apr 2006
Location: India
Posts: 473

Original Poster
Rep: Reputation: 33
Quote:
So, in this case, where you get an IP from the ISP, you would (1) need to know what IP it was trying to give you, and then (2) manually assign it to your NIC, and configure the rest of the stuff (routing, nameservers, ...) yourself. This is kinda what I do--- I get my IP from my ISP into my DHCP/DNS machine
Yes, but (1) is the most important thing right? The very fact that it's trying to give you, a currently unregistered computer an IP - doesn't it show that it doesn't use static addressing. Based on the information you mentioned - mapping a hardware address to an IP - doesn't the static addressing scheme require knowledge of the mapping to determine which device (hardware address) is at which IP? I assume that this happens automatically in DHCP, since any computer can connect to the network, even though it has never registered with the network before. I'm assuming that the DHCP client tells the DHCP server its hardware address, and in exchange, the server provides the client with an IP, as well as storing the new mapping. The mapping is probably deleted after the client disconnects/expires(?) so that the IP isn't wasted on a dead client and can be assigned to a new incoming connection.

How would you know what the ISP was trying to give you unless you ask it (via DHCP probably?) ? I'm aware of the technique used to set a static ip, but that's useful only when you know what IP to set it to right?

In your case, I think since you were in charge of the DHCP server on your computer, you were able to assign the IP to your roommate's computer. I wonder how YOU actually managed to get an IP from the ISP assuming you were on a non-static IP internet connection without using DHCP.

Thank you very much for all your time.
 
Old 08-04-2009, 01:30 PM   #24
gregorian
Member
 
Registered: Apr 2006
Location: India
Posts: 473

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by GrapefruiTgirl View Post
Also, here's what the routing table looks like on my DHCP machine, after having dialed out and run the script:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
142.177.114.251 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         142.177.12.113  0.0.0.0         UG    0      0        0 ppp0
The GREEN address is the ISP. The ORANGE address is my local address.

Sasha
Does 192.168.* refer to the local connection your roommate and you share? 142.177.12.113.. isn't that what an internal IP looks like after translation to the outside world (NAT I think). Why does your routing table have an IP address like that? (Or is your ISP much larger than my small college level ISP, that 172.* wouldn't hold enough IPs? Once again I have little idea of what I'm talking about). As far as I have seen, I jumped to the conclusion, that the IP in the routing table wouldn't be something after NAT was done.

Quote:
The bold text is how I get the gateway address that was assigned by my ISP to my DHCP machine. NOTE: The Gateway for my DHCP machine is actually the remote IP address of my ISP whereas in your case, the Gatweay address for YOUR local machine, ought to be the same: the IP address of your ISP.. So, I'm *guessing* that is you substituted wlan0 where I put ppp0 you would end up with the same result.
Correct, my analysis matches yours. But that's the source of my confusion, I need to be my own gateway before I can access my ISP gateway,

Almost the same result. The IP had a /32 at the end so I'm guessing it denotes an IPv4 address. Am I correct in understanding that your DHCP server assigns address to your internal LAN and that one computer (yours, the one that runs the DHCP server) is used to connect to the internet? It's the one you're using to type this post.

Is your computer the gateway for the computers in the lan, and the only one who uses the ISP gateway is you?

P.S. As much I love to continue this discussion, I'm going to have to go to sleep now. I'll continue posting tomorrow. It was great talking to you!

Last edited by gregorian; 08-04-2009 at 02:01 PM.
 
Old 08-04-2009, 02:10 PM   #25
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by gregorian View Post
Yes, but (1) is the most important thing right? The very fact that it's trying to give you, a currently unregistered computer an IP - doesn't it show that it doesn't use static addressing.
Yes, it DOES show it isn't using static addressing, but DHCP-induced dynamic addressing instead.

Quote:
Based on the information you mentioned - mapping a hardware address to an IP - doesn't the static addressing scheme require knowledge of the mapping to determine which device (hardware address) is at which IP?
I don't understand this part above.. But I'll try:

No, it doesn't require any knowledge really, of the 'mapping scheme'.
If I understand correctly, your situation has only ONE piece of hardware with which we're concerned, and that is your wireless NIC. Correct? And you get a IP address, wirelessly, from your ISP, by DHCP, correct?

Your OS is what takes a hardware address (like a MAC address) and gives it a name (Wlan0) thereby doing the hard work. Now, what remains is to give 'Wlan0' an IP address. By which means you do this is irrelevant in this context, because as long as it somehow gets assigned the/an IP that will allow your ISP to communicate with it, it diesn't matter *how* the address got set.

Quote:
I assume that this happens automatically in DHCP, since any computer can connect to the network, even though it has never registered with the network before. I'm assuming that the DHCP client tells the DHCP server its hardware address, and in exchange, the server provides the client with an IP, as well as storing the new mapping. The mapping is probably deleted after the client disconnects/expires(?) so that the IP isn't wasted on a dead client and can be assigned to a new incoming connection.
To my understanding, I believe that is all correct, or certainly 'correct enough' for you and I in this thread's context

Quote:
How would you know what the ISP was trying to give you unless you ask it (via DHCP probably?) ? I'm aware of the technique used to set a static ip, but that's useful only when you know what IP to set it to right?
Well, yes that's the trick. I was hoping/thinking as I posted that, that what might help is to go through whatever hoops you must, in order to finally get an IP from your ISP, sothat the connection works. THEN, now having that IP address, you could write it down, then completely wipe out all routing info and, knowing what IP the ISP gave you, set it manually (as though you were setting it statically) and then proceed to configure the routing table so that it resembles the one I showed you, which is off my DHCP-server machine, and has the proper gateway configured, without (hopefully) the need to make yourself a gateway and/or have more than one gateway.

Quote:
In your case, I think since you were in charge of the DHCP server on your computer, you were able to assign the IP to your roommate's computer. I wonder how YOU actually managed to get an IP from the ISP assuming you were on a non-static IP internet connection without using DHCP.
OK.. We have 3 computers in the house here, that pertain to this discussion.

Brickwall= The machine that dials out to my ISP, and also runs a DHCP & DNS & FTP service that serve my LAN. The Brickwall machine does not get used by humans, except for when I click 'Connect' on the KPPP dialog box. After dialing out, Brickwall gets a dynamic IP address from the ISP, using DHCP, then it runs the script I posted earlier, to sort out it's own routing table so that the LAN machines can connect THRU Brickwall to the internet. The dial-up connection is called 'ppp0' on that machine. Eth0 and Eth1 are Ethernet cards inside Brickwall, one each of which serve the two other machines here.

Reactor= My desktop machine that I'm typing all this from. It's plugged into Brickwall's Eth0 port by wire. It uses DHCP to obtain an IP address from the DHCP-Server that is running on Brickwall.

Brina= My roommates machine (WinXP). It's connected by wireless to a router (set up as an AP) which is connected to the Eth1 on Brickwall. It does like Reactor does: gets its IP address from the DHCP service running on Brickwall.



Quote:
Thank you very much for all your time.
You're very welcome; I only hope I am not contributing to mass hysteria and confusion

Sasha

PS - I must now look at your next reply, so don't reply yet or we'll be playing post leapfrog!

EDIT: I see you're going to sleep. Therefore, if there is continuing confusion after you have read this post, just post some more stuff and I will do my best to clarify. Nighty-nite!

Last edited by GrapefruiTgirl; 08-04-2009 at 02:15 PM.
 
Old 08-04-2009, 08:34 PM   #26
gregorian
Member
 
Registered: Apr 2006
Location: India
Posts: 473

Original Poster
Rep: Reputation: 33
Quote:
No, it doesn't require any knowledge really, of the 'mapping scheme'.
If I understand correctly, your situation has only ONE piece of hardware with which we're concerned, and that is your wireless NIC. Correct? And you get a IP address, wirelessly, from your ISP, by DHCP, correct?
Would it be a different case if there was more than one hardware device? No matter how many devices you have, you can connect to a single ISP using only one of the devices (the one you mention in iwconfig wlanx).

I was comparing your routing table with mine.

Quote:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
142.177.114.251 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         142.177.12.113  0.0.0.0         UG    0      0        0 ppp0
The GREEN address is the ISP. The ORANGE address is my local address.
The first entry is your ISP gateway.The second and third entries in your table are for your computer and your roommate's, which are connected to BrickWall. The fourth is loopback. And the last one is the your address. That means even you've added yourself as a gateway! Everything makes sense, but what does 0.0.0.0 represent? I couldn't find a proper answer on Google. Observing the difference between "route -n" and "route". 0.0.0.0 means "*" as a gateway and "default" as a destination. Now what do those mean?

My routing table
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.254.150  0.0.0.0         255.255.255.255 UH    0      0        0 wlan0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         172.16.1.1      0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         172.16.254.150  0.0.0.0         UG    0      0        0 wlan0
The only difference between our tables is your private LAN and the line in bold. I'm surprised to see you've not added your ISP gateway as a gateway, but rather as a destination (I don't think this will go further unless I completely understand the meaning of 0.0.0.0). I think the one answer we're both looking for is why I'm (and seems like even you) unable to see the ISP gateway without routing packets through myself (I'm assuming that's the meaning of adding myself as a gateway).

EDIT: Here's something fantastic - I deleted myself from the routing table after getting connected. My connection still works. I don't think the routing table stores its information in some kind of cache (my computer's routing table) because deletion must mean you're explicitly telling the computer that you DON'T want to use a path anymore. I don't think the computer would ignore that.

Why do you think that works? Does it still work if you delete yourself from your routing table too (after connecting to the internet)?

Last edited by gregorian; 08-04-2009 at 08:57 PM.
 
Old 08-04-2009, 09:55 PM   #27
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
long crazy confusing post :)

Quote:
Originally Posted by gregorian
Quote:
Originally Posted by Sasha
No, it doesn't require any knowledge really, of the 'mapping scheme'.
If I understand correctly, your situation has only ONE piece of hardware with which we're concerned, and that is your wireless NIC. Correct? And you get a IP address, wirelessly, from your ISP, by DHCP, correct?
Would it be a different case if there was more than one hardware device? No matter how many devices you have, you can connect to a single ISP using only one of the devices (the one you mention in iwconfig wlanx).
Uhhh, yes, things would be different with more than one device, if you wanted to either connect to a single ISP with them, or use eg. a single broadband connection for multiple devices on one machine. There are ways & circumstances by which this can be done, but that's outside the scope of this conversation, which I think is confusing enough as is

Quote:
Originally Posted by gregorian
I was comparing your routing table with mine.
Remember, this is the routing table of Brickwall, the machine that dials out to my ISP. I'll break it down:

Code:
Brickwall routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
142.177.114.251 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         142.177.12.113  0.0.0.0         UG    0      0        0 ppp0
The RED address is the one given to Brickwall by the ISP. Note the UH Flag which means Up & Host (I think it's 'host')
The ORANGE addresses are the internal IP addresses of the two ethernet cards, one each of which feeds the two desktop computers. One is on the x.x.2.x subnet, and the other on the x.x.0.x subnet.
The GREEN is the local loopback address.
The PURPLE address is the IP address OF the ISP. The UG means it's UP, and is the/a Gateway (the default gateway).

Quote:
Originally Posted by gregorian

Everything makes sense, but what does 0.0.0.0 represent?
Indeed, there has to be a gateway somewhere. The UG is the Gateway. And by means of my `iptables` firewall, which does masquerading for my LAN(1) the traffic from each desktop machine gets received by the connected ethernet card, and FORWARDED via iptables to the Gateway, (the ISP), to the internet!


(1)Masquerading: that means, it allows my internet connection to be shared between the two desktop machines, but the ISP can only see ONE machine: The firewall machine that is directly connected; the traffic from the desktop machines here, all look like only one machine, to the ISP. The 2 desktop machines are masquerading as the one Brickwall machine.


0.0.0.0 basically represents the computer itself.

Quote:
I couldn't find a proper answer on Google. Observing the difference between "route -n" and "route". 0.0.0.0 means "*" as a gateway and "default" as a destination. Now what do those mean?
`route` and `route -n` give the exact same information, except the -n option shows the Numerical addresses, whereas without the -n you get *'s and hostnames, like so:

Here's the routing table on my DESKTOP machine (Reactor):

Code:
bash-3.1# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         brickwall       0.0.0.0         UG    0      0        0 eth0

bash-3.1# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.0.10    0.0.0.0         UG    0      0        0 eth0
bash-3.1#
See? Same thing. The external IP address of the eth0 card in Brickwall, is 192.168.0.10. That address is Reactor's Default Gateway. Reactor's own IP address is 192.168.0.30 and is assigned by Brickwall's DHCP server. So you see there, on Reactor, I have NOT added Reactor itself as a Gateway.

Quote:
Originally Posted by gregorian
My routing table
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.254.150  0.0.0.0         255.255.255.255 UH    0      0        0 wlan0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         172.16.1.1      0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         172.16.254.150  0.0.0.0         UG    0      0        0 wlan0
The only difference between our tables is your private LAN. I think the one answer we're both looking for is why I'm (and seems like even you) unable to see the ISP gateway without routing packets through myself (I'm assuming that's the meaning of adding myself as a gateway).
Yes.... We're looking for that answer for YOUR case; I think my case is clear, at least to me lol.

Quote:
Originally Posted by gregorian
EDIT: Here's something fantastic - I deleted myself from the routing table after getting connected. My connection still works. I don't think the routing table stores its information in some kind of cache (my computer's routing table) because deletion must mean you're explicitly telling the computer that you DON'T want to use a path anymore. I don't think the computer would ignore that.
The kernel stores the routing table *somewhere* -- I think in memory somewhere. And indeed, AFAIK, you should NOT need to have TWO gateways on that machine. I always am willing to be corrected/proven wrong, but to the best of my knowledge, that is abnormal. I am not surprised that stuff still works after you removed the address.
Quote:
Why do you think that works? Does it still work if you delete yourself from your routing table too (after connecting to the internet)?
Umm, if the last paragraph still leaves this unanswered, please ask it again

Wow, this is mind-bending stuff!

Sasha

Last edited by GrapefruiTgirl; 08-04-2009 at 10:00 PM. Reason: typos
 
Old 08-05-2009, 12:54 AM   #28
gregorian
Member
 
Registered: Apr 2006
Location: India
Posts: 473

Original Poster
Rep: Reputation: 33
Quote:
The kernel stores the routing table *somewhere* -- I think in memory somewhere.
Yes, and when you delete it I expect it to be removed from wherever it's stored since deletion is an explicit way for you tell the computer - "Do NOT use this path". But here adding my own IP as the gateway and removing it feels like adding training wheels to a cycle on my 'quest' to reach the ISP gateway and then removing my training wheels when I know how to get there on my own. Ok, weird analogy but I hope you get the point.


For the routing table, am I correct in understanding that the packets originating from the computer under consideration go to the 'destination' through a 'gateway' if a path is explicitly mentioned; or use the default gateway if it doesn't know how to reach?
Code:
Brickwall routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
142.177.114.251 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         142.177.12.113  0.0.0.0         UG    0      0        0 ppp0

Your explanation of the 0.0.0.0 confuses me. If it's the same machine, why not use 127.0.0.1?

If I have understood correctly (which I'm sure I have not), it's like telling a packet awaiting transmission:

Are you going to 142.177.114.251? (Address assigned to Brickwall by the ISP i.e. Brickwall itself)
Go through yourself on ppp0.

Are you going to 192.168.2.0/192.168.0.0?
Go through yourself on eth1 and eth2 respectively.

Are you going to 127.0.0.0?
Go through yourself on lo

Are you going to yourself?
Go through 142.177.12.113 (ISP gateway) on ppp0.

Last edited by gregorian; 08-05-2009 at 12:59 AM.
 
Old 08-05-2009, 09:10 AM   #29
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Post

Quote:
Originally Posted by gregorian View Post
Yes, and when you delete it I expect it to be removed from wherever it's stored since deletion is an explicit way for you tell the computer - "Do NOT use this path". But here adding my own IP as the gateway and removing it feels like adding training wheels to a cycle on my 'quest' to reach the ISP gateway and then removing my training wheels when I know how to get there on my own. Ok, weird analogy but I hope you get the point.
Actually, I'm not sure I do understand.

Quote:
Originally Posted by gregorian
For the routing table, am I correct in understanding that the packets originating from the computer under consideration go to the 'destination' through a 'gateway' if a path is explicitly mentioned; or use the default gateway if it doesn't know how to reach?
*Sounds* reasonable, but as mentioned earlier, I'm not an expert on this -- what knowledge I do have, and am trying to share, is wholly derived from hands-on experience with my own machines here. The deep-down technical guts of this stuff, I don't know enough about to concisely answer such a question.

Quote:
Originally Posted by gregorian
Your explanation of the 0.0.0.0 confuses me. If it's the same machine, why not use 127.0.0.1?
127.0.0.1 is specifically defined as "the loopback address" I suppose in order than there is a globally accepted standard loopback address, thereby ensuring compatibility between networking applications & protocols.

Everything from 0.0.0.0 to 127.255.255.255 is in the CLASS A range.

Quote:
Originally Posted by gregoria
If I have understood correctly (which I'm sure I have not), it's like telling a packet awaiting transmission:

Are you going to 142.177.114.251? (Address assigned to Brickwall by the ISP i.e. Brickwall itself)
Go through yourself on ppp0.

Are you going to 192.168.2.0/192.168.0.0?
Go through yourself on eth1 and eth2 respectively.

Are you going to 127.0.0.0?
Go through yourself on lo

Are you going to yourself?
Go through 142.177.12.113 (ISP gateway) on ppp0.
And again, I cannot describe the above process in a concise way.

I suggest that if you really want to fully understand the inner workings of networking (OS-independent) and the evolution of [D]ARPANET into what we now know of as the 'internet' then start at a place like This Wikipedia Page and follow the links at the bottom of that page to the various RFC's defining how protocols & policies are defined. There are other very well written Wikipedia pages about networking too.

If I can help further in any way, feel free to ask

Sasha

Last edited by GrapefruiTgirl; 08-05-2009 at 09:16 AM.
 
Old 08-05-2009, 09:14 AM   #30
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Oh, PS -- In a post of mine way back, which you've quoted several times, I mistakenly labeled my local ppp0 address vs my ISP's address backwards.

I have corrected that post, but keep this in mind when referencing posts further back.

Cheers!

Sasha
 
  


Reply

Tags
dhcp, gateway, route, routing, wifi, wireless


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set IP address to static from DHCP assigned address jborn Linux - Networking 4 02-02-2007 08:38 PM
eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where.. kublador Linux - Networking 14 05-16-2006 06:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
dhcp assigned address nilbog Linux - Networking 4 04-02-2003 11:17 AM
How to find out my IP address on a DHCP IP Assigned machine? simonh Linux - Networking 2 12-10-2002 05:49 AM


All times are GMT -5. The time now is 11:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration