[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Setting up a home gateway/router



On Thu, May 22, 2014 at 9:57 PM,  <csanyipal@gmail.com> wrote:
> Hi,
>
> I wish to set up my home headless power pc box as a gateway/router ( GW ).
> I can connect to it with SSH only.
>
> Before, I set up this GW to get an IP address from my ISP with
> dhcp.client.
>
> Now, I ask a static IP address for this GW and don't know how to setup
> eth0 interface so I can connect to Internet from this GW and to forward
> Internet connection to my LAN.
>
Do you mean that eth0 on GW has a static IP address? If so, you
probably have to modify /etc/network/interfaces for eth0, e.g.

iface eth0 inet static
    address 192.168.0.1
    netmask 255.255.255.0

# If you have IPv6
iface eth0 inet6 static
    address ::1
    netmask 64

Change the IP address / netmask to your own.

> My ISP
>   |
>   --- eth0 ( GW ) --- eth1
>                         |
>                         LAN
>
> This is my home network that I want to set up.
>
> The state of this setup so far is that that I can SSH into GW only, but
> can't reach the Internet, and from LAN I can't reach Internet too.
>
> Can I get advices how to setup my home network?
>
You have to allow forwarding from your LAN to the outside internet. In
/etc/sysctl.conf, enable

net.ipv4.ip_forward=1
# If you have IPv6
net.ipv6.conf.all.forwarding=1

There may be other options in /etc/sysctl.conf that you'd want to
change. Read the associated comments and manpages.

If you are setting up a gateway, you might want to look into the
firewall iptables/ip6tables. The standard procedure is to drop all
packets, allowing only specific ones to pass through.

Regards,

Vincent Chen


Reply to: