LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-30-2009, 10:25 AM   #16
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31

ok i now got the ping req. at 192.168.2.100 but still same ping messages. destination host unreachable.

it should ping from wlan0 not eth0 so i think it should ping @ 192.168.1.102
 
Old 11-30-2009, 02:59 PM   #17
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
i did
Code:
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
afther that
Code:
service iptables save
service iptables restart
to flush ip tables.
also i disabled the firewall creator that was inplamented by fedora 12

now all rules and chains will clear !

afther that i did
Code:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
service iptables save
service iptables restart
so it should masquerade wlan0 as an internet connection

but still afther reboot i get the same ping req.
Quote:
DESKTOP PING
Code:

[roel@vlip ~]$ ping www.google.nl
Code:
PING www.l.google.com (74.125.79.104) 56(84) bytes of data.
From 192.168.2.1: icmp_seq=1 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=2 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=3 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1 icmp_seq=1 Destination Host Unreachable
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1: icmp_seq=4 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=5 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1: icmp_seq=6 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
From 192.168.2.1 icmp_seq=5 Destination Host Unreachable
From 192.168.2.1 icmp_seq=6 Destination Host Unreachable
From 192.168.2.1: icmp_seq=8 Redirect Host(New nexthop: ey-in-f104.1e100.net (74.125.79.104))
^C
--- www.l.google.com ping statistics ---
8 packets transmitted, 0 received, +6 errors, 100% packet loss, time 7459ms
pipe 4

SERVER PING
Code:

[server@server ~]$ ping www.google.nl
PING www.l.google.com (74.125.79.99) 56(84) bytes of data.
From 192.168.2.1 icmp_seq=2 Destination Host Unreachable
From 192.168.2.1 icmp_seq=3 Destination Host Unreachable
From 192.168.2.1 icmp_seq=4 Destination Host Unreachable
From 192.168.2.1 icmp_seq=6 Destination Host Unreachable
From 192.168.2.1 icmp_seq=7 Destination Host Unreachable
From 192.168.2.1 icmp_seq=8 Destination Host Unreachable
^C
--- www.l.google.com ping statistics ---
9 packets transmitted, 0 received, +6 errors, 100% packet loss, time 8140ms
pipe 3

Today 03:22 PM
R03L 	
Code:

traceroute www.google.nl
traceroute to www.google.nl (74.125.79.104), 30 hops max, 60 byte packets
 1  192.168.2.1 (192.168.2.1)  0.181 ms  0.182 ms  0.260 ms
 2  192.168.2.1 (192.168.2.1)  2998.983 ms !H  2998.996 ms !H  2998.916 ms !H

Last edited by R03L; 11-30-2009 at 03:01 PM.
 
Old 11-30-2009, 11:31 PM   #18
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
I think that you have the hoses hooked up right, but you're pumping the water the wrong direction.

Look at it this way: Iptables enables packets sent from wlan0 to be sent to eth0 or vise versa. It also alters the packets as necessary so that packets sent from wlan0 through eth0 are well formed... but Iptables has no idea which way the internet is located. It's just connecting this pipe to that pipe, and saying 'I"m acting like a router' or 'I'm acting like a switch'. There's absolutely no logic inherent in iptables that says packets headed for the internet need to be sent through wlan0.

That logic lives in the routing tables. In order to print out the routing tables on your server, run the following command:

Code:
/sbin/route
and paste the results.
 
Old 12-01-2009, 03:47 AM   #19
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
Code:
/sbin/route: 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.1     *               255.255.255.255 UH    0      0        0 eth0
192.168.2.0     *               255.255.255.0   U     1      0        0 eth0
192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
when i disconnect eth0 its going nice and correctly through wlan0 but it should as only connection on the box.

Last edited by R03L; 12-01-2009 at 12:16 PM.
 
Old 12-01-2009, 10:21 PM   #20
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Quote:
Originally Posted by R03L View Post
Code:
/sbin/route: 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.1     *               255.255.255.255 UH    0      0        0 eth0
192.168.2.0     *               255.255.255.0   U     1      0        0 eth0
192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
when i disconnect eth0 its going nice and correctly through wlan0 but it should as only connection on the box.
Yeah... that's definitely not right. Your default route is through 192.168.1.1, but it's trying to send that through eth0, even though the 192.168.1.0 subnet is through wlan0. I'm not quite sure how to fix that yet.
 
Old 12-01-2009, 10:56 PM   #21
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Quote:
Originally Posted by R03L View Post
Code:
/sbin/route: 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.1     *               255.255.255.255 UH    0      0        0 eth0
192.168.2.0     *               255.255.255.0   U     1      0        0 eth0
192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
when i disconnect eth0 its going nice and correctly through wlan0 but it should as only connection on the box.
Ok, I've just been reading through the man pages for route here's what I'm thinking:

First, delete the routes to 192.168.1.1; these are going through the wrong interface.

Code:
route del -host 192.168.1.1
route del default gw 192.168.1.1
Then add them back, correctly:

Code:
route add -host 192.168.1.1 netmask 255.255.255.255 dev wlan0
route add dfault gw 192.168.1.1 netmask 0.0.0.0 dev wlan0
I'm not sure that the first of these two lines is necessary, 192.168.1.1 is in the 192.168.1.0 subnet, and should be routed via

Code:
192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0
Would someone else in the Linux-Networking forum care to check my math here? I don't go changing routing tables on a regular basis. R03L is pretty liberal with the 'thank you button', so it's worth your time

Quote:
Originally Posted by bartonski View Post
Click on the reference to this quote, it will take you back to the post where I attached a PDF of the network configuration

Last edited by bartonski; 12-01-2009 at 11:11 PM.
 
1 members found this post helpful.
Old 12-02-2009, 04:39 AM   #22
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
[solved]

Quote:
route add -host 192.168.1.1 netmask 255.255.255.255 dev wlan0
Code:
route: netmask  doesnt make sense whit host route
instead i did
Code:
route add -host 192.168.1.1 dev wlan0
route add default gw 192.168.1.1 netmask 0.0.0.0 dev wlan0
and i think this worked perfectly

Thanks for helping me out whit this... [SOLVED]

ONLY one thing.. how do i set this perminantly?
Fedora 12

((afther i reboot NetworkManager i need to set route again.
also if i reconnect wlan0 i need to set route again!!))

Last edited by R03L; 12-02-2009 at 06:18 AM.
 
Old 12-02-2009, 06:35 AM   #23
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
Quote:
ONLY one thing.. how do i set this perminantly?
Fedora 12

((afther i reboot NetworkManager i need to set route again.
also if i reconnect wlan0 i need to set route again!!))
ok i dit set these rules below inside:
Code:
/etc/rc.d/rc.local

Code:
route add -host 192.168.1.1 dev wlan0
route add default gw 192.168.1.1 netmask 0.0.0.0 dev wlan0
but its a temporaroly solution,
i read on this forum when the init scripts get updated rc.local will be cleared?

also when i disconnect from wlan0 i need to reboot for rc.local to be read again.
 
1 members found this post helpful.
Old 12-02-2009, 07:37 AM   #24
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Quote:
Originally Posted by R03L View Post
ok i dit set these rules below inside:
Code:
/etc/rc.d/rc.local
Code:
route add -host 192.168.1.1 dev wlan0
route add default gw 192.168.1.1 netmask 0.0.0.0 dev wlan0
but its a temporaroly solution,
i read on this forum when the init scripts get updated rc.local will be cleared?

also when i disconnect from wlan0 i need to reboot for rc.local to be read again.
I think that I would poke around inside network manager and see if there's a check-box or something that says "this is my route to the internet" or something. I'm just guessing,.. if there's not, this is a bug in network manager.

Thanks for working with the route stuff, that was uncharted territory for me... I know how it works on a theoretical level, but I've never had the need or opportunity to actually change the routing. (The one time I did, I was very very new to networking and ended up routing packets back to the network that they came from, doubling the network load... someone else had to trouble shoot that one for me).

Where did you find the info about setting routes in rc.local?
 
Old 12-02-2009, 08:50 AM   #25
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
here s the post
http://www.linuxquestions.org/questi...c-route-16769/
 
Old 12-02-2009, 10:06 AM   #26
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
Quote:
I think that I would poke around inside network manager and see if there's a check-box or something that says "this is my route to the internet" or something. I'm just guessing,.. if there's not, this is a bug in network manager.
There is no check-box inside fedora core 12 NetworkManager say "this is my route to the internet"

if there was it made life much easyer
 
Old 12-02-2009, 12:01 PM   #27
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Quote:
Originally Posted by R03L View Post
Further on from the same thread:

Quote:
Originally Posted by jrwsod View Post
I know this is an old thread but it kills me to see people using the rc.local file for this. This is not the right way to do this.
The correct way to add permanent static routes to a system besides setting the default gateway is to create a file /etc/sysconfig/network-scripts/route-eth0 (or whichever interface you want to route through). You can add as many routes as you would like per interface by simply incrementing the number at the end of each statement. Once saved a restart of the network services will force a read of this route file.
The syntax of the file should look like this:
ADDRESS0=x.x.x.x
GATEWAY0=x.x.x.x
NETMASK0=x.x.x.x
ADDRESS1=x.x.x.x
GATEWAY1=x.x.x.x
NETMASK1=x.x.x.x

Enjoy!
Take a look at /etc/sysconfig/network-scripts, and see if route-eth0 and route-wlan0 exist, if they do, look inside and see if each one is configured according the routes that you need. It may be that NetworkManager is reading from these, and that's why your routes are being re-written every time you re-connect to wlan0.
 
1 members found this post helpful.
Old 12-03-2009, 04:46 AM   #28
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
Code:
/etc/sysconfig/network-scripts/route-eth0
is there
but there is no
Code:
/etc/sysconfig/network-scripts/route-wlan0
so should i create one?

yes im new to setting routes. but thats the seccond point why im interesed in these things. im doing study LPI 1 so im little ahead on my study whit thisone.

Last edited by R03L; 12-03-2009 at 04:49 AM.
 
Old 12-03-2009, 10:05 PM   #29
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 48
Quote:
Originally Posted by R03L View Post
Code:
/etc/sysconfig/network-scripts/route-eth0
is there
but there is no
Code:
/etc/sysconfig/network-scripts/route-wlan0
so should i create one?

yes im new to setting routes. but thats the seccond point why im interesed in these things. im doing study LPI 1 so im little ahead on my study whit thisone.
Yes, I think that you need to add route-wlan0, and I think that you'll have to edit route-eth0.

I'd like to see route-eth0, partly because I'm running a Debian system that doesn't use that file, and I'm curious to see it, and partly because it might be useful.
 
Old 12-04-2009, 04:37 AM   #30
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Original Poster
Rep: Reputation: 31
/etc/sysconfig/network-scripts/eth0
Code:
GATEWAY0=192.168.1.1
NETMASK0=255.255.255.0
ADDRESS0=192.168.1.102
is the standart of this file..
i think created by networkmanager
 
  


Reply

Tags
config, configure, connection, dnsmasq, eth0, internet, ip, kernel, network manager, routing, should, table, wired, wireless, wlan, wlan0


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
dnsmasq: failed to bind DHCP server socket: Address already in use taske Linux - Networking 2 11-08-2009 05:40 PM
Need help setting up a dial on demand dnsmasq dhcp server with a decent firewall i nekkutta Slackware 0 03-22-2008 01:19 PM
dnsmasq: no dhcp ryerke Slackware 8 06-03-2007 06:29 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
eth0 not getting IP address from DHCP server Venefyxatu Linux - Networking 4 05-04-2005 06:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:02 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration