Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Routing wired/wireless

  1. #1
    Join Date
    Mar 2010
    Location
    Pacific Northwest
    Beans
    82
    Distro
    Ubuntu

    Routing wired/wireless

    Hi, I've got a wireless network in my home and I have a PC downstairs with a wireless interface and a wired. The wireless works with the internet and the rest of the LAN and the wired is connected to a network printer via crossover cable. I can see the wireless from everywhere on the network but i can't see the printer IP or the wired IP. I can see the printer IP only from the local machine. this is my network setup on the machine in question:

    # The primary network interface
    iface wlan0 inet static
    address 192.168.0.50
    netmask 255.255.255.0
    broadcast 192.168.0.255
    network 192.168.0.0
    gateway 192.168.0.1

    # The secondary network interface
    iface eth0 inet static
    address 192.168.200.31
    netmask 255.255.255.0
    broadcast 192.168.200.255
    network 192.168.200.0
    gateway 192.168.0.50

    and the printer IP is:

    192.168.200.30

    I want this PC to route traffic to the printer from other PCs on the network because it's an LPD printer and I don't want to share it. I also don't want to have to run an ethernet cable all the way down my stairs to the printer.

    This command should return '1' right?:

    me@localhost:~$ cat /proc/sys/net/ipv4/ip_forward

    but it returns a zero. I'm not sure but i think that means im not routing. Anyone know what im doing wrong?
    0

  2. #2
    Join Date
    Mar 2010
    Location
    Freedom 3
    Beans
    379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Routing wired/wireless

    I wish I had done it and seeing it work before but I didn't, be warned. Anyway, in the machine that connects to the printer:

    1. add the following line to `/etc/sysctl.conf':

    net.ipv4.ip_forward=1

    You may have to restart the network or reboot; I don't remember right now. Also review your firewall rules to avoid any surprises.

    2. Add entries to the routing table with the `route' command (after you verify they work make them a startup script):

    route add 192.168.0.0
    route add 192.168.200.30

    If thins don't work as expected, have a look at http://tldp.org/LDP/nag2/x-087-2-iface.interface.html; it may be of help. Your syslog may also give hints of what is not working.
    To suppress free speech is a double wrong. It violates the rights of the hearer as well as those of the speaker.
    Free Software - Free Society | The GNU Project | FSF | ESP

  3. #3
    Join Date
    Mar 2010
    Location
    Pacific Northwest
    Beans
    82
    Distro
    Ubuntu

    Re: Routing wired/wireless

    OK so i had a bunch of issues but now im connected again. I had to disable NetworkManager and reconfigure my interfaces with the help of this page:

    https://help.ubuntu.com/community/WifiDocs/WiFiHowTo

    file as follows:

    # The loopback network interface
    auto lo wlan0 eth0
    iface lo inet loopback

    #wireless network interface
    iface wlan0 inet static
    wireless-essid wraith
    wireless- channel 6
    #wireless-mode managed
    address 192.168.0.50
    netmask 255.255.255.0
    broadcast 192.168.0.255
    network 192.168.0.0
    gateway 192.168.0.1

    #wired network interface
    iface eth0 inet static
    address 192.168.200.31
    netmask 255.255.255.0
    broadcast 192.168.200.255
    network 192.168.200.0

    1. add the following line to `/etc/sysctl.conf':

    net.ipv4.ip_forward=1

    You may have to restart the network or reboot; I don't remember right now. Also review your firewall rules to avoid any surprises.
    I changed this and the command still returned 0, but then I ran this command:

    sysctl -w net.ipv4.ip_forward=1

    and checked again and the output changed to 1. weird right?

    now when i try to use the route add command it returns:

    root@giger:/# route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1 dev eth0
    SIOCADDRT: No such process

    I also tried to add the route into the interfaces file as described here:

    http://www.ubuntugeek.com/howto-add-...in-ubuntu.html

    this also did not work unfortunately and sure it has something to do with "SIOCADDRT: No such process." Im having a hard time finding a lot of info on my particular situation with this error. any ideas?

    Also when I restart my network interface i get this:

    root@giger:/# /etc/init.d/networking restart
    * Reconfiguring network interfaces...
    RTNETLINK answers: No such process

    but all of the network functions just fine (aside of course from the routing)

    <===very informative btw
    Last edited by RyanRahl; April 6th, 2010 at 06:23 PM.

  4. #4
    Join Date
    Mar 2010
    Location
    Freedom 3
    Beans
    379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Routing wired/wireless

    I picked the following from searching in linux forums for `SIOCADDRT: No such process' (the bold inside the quote are mine):

    ...have the same problem -- basically, starting network during boot works fine but trying to restart network daemon (/etc/rc.d/network restart) results in an error like in the previous post. My workaround is to stop the network daemon, unload/reload the network card module and the start the network daemon again...
    The thread is here. There are also other opinions inside, that relate this issue with the code used inside the ifup / ifdown scripts. Since it is not an Ubuntu system, there may be differences, but it may worth to try tweaking their code (remember to make a backup of those, to recover easily if something really breaks).

    This thread also describes another tool to use. It may worth to try.
    To suppress free speech is a double wrong. It violates the rights of the hearer as well as those of the speaker.
    Free Software - Free Society | The GNU Project | FSF | ESP

  5. #5
    Join Date
    Mar 2010
    Location
    Freedom 3
    Beans
    379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Routing wired/wireless

    btw, the simple route commands I have posted did not worked?
    To suppress free speech is a double wrong. It violates the rights of the hearer as well as those of the speaker.
    Free Software - Free Society | The GNU Project | FSF | ESP

  6. #6
    Join Date
    Mar 2010
    Location
    Pacific Northwest
    Beans
    82
    Distro
    Ubuntu

    Re: Routing wired/wireless

    btw, the simple route commands I have posted did not worked?
    root@giger:/# route add 192.168.0.0
    SIOCADDRT: No such device
    root@giger:/# route add 192.168.200.30
    SIOCADDRT: No such device

    I'll check those threads thanks.

  7. #7
    Join Date
    Mar 2010
    Location
    Pacific Northwest
    Beans
    82
    Distro
    Ubuntu

    Re: Routing wired/wireless

    I fixed this:

    Quote Originally Posted by RyanRahl View Post
    root@giger:/# /etc/init.d/networking restart
    * Reconfiguring network interfaces...
    RTNETLINK answers: No such process
    temporarily by setting the wireless to dhcp and configuring my dhcp server to static assign 192.168.0.50 to wlan0 via MAC address. The part that gets me about this is that the ifconfig output stays the exact same whether i use static or dhcp addresses (aside of course from the RX/TX packets/bytes counters).

    Still trying to figure out why this is still happening:

    Quote Originally Posted by RyanRahl View Post
    root@giger:/# route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1 dev eth0
    SIOCADDRT: No such process
    Last edited by RyanRahl; April 6th, 2010 at 07:59 PM. Reason: added info

  8. #8
    Join Date
    Mar 2010
    Location
    Freedom 3
    Beans
    379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Routing wired/wireless

    I though a bit about it and I believe that the routing commands in your gateway should be the following:

    # make one route to printer,
    # one for the wlan network and
    # one (default) for everything else through the wlan's gateway.

    route add -host 192.168.200.30 dev eth0
    route add -net 192.168.0.0 netmask 255.255.255.0 dev wlan0
    route add default gw 192.168.0.1 dev wlan0

    To suppress free speech is a double wrong. It violates the rights of the hearer as well as those of the speaker.
    Free Software - Free Society | The GNU Project | FSF | ESP

  9. #9
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Routing wired/wireless

    Quote Originally Posted by RyanRahl View Post
    Still trying to figure out why this is still happening:
    Wonder if it's because the default route is already defined? This is the same error...
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  10. #10
    Join Date
    Mar 2010
    Location
    Pacific Northwest
    Beans
    82
    Distro
    Ubuntu

    Re: Routing wired/wireless

    Ok, so i kinda made some progress. I hooked up a laptop to the eth0 side of the network with a crossover and made it route out through the wireless by:

    adding these lines to /etc/iptables.up.rules

    Code:
    -A PREROUTING -i eth0 -j ACCEPT
    -A PREROUTING -j ACCEPT
    -A PREROUTING -m state -i wlan0 --state ESTABLISHED,RELATED -j ACCEPT
    and using eth0 as the gateway. Worked great really.
    So i basically tried the same thing but in the opposite direction:

    Code:
    -A PREROUTING -i wlan0 -j ACCEPT
    -A PREROUTING -j ACCEPT
    -A PREROUTING -m state -i eth0 --state ESTABLISHED,RELATED -j ACCEPT
    and used the wlan0 ip for the gateway on a wireless pc on the network and I cannot ping 192.168.200.30 pr 192.168.200.31

    I must be missing something

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •