Results 1 to 5 of 5

Thread: Please teach me about IP forwarding

  1. #1
    penguin_to_bits
    Guest

    Default Please teach me about IP forwarding

    I've tried asking about this on Usenet, and also I've read a few tutorials, but I'm finding it hard to get answers.

    Let's say I've two interfaces: eth0 and eth1.

    I want there to be a virtual router between eth0 and eth1. Packets arriving at eth0 should be forwarded to eth1, and vice versa. I'm not talking about NAT, or IP masquerading, but simply about forwarding packets.

    So lets say we do the following:
    ifconfig eth0 192.168.1.1 netmask 255.255.255.0
    ifconfig eth1 10.10.10.254 netmask 255.255.255.0

    What do I do next to ensure that when a packet arrives at eth0, that it will be forwarded on to eth1, and vice versa.

    Once I've got that down I'll move on to implementing NAT.

  2. #2
    Member wick86's Avatar
    Join Date
    Mar 2010
    Posts
    113

    Default

    Quote Originally Posted by penguin_to_bits View Post
    I've tried asking about this on Usenet, and also I've read a few tutorials, but I'm finding it hard to get answers.

    Let's say I've two interfaces: eth0 and eth1.

    I want there to be a virtual router between eth0 and eth1. Packets arriving at eth0 should be forwarded to eth1, and vice versa. I'm not talking about NAT, or IP masquerading, but simply about forwarding packets.

    So lets say we do the following:
    ifconfig eth0 192.168.1.1 netmask 255.255.255.0
    ifconfig eth1 10.10.10.254 netmask 255.255.255.0

    What do I do next to ensure that when a packet arrives at eth0, that it will be forwarded on to eth1, and vice versa.

    Once I've got that down I'll move on to implementing NAT.
    Not sure what your asking but this is possible through a router but not on a local machine

  3. #3
    Senior Member Thorn's Avatar
    Join Date
    Jan 2010
    Location
    The Green Dome
    Posts
    1,509

    Default

    Quote Originally Posted by wick86 View Post
    Not sure what your asking but this is possible through a router but not on a local machine
    Actually, it is possible on a local machine. This is how software routers/firewalls do it. Look up Smoothwall, for a good example.

    Quote Originally Posted by penguin_to_bits View Post
    I've tried asking about this on Usenet, and also I've read a few tutorials, but I'm finding it hard to get answers.

    Let's say I've two interfaces: eth0 and eth1.

    I want there to be a virtual router between eth0 and eth1. Packets arriving at eth0 should be forwarded to eth1, and vice versa. I'm not talking about NAT, or IP masquerading, but simply about forwarding packets.

    So lets say we do the following:
    ifconfig eth0 192.168.1.1 netmask 255.255.255.0
    ifconfig eth1 10.10.10.254 netmask 255.255.255.0

    What do I do next to ensure that when a packet arrives at eth0, that it will be forwarded on to eth1, and vice versa.

    Once I've got that down I'll move on to implementing NAT.
    The details elude me, but to implement this you need to have IP Forwarding via iptables (with forwarding rules) and /etc/sysconfig/network has to be set up correctly.

    This page may help:
    http://www.troubleshooters.com/linux/ip_fwd.htm

    If that doesn't give you enough info, putting "Linux IP forwarding eth0 eth1" into Google gives about 58,000 pages.
    Thorn
    Stop the TSA now! Boycott the airlines.

  4. #4

    Default

    you would use iptables for that. type "man iptables" at your command prompta dn read up on it, or check out http://iptables-tutorial.frozentux.n...-tutorial.html

    shouldnt this be in a help board? or the newberskate board? If you need help here you should put your posts into this board: http://forums.remote-exploit.org/forumdisplay.php?f=15


  5. #5
    Member
    Join Date
    Jan 2007
    Posts
    242

    Default

    For ip forwarding

    http://ipsysctl-tutorial.frozentux.n...tml/index.html

    To easily implement

    http://easyfwgen.morizot.net/gen/

    Go to the above link and create a script to do what you want it to do. When finished, read the script and you should be able to figure out what it's doing. It might even show you how to turn on ip forwarding. You may need to edit the resulting script to get rid of annoying error messages, depending on the way your system and kernel are configured, but it provides a good starting point. Backtrack puts iptables in /usr/sbin, for instance, but the script calls /sbin/iptables. Easily fixed. I just tried the single firewall with BT and after fixing the above error, it works fine.

    You'll then need to RTFM iptables, but you'll at least have an idea about what you are looking for. Read up on dnsmasq and you've got a router, with dhcp and name server, all on your local machine.

    http://www.google.com/search?q=linux+router+howto

    You can write a few simple scripts to automate it and easily have a router, a wireless access point, or a transparent bridge (think tap) with a simple command.

    Have Fun

Posting Permissions

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