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 |
Quote:
Quote:
Quote:
Quote:
[/quote] Quote:
Quote:
Quote:
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. |
Dupe.
|
Quote:
Quote:
Quote:
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 |
Code:
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 |
Freakin' Dupe Again :confused:
|
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 Sasha |
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? 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. |
Quote:
Quote:
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! |
Quote:
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? 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:
Quote:
Quote:
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:
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! |
Quote:
I was comparing your routing table with mine. Quote:
My routing table Code:
Destination Gateway Genmask Flags Metric Ref Use Iface 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)? |
long crazy confusing post :)
Quote:
Quote:
Code:
Brickwall routing table 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:
(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:
Here's the routing table on my DESKTOP machine (Reactor): Code:
Quote:
Quote:
Quote:
Wow, this is mind-bending stuff! Sasha |
Quote:
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 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. |
Quote:
Quote:
Quote:
Everything from 0.0.0.0 to 127.255.255.255 is in the CLASS A range. Quote:
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. :study::study::study: If I can help further in any way, feel free to ask :) Sasha |
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 |
All times are GMT -5. The time now is 04:15 PM. |