I have a machine w/ kubuntu w/ a wlan0 (runing w/ ndiswrapper) connecting to the net via braodband modem.
I now want to connect my laptop to the net thru the broadband modem via the wifi.
I followed this link:
http://forums.gentoo.org/viewtopic-t-274790-highlight-adhoc+wireless.html
I managed to get the laptop talking to the kubuntu machine and I can even browse the net on the laptop.
The problem is that I have lost internet connectivity on the kubuntu machine :( . No ping, no web access, zilch.
I have the follwoing setup:
modem <-> (pub.lic.I.P) PC <-> wifi (192.168.1.202) <-> (192.168.1.204) laptop
I have made the requisite changes in the commands shown on this page.
where is the problem ?
do I need any changes to this line ?
route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.1.1
I've changed it to
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.202
regards,
Sharukh
Dr. Sharukh K. R. Pavri. wrote:
I have a machine w/ kubuntu w/ a wlan0 (runing w/ ndiswrapper) connecting to the net via braodband modem.
I now want to connect my laptop to the net thru the broadband modem via the wifi.
I followed this link:
http://forums.gentoo.org/viewtopic-t-274790-highlight-adhoc+wireless.html
I managed to get the laptop talking to the kubuntu machine and I can even browse the net on the laptop.
The problem is that I have lost internet connectivity on the kubuntu machine :( . No ping, no web access, zilch.
I have the follwoing setup:
modem <-> (pub.lic.I.P) PC <-> wifi (192.168.1.202) <-> (192.168.1.204) laptop
I have made the requisite changes in the commands shown on this page.
where is the problem ?
do I need any changes to this line ?
route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.1.1
I've changed it to
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.202
This line is anyway added in the other machines, not the router machine. What do the general network commands like ifconfig, route etc. reveal in the router machine?
On Thu, 10 Jul 2008, Rony wrote:
Dr. Sharukh K. R. Pavri. wrote:
I have a machine w/ kubuntu w/ a wlan0 (runing w/ ndiswrapper) connecting to the net via braodband modem.
I now want to connect my laptop to the net thru the broadband modem via the wifi.
I followed this link:
http://forums.gentoo.org/viewtopic-t-274790-highlight-adhoc+wireless.html
I managed to get the laptop talking to the kubuntu machine and I can even browse the net on the laptop.
The problem is that I have lost internet connectivity on the kubuntu machine :( . No ping, no web access, zilch.
I have the follwoing setup:
modem <-> (pub.lic.I.P) PC <-> wifi (192.168.1.202) <-> (192.168.1.204) laptop
I have made the requisite changes in the commands shown on this page.
where is the problem ?
do I need any changes to this line ?
route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.1.1
I've changed it to
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.202
This line is anyway added in the other machines, not the router machine. What do the general network commands like ifconfig, route etc. reveal in the router machine?
-- Regards,
Rony.
That command is only run on the laptop and not the router.
These are the outputs:
------------------------------------- sharukh@natrum:~$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0 172.16.76.0 * 255.255.255.0 U 0 0 0 vmnet8 202.88.160.0 * 255.255.255.0 U 0 0 0 eth0 192.168.237.0 * 255.255.255.0 U 0 0 0 vmnet1 link-local * 255.255.0.0 U 1000 0 0 eth0 default 202.88.160.161 0.0.0.0 UG 0 0 0 eth0 ----------------------------------------
sharukh@natrum:~$ ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:19:D1:70:A1:8B inet addr:202.XXX.XXX.XXX Bcast:202.88.160.255 Mask:255.255.255.0 inet6 addr: fe80::219:d1ff:fe70:a18b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:182695 errors:0 dropped:0 overruns:0 frame:0 TX packets:27256 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:46662548 (44.5 MiB) TX bytes:2269779 (2.1 MiB)
sharukh@natrum:~$ ifconfig wlan0 wlan0 Link encap:Ethernet HWaddr 00:13:F7:06:AB:76 inet addr:192.168.1.202 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::213:f7ff:fe06:ab76/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:168 (168.0 b) Interrupt:17 Memory:50000000-50002000 --------------------------------------------
sharukh@natrum:~$ iwconfig lo no wireless extensions.
eth0 no wireless extensions.
wlan0 IEEE 802.11g ESSID:off/any Mode:Ad-Hoc Frequency:2.462 GHz Cell: Not-Associated Bit Rate=2 Mb/s Tx-Power:32 dBm RTS thr=2347 B Fragment thr=2346 B Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0
vmnet8 no wireless extensions.
vmnet1 no wireless extensions.
------------------------------------------------
sharukh@natrum:~$ cat /etc/network/interfaces auto lo iface lo inet loopback address 127.0.0.1 netmask 255.0.0.0
auto eth0 iface eth0 inet static address 202.XXX.XXX.XXX netmask 255.255.255.0 gateway 202.88.160.161
#auto eth1 #iface eth1 inet dhcp
#auto eth2 #iface eth2 inet dhcp
#auto ath0 #iface ath0 inet dhcp
auto wlan0 iface wlan0 inet static address 192.168.1.202 netmask 255.255.255.0 gateway 202.XXX.XXX.XXX broadcast 192.168.1.255 wireless_mode ad-hoc wireless-essid "secret"
-----------------------------------------------
I have added a line for essid in /etc/network/interfaces but iwconfig shows it to be off/any
----------------------------------------------
I am able to ping to and from my router machine to my laptop, it's just that when I run the iptables commands that the router machine is no longer able to access the net itself.
If I then do a /etc/init.d/networking restart, the router machine is able to connect to the internet but the laptop is cut off.
thanks,
Sharukh.
Dr. Sharukh K. R. Pavri. wrote:
That command is only run on the laptop and not the router.
These are the outputs:
sharukh@natrum:~$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0 172.16.76.0 * 255.255.255.0 U 0 0 0 vmnet8 202.88.160.0 * 255.255.255.0 U 0 0 0 eth0 192.168.237.0 * 255.255.255.0 U 0 0 0 vmnet1 link-local * 255.255.0.0 U 1000 0 0 eth0 default 202.88.160.161 0.0.0.0 UG 0 0 0 eth0
What are vmnet1 and vmnet8? Can you ping your gateway 202.88.160.161?
sharukh@natrum:~$ cat /etc/network/interfaces auto lo iface lo inet loopback address 127.0.0.1 netmask 255.0.0.0
auto eth0 iface eth0 inet static address 202.XXX.XXX.XXX netmask 255.255.255.0 gateway 202.88.160.161
You are using Hathway's cable modem, and I recollect that it uses a netmask of 255.255.254.0, since the third octal value is different for your IP and Gateway. Maybe in your area it uses the same values. However if your laptop accesses the gateway, the entries may be OK.
#auto eth1 #iface eth1 inet dhcp
#auto eth2 #iface eth2 inet dhcp
#auto ath0 #iface ath0 inet dhcp
auto wlan0 iface wlan0 inet static address 192.168.1.202 netmask 255.255.255.0 gateway 202.XXX.XXX.XXX broadcast 192.168.1.255 wireless_mode ad-hoc wireless-essid "secret"
I have added a line for essid in /etc/network/interfaces but iwconfig shows it to be off/any
I am able to ping to and from my router machine to my laptop, it's just that when I run the iptables commands that the router machine is no longer able to access the net itself.
If you want a more easy firewall setup, use Arno's firewall. It asks questions during setup and you can configure it to your choice. You can also re-configure it using sudo dpkg-reconfigure arnos..... It will automatically start on your PC startup.
If I then do a /etc/init.d/networking restart, the router machine is able to connect to the internet but the laptop is cut off.
On Fri, 11 Jul 2008, Rony wrote:
Dr. Sharukh K. R. Pavri. wrote:
That command is only run on the laptop and not the router.
These are the outputs:
sharukh@natrum:~$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0 172.16.76.0 * 255.255.255.0 U 0 0 0 vmnet8 202.88.160.0 * 255.255.255.0 U 0 0 0 eth0 192.168.237.0 * 255.255.255.0 U 0 0 0 vmnet1 link-local * 255.255.0.0 U 1000 0 0 eth0 default 202.88.160.161 0.0.0.0 UG 0 0 0 eth0
What are vmnet1 and vmnet8? Can you ping your gateway 202.88.160.161?
those are virtual nic's set up by vmware.
sharukh@natrum:~$ cat /etc/network/interfaces auto lo iface lo inet loopback address 127.0.0.1 netmask 255.0.0.0
auto eth0 iface eth0 inet static address 202.XXX.XXX.XXX netmask 255.255.255.0 gateway 202.88.160.161
You are using Hathway's cable modem, and I recollect that it uses a netmask of 255.255.254.0, since the third octal value is different for your IP and Gateway. Maybe in your area it uses the same values. However if your laptop accesses the gateway, the entries may be OK.
#auto eth1 #iface eth1 inet dhcp
#auto eth2 #iface eth2 inet dhcp
#auto ath0 #iface ath0 inet dhcp
auto wlan0 iface wlan0 inet static address 192.168.1.202 netmask 255.255.255.0 gateway 202.XXX.XXX.XXX broadcast 192.168.1.255 wireless_mode ad-hoc wireless-essid "secret"
I have added a line for essid in /etc/network/interfaces but iwconfig shows it to be off/any
I am able to ping to and from my router machine to my laptop, it's just that when I run the iptables commands that the router machine is no longer able to access the net itself.
If you want a more easy firewall setup, use Arno's firewall. It asks questions during setup and you can configure it to your choice. You can also re-configure it using sudo dpkg-reconfigure arnos..... It will automatically start on your PC startup.
If I then do a /etc/init.d/networking restart, the router machine is able to connect to the internet but the laptop is cut off.
-- Regards,
Rony.
GNU/Linux ! No Viruses No Spyware Only Freedom.
On Wednesday 09 Jul 2008, Dr. Sharukh K. R. Pavri. wrote:
I now want to connect my laptop to the net thru the broadband modem via the wifi.
Your wording is confusing. If the broadband modem is connected to the PC then the PC is acting as the gateway. The laptop the PC is router,
I managed to get the laptop talking to the kubuntu machine and I can even browse the net on the laptop.
Hmm. implies packet from 192.168.0.x are being forwarded and NAT'd.
The problem is that I have lost internet connectivity on the kubuntu machine :( . No ping, no web access, zilch.
Strange. What is the exact error message? Are you pinging by hostname or IP address? What are the entries in /etc/resolv.conf?
On the PC what is the output of:
$host -t ns yahoo.com
I have the follwoing setup:
modem <-> (pub.lic.I.P) PC <-> wifi (192.168.1.202) <-> (192.168.1.204) laptop
Looks like you have the modem in "Bridge" mode. Your PC is visible on the 'Net. I suggest you put it in router mode and use the router as the gateway. This will protect your PC via the NAT'd firewall and you will not have to put in any iptables rules for eth0.
I've changed it to
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.202
You can simplify the above with the following:
# route add default gw 192.168.1.202
on your laptop and other systems.
Me suspect you have a DNS problem on your PC 'cuz your laptop is able to connect (thru the PC) to websites and get responses back.
On Fri, 11 Jul 2008, Arun Khan wrote:
On Wednesday 09 Jul 2008, Dr. Sharukh K. R. Pavri. wrote:
I now want to connect my laptop to the net thru the broadband modem via the wifi.
Your wording is confusing. If the broadband modem is connected to the PC then the PC is acting as the gateway. The laptop the PC is router,
sorry -- let me clarify: the pc has eth0 that connects to a cable modem. The pc _also_ has a wlan0.
I managed to get the laptop talking to the kubuntu machine and I can even browse the net on the laptop.
Hmm. implies packet from 192.168.0.x are being forwarded and NAT'd.
The problem is that I have lost internet connectivity on the kubuntu machine :( . No ping, no web access, zilch.
Strange. What is the exact error message? Are you pinging by hostname or IP address? What are the entries in /etc/resolv.conf?
I am pinging by hostname. After running the commands, the error is
ping: unknown host www.yahoo.com
if I ping by IP address
sharukh@natrum:~$ ping -c5 87.248.113.14 PING 87.248.113.14 (87.248.113.14) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted
--- 87.248.113.14 ping statistics --- 5 packets transmitted, 0 received, 100% packet loss, time 3999ms -------------------------------------------------------- /etc/resolv.conf shows the hathway dns servers (three of them)
On the PC what is the output of:
$host -t ns yahoo.com
before runing the iptables command -------------------------------------- sharukh@natrum:~$ host -t ns yahoo.com yahoo.com name server ns3.yahoo.com. yahoo.com name server ns4.yahoo.com. yahoo.com name server ns5.yahoo.com. yahoo.com name server ns6.yahoo.com. yahoo.com name server ns8.yahoo.com. yahoo.com name server ns1.yahoo.com. yahoo.com name server ns2.yahoo.com. --------------------------------------
after iptables command
sharukh@natrum:~$ host -t ns yahoo.com ;; connection timed out; no servers could be reached ----------------------------------------
so yes, a dns problem. but how do I fix this ? As I said, a network restart solves this probelm but then the laptop loses connectivity. :(
I have the follwoing setup:
modem <-> (pub.lic.I.P) PC <-> wifi (192.168.1.202) <-> (192.168.1.204) laptop
Looks like you have the modem in "Bridge" mode. Your PC is visible on the 'Net. I suggest you put it in router mode and use the router as the gateway. This will protect your PC via the NAT'd firewall and you will not have to put in any iptables rules for eth0.
It's a cable modem. I tried to open http://10.40.0.1/ but no luck. That address is the first hop on traceroute.
I've changed it to
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.202
You can simplify the above with the following:
# route add default gw 192.168.1.202
on your laptop and other systems.
ok, will do that.
Me suspect you have a DNS problem on your PC 'cuz your laptop is able to connect (thru the PC) to websites and get responses back.
-- Arun Khan -- http://mm.glug-bom.org/mailman/listinfo/linuxers
On Wed, 09 Jul 2008, Dr. Sharukh K. R. Pavri. wrote:
I have a machine w/ kubuntu w/ a wlan0 (runing w/ ndiswrapper) connecting to the net via braodband modem.
<snip>
ouch -- I found out what the problem is. I disabled the gaurddog firewall I was running on the pc and lo everything works :)
Guess I will have to look at another firewall -- arno's seems to be wel recommended and it's in the ubuntu depos.
thanks guys.
Sharukh.