Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Question on setting router or gateway
Results 1 to 6 of 6

Thread: Question on setting router or gateway

  1. #1

    Question on setting router or gateway

    I'm always confused by router and gateway. Are there any differences between these two?

    I've installed 2 network card on my computer in which I've installed Redhat 7.3. I want to config it as a gateway or router so that I can connect it to the internet using eth0 and connect it to a subnet (hubs) using eth1. Are there any specifications on IP address such as the IP address of the computers in the subnet and the IP address of the gateway eth1???

    Thanks in advance,
    William

  2. #2
    Guest

    Re:Question on setting router or gateway

    Eth0 will get is IP from DHCP (Im assuming your running cable or dsl), but your internel network card needs to be something like 192.168.x.x where the x = 0-255 , ie. 192.168.0.1 or 192.168.0.254. 192.168.0.0 and 192.168.0.255 are reserved IP addresses for your network address and broadcast address. A really good read on subnetting is in the PET section. Also the basic networking how-to at http://www.ibiblio.org/pub/Linux/docs/HOWTO/ will provide loads of info.

  3. #3
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Re:Question on setting router or gateway

    [quote author=wing328 link=board=4;threadid=3657;start=0#37096 date=1023467324]
    I'm always confused by router and gateway. Are there any differences between these two?
    [/quote]

    Technically yes. I forget the real differences, but in all practicality, most people I have run into havent the faintest clue that there actually is a difference. I am only a tad bit better -- a N+ cert and a forgotten memory of the specifics. :-X

    I've installed 2 network card on my computer in which I've installed Redhat 7.3. I want to config it as a gateway or router so that I can connect it to the internet using eth0 and connect it to a subnet (hubs) using eth1. Are there any specifications on IP address such as the IP address of the computers in the subnet and the IP address of the gateway eth1???
    Well, from here on I will call the WAN side NIC WAN and the LAN side NIC the LAN. For the WAN, set it to obtain an IP the exact same way that you normally would. If you need DHCP, set it that way. If you are using a static IP, use that. The same does NOT apply for the LAN. The LAN needs to know what the gateway is. A dynamic IP wont do good. So pick an IP that isnt't in a DHCP IP pool (if you happen to use DHCP server) and that will be the gateway for each PC. The DNS will be whatever your ISP told you to use. Aside from that, follow a tutorial on doing a Linux gateway and you should be fine and dandy. Do remember one thing -- you may need a recompile of the Linux kernel -- so if you are doing a fresh install, add the kernel source

    And good choice in distros ;D

  4. #4

    Re:Question on setting router or gateway

    Ok here is the skinny as I know it on gateways, and I'm not 100% sure on all of this either. The term gateway refers to so many different things that confusion always abounds.

    AFAIK, a gateway seperates two networks of dissimilar protocols (tcp/ip & ipx/spx, for instance) while a router seperates two networks or subnets of similar protocol (pure tcp/ip). This term for gateway specifically refers to some sort of hardware solution.

    A default gateway (which I believe the original post was referring to) is the ip address of the next hop router to which clients send all their traffic not destined for their local subnet. The defalt gateway then forwards traffic directly to the client, or to it's next hop router or gateway. This term for gateway refers to an address bound to an interface.

    There are also mail gateways, application gateways, etc, but of these I know little.

    For your purposes, eth1 will be the default gateway for all your LAN clients. It's address can be anything you want at all, so long as it adheres to a standard tcp/ip addressing scheme. I would follow mountain man's advice. But I would not bother with subnetting, as you probably do not need it and will just add unneeded complexity. eth0's default gateway will be the next hop router address of your ISP. This address will either be static or set by your ISP's DHCP server. Either way, the addres is something you get from them (automatically via DHCP or by them telling you).

  5. #5
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    Re:Question on setting router or gateway

    Just do it the easy way. Follow this tut.

    http://www.linuxnewbie.org/nhf/intel...znetshare.html


    use the gShield package which even has an experimental GUI interface for gShield.

    Basically install your 2 nics. Eth0 is your WAN/internet connection. Eth1 will be your LAN gateway. Just set it to be static 192.168.0.1

    unpack the gShield tarball

    rename the whole directory to 'firewall' then copy it to /etc/

    #>cp gShieldDir firewall
    #>cp -a firwall /etc/

    then edit /etc/firewall/gShield.conf to block/allow any services you are running. It's basically a questionaire.

    Make sure to look at the NATS/masquarade part. This will allow relay of your LAN's traffic thru the gateway.

    Then edit the /etc/firewall/conf/NATS file and add
    192.168.0

    this will allow your internal subnet(LAN) get thru your gateway.
    (you must edit the gShield.conf AND the NATS file to allow forwarding of traffic)

    then that should be it. It took me 20 minutes to set up the first time. when I fresh installed my box. I just copied my old gShield.conf file back into the install dir then edited the NATS file and it worked fine. Most of this is in the tutorial above

    then when all the configuration is done , run gShield.sh then check your iptables

    #>/sbin/./iptables -L

    All sorts of rules will show up.

    to start the script at start up place this line in
    /etc/rc.d/rc.local

    /etc/firewall/./gShield.sh

    that will restore your firewall at start up.

    ----
    Your clients should then use
    IP: 192.168.0.x
    subnet mask: 255.255.255.0
    gateway: 192.168.0.1 (your 2nd nic's ip)
    DNS: same as your internet connection's (eth0)


    HTH

  6. #6
    Senior Member
    Join Date
    May 2001
    Posts
    411

    Re:Question on setting router or gateway


Similar Threads

  1. setting up a Gateway
    By bdutta in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 08-05-2008, 03:44 AM
  2. Unorthodox Network Setup: Ubuntu Gateway, Wireless Router, PCs
    By MRod in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 12-20-2007, 09:08 AM
  3. Gateway before router
    By Lunke in forum Linux - Hardware, Networking & Security
    Replies: 4
    Last Post: 06-11-2004, 10:39 AM
  4. Setting up an old box as Gateway/Firewall
    By trickster in forum Linux - General Topics
    Replies: 10
    Last Post: 08-27-2002, 07:29 PM
  5. Setting up a gateway computer
    By binary_boy in forum Linux - Hardware, Networking & Security
    Replies: 6
    Last Post: 06-04-2002, 01:10 AM

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
  •