LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   dnsmasq as dhcp server on eth0 and networkmanager (https://www.linuxquestions.org/questions/linux-networking-3/dnsmasq-as-dhcp-server-on-eth0-and-networkmanager-770305/)

R03L 11-19-2009 04:42 PM

[SOLVED] dnsmasq as dhcp server on eth0 and networkmanager [SOLVED]
 
i use fedora as a server and want it to use as router.
herefor i need dnsmasq to set up an dhcp server
and /etc/init.d/dnsmasq restart says OK.

my dnsmasq.conf looks like
Code:

domain-needed
bogus-priv
resolv-file=/etc/resolv.conf
dhcp-range=192.168.2.100,192.168.2.250,255.255.255.0,12h
dhcp-option=3,192.168.2.1
dhcp-option=15,dhcp.server.lan
#listen-address=192.168.2.1
interface=eth0
except-interface=wlan0
except-interface=wlan1
bind-interfaces

Code:

sudo /etc/init.d/dnsmasq restart
Starting dnsmasq  [  OK  ]

so far so good

it shoud act as a dhcp only my first question is that my dnsserver is at 192.168.1.1 does it get thisone from resolv.conf than i have it configured correctly for that.
i dont now how to forward thatone.
but

i still have NetworkManager running up eth0 and wlan for wlan connection

howto send out dhcp dnsmasq to eth0
eth0 is still listening to dhcp and it should send dhcp????
howto configure thisone?

thanks in advanced :)

bartonski 11-21-2009 09:20 AM

I'm not quite sure that I'm reading this correctly; let's start from the top:

I'm going to call the fedora box with dnsmasq running 'dhcp server'.
  • what interfaces are available on dhcp server?
  • what are the ip addresses on each interface?
  • what device has a connection to the internet?
  • what device is sharing network connections (router, switch, hub...)
  • what other computers do you have on your network?
  • what are their IP addresses?
  • Where were these machines getting IP address before you set up dnsmasq?
  • have you done a release/renew on their IP addresses since you installed dnsmasq?

If you can answer these, as well as any other special setup on your network, I'll be in a better position to help.

R03L 11-23-2009 04:43 AM

i have a fileserver wireless connected whit my dd-wrt router.
and i have my dekstop pc besides that.
i cannot have my fileserver below becouse the people living here dont allow that, yes i need to move from a room to a house but enough of that..

i have a wireless connection to my fileserver
and want a wired connection to my desktop from the fileserver.

now i have connection sharing enabled on the fileserver and that works but i want to use dnsmasq to do it.

from fileserver one router wireless,
one desktop pc 1000mb wired. need an ip adress from dhcpserver.

dhcpd or dnsmasq but my m8 said i best can use dnsmasq to do this.

now you see i have dnsmasq running.
but i don't get any ip adress from this,

like i said i still have eth0 1000mb wired at dhcp client, asking for dhcp from my desktop and i can use internet connection sharing to do this,
but i get a range of 10.42.43.* i want it to have a range of 192.168.2.*
and than my router dd-wrt gives me 192.168.1.*

bartonski 11-26-2009 06:56 PM

1 Attachment(s)
Quote:

Originally Posted by R03L (Post 3766526)
i have a fileserver wireless connected whit my dd-wrt router.
and i have my dekstop pc besides that.
i cannot have my fileserver below becouse the people living here dont allow that, yes i need to move from a room to a house but enough of that..

i have a wireless connection to my fileserver
and want a wired connection to my desktop from the fileserver.

now i have connection sharing enabled on the fileserver and that works but i want to use dnsmasq to do it.

from fileserver one router wireless,
one desktop pc 1000mb wired. need an ip adress from dhcpserver.

dhcpd or dnsmasq but my m8 said i best can use dnsmasq to do this.

now you see i have dnsmasq running.
but i don't get any ip adress from this,

like i said i still have eth0 1000mb wired at dhcp client, asking for dhcp from my desktop and i can use internet connection sharing to do this,
but i get a range of 10.42.43.* i want it to have a range of 192.168.2.*
and than my router dd-wrt gives me 192.168.1.*

[Note that R03L and I had a short conversation off line, who sent me a picture of his network configuration, which I've rendered as the attached PDF].

http://e1h13.simplecdn.net/lqcdn/ima...attach/pdf.gif

So... here's how I'm reading this:

  • Internet connection on DD-WRT, with LAN interface at 192.169.1.1
  • Wireless connection between DD-WRT and Computer 2 (Fedora 12 router/File server). Computer 2 wireless connection at 192.168.1.100
  • 1000mb ethernet connection between Computer 2 and Computer 1 (Desktop Fedora 12).
  • Computer 2 currently does connection sharing, it serves a 10.42.43.* address via dhcp.
  • The desire is to have connection sharing between Computer 2 and Computer 1 with the ethernet interface on Computer 2 at 192.168.2.1, and ethernet interface on Computer 1 at 192.168.2.100.

The wlan connection on Computer 2 seems to be correct.

Undo any firewall/routing settings that you have set up for connection sharing on Computer 2.

Set eth0 on Computer 2 with a static IP address of 192.168.2.1

Your dnsmasq.conf looks ok (it's actually configured better than mine).

Once you've set the static IP address on eth0, release and renew your IP address on Computer 1. It should get an IP address of 192.168.2.100.

After you have done this, you can set up IP Masquerading (which is what internet connection sharing is called under Linux/Unix). Instructions can be found here.

R03L 11-27-2009 09:29 AM

yes thanks already for responding :)

bartonski 11-27-2009 01:10 PM

R03L,

Take another look at my previous post, I added a lot more to it; I think that I may have found a solution.

p.s. where does the nickname 'R03L' come from? It sounds a bit like R2-D2 or C-3PO :D

R03L 11-30-2009 04:37 AM

Quote:

Originally Posted by bartonski (Post 3771675)
R03L,

Take another look at my previous post, I added a lot more to it; I think that I may have found a solution.

p.s. where does the nickname 'R03L' come from? It sounds a bit like R2-D2 or C-3PO :D


No My name is actualy Roel it's dutch ( frysian ) name.

just added some numbers to it :P

but verry thanks for helping me out,, i see wats mistaken.

i read verry mutch tutorials and have the LPI book besides me.

but the part of setting a static ip adress was missing from most tutorials. so i think that is wat im doing wrong. i should work on it today :)

R03L 11-30-2009 04:56 AM

Quote:

Originally Posted by R03L (Post 3774177)
ch tutorials and have the LPI book besides me.

but the part of setting a static ip adress was missing from most tutorials. so i think that is wat im doing wrong. i should work on it today :)

yes im getting an ip adress :D :D

Code:

eth0
ip adress : 192.168.2.123
broadcast adress : 192.168.2.255
subnet mask : 255.255.255.0
defaulth route: 192.168.2.1
dns : 192.168.2.1

Thanks Again :D

so far so good :D

R03L 11-30-2009 05:48 AM

when i ping www.google.nl or 192.168.1.1 @ my fileserver i get.

Code:

ping www.google.nl ( ping 192.168.1.1 )
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

what could this be.?


i think its my routing/firewall that still is blocking my connection..

also when i am browzing to www.google.nl i get this pagefaulth
Connection to server Refused

R03L 11-30-2009 07:17 AM

ok i now get a ping at 192.168.1.1 ( DD-WRT )
but still
Code:

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


bartonski 11-30-2009 07:57 AM

Quote:

Originally Posted by R03L (Post 3774303)
ok i now get a ping at 192.168.1.1 ( DD-WRT )
but still
Code:

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


Let's see... DNS is working, must be through dnsmasq. If you can ping to 192.168.1.1, you know that at least part of the routing is working on your server box. The first thing I would do is run

Code:

traceroute www.google.nl
from 192.168.2.100. That will tell you whether the packets headed to www.google.nl are failing at the DD-WRT or before.

I would also try running /sbin/route on both your server and DD-WRT. Read the results from top to bottom, the first route that matches is the path that the packets take.

bartonski 11-30-2009 08:18 AM

By the way, if you absolutely totally have to know every packet going in and out of your DD-WRT, you can use pcap to capture packets. Installation of libpcap is detailed here, about half way down the page. I'm not 100% sure how to get the pcap file from the DD-WRT to your server, but once you do, you can open the file in Wireshark and figure out exactly what's going where.

I would do this only as a last resort, because it's going to take some serious reading to get this correctly installed and get a file back to your server, and then it can be a lot of work filtering through all of those packets, but you'll definitely know what's going on (also, only do this if you have isolated the problem to the DD-WRT).

R03L 11-30-2009 08:22 AM

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

on Desktop computer 1 i have a ping but half the time it also say destination host unreachable.
and no www.google.nl PAGE is coming up The requested URL could not be retrieved
maybe im on QOS.
becouse the house im living in a room at. also has a router outside the house my DD-WRT router is hooked to...

its 10.0.0.138 (DHCP)

i added some lines to DNSMASQ.
Code:

server=192.168.1.1 (DD-WRT)
server=194.109.6.66 (XS4ALL DNS server 1)
server=194.109.9.99 (XS4ALL DNS Server 2)
server=10.0.0.138 (DHCP / ROUTER whit at least 100 connections FIRM router)


R03L 11-30-2009 08:26 AM

DESKTOP PING
Code:

[roel@vlip ~]$ ping www.google.nl
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


bartonski 11-30-2009 08:47 AM

Quote:

Originally Posted by R03L (Post 3774373)
DESKTOP PING
Code:

[roel@vlip ~]$ ping www.google.nl
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


Yeah... there's something messed up here. When pinging from your server, packets should be headed through the wlan interface... you should be pinging from 192.168.1.100, not 192.168.2.1. This does suggest a routing error. I'm late for work (too much time spent answering questions on LQ ;)). I would definitely run /sbin/route on your server, and figure out what's going where. I'll be able to look at the results this evening (~8pm US Eastern Standard Time).

R03L 11-30-2009 10:25 AM

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

R03L 11-30-2009 02:59 PM

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



bartonski 11-30-2009 11:31 PM

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.

R03L 12-01-2009 03:47 AM

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.

bartonski 12-01-2009 10:21 PM

Quote:

Originally Posted by R03L (Post 3775452)
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.

bartonski 12-01-2009 10:56 PM

Quote:

Originally Posted by R03L (Post 3775452)
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 :D

Quote:

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


R03L 12-02-2009 04:39 AM

[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!!))

R03L 12-02-2009 06:35 AM

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.

bartonski 12-02-2009 07:37 AM

Quote:

Originally Posted by R03L (Post 3776978)
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?

R03L 12-02-2009 08:50 AM

here s the post
http://www.linuxquestions.org/questi...c-route-16769/

R03L 12-02-2009 10:06 AM

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

bartonski 12-02-2009 12:01 PM

Quote:

Originally Posted by R03L (Post 3777122)

Further on from the same thread:

Quote:

Originally Posted by jrwsod (Post 3564635)
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.

R03L 12-03-2009 04:46 AM

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.

bartonski 12-03-2009 10:05 PM

Quote:

Originally Posted by R03L (Post 3778168)
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.

R03L 12-04-2009 04:37 AM

/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

bartonski 12-04-2009 04:41 PM

Quote:

Originally Posted by R03L (Post 3779457)
/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

I don't think that it's created by network manager... I think that it's a Red Hat thing. I think that it goes the other way around: network manager reads this file when setting routes, which is why your routes keep on getting messed up.

I think that you can change route-eth0 as follows:

Code:


NETMASK0=255.255.255.0
ADDRESS0=192.168.2.1

You don't need a gateway, because you're not sending packets past the 192.168.2.0 network. I believe that ADDRESS0 should match the ip address on eth0.

The routing on wlan0 will take care of its self, because the route is set dynamically when the IP address is assigned via DHCP.

R03L 04-13-2013 08:57 AM

Quote:

Originally Posted by bartonski (Post 3771675)
R03L,

Take another look at my previous post, I added a lot more to it; I think that I may have found a solution.

p.s. where does the nickname 'R03L' come from? It sounds a bit like R2-D2 or C-3PO :D


Nah mijn name is roel :)


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