IPB

Welcome Guest ( Log In | Register | Lost Password? )

Gentoo - Connect to inode.at using PPPoE

HOWTO connect to inode.at (xdsl@home) using PPPoE on Gentoo Linux

Network Setup and Dialup

This guide assumes the following setup

 __________       _____________      ______________      __________
|          |     |             |    |              |    |          |
| internet |=====|    modem    |===(1) gentoo box (0)===| intranet |
|__________|     |_____________|    |______________|    |__________|

Interface 1: eth1, DHCP.
Interface 0: eth0, 192.168.1.1.

## preparing the network

emerge net-dialup/ppp

# create the init scripts for eth0
ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
rc-update add net.eth0 default

# backup old net.ppp0
mv /etc/init.d/net.ppp0 /etc/init.d/net_ORG.ppp0
# create the init scripts for ppp0
ln -s /etc/init.d/net.lo /etc/init.d/net.ppp0
rc-update add net.ppp0 default

# remove net.eth1 init script if it does exist
# this step is VERY important in order to avoid eth0 and eth1 gets swapped based on if the modem is turned on
# ( "null" will be eth0 not eth1 if modem is turned on )
#
# NOTE: link_ppp0="eth1" at /etc/conf.d/net will make eth1 obsolete. the interface will get UP|DOWN together with ppp0

rm /etc/init.d/net.eth1
rc-update del net.eth1

##  nano -w /etc/conf.d/net

config_eth0=( "192.168.1.1 netmask 255.255.255.0" )
config_eth1=( "null" )

config_ppp0=( "ppp" )
link_ppp0="eth1"
plugins_ppp0=( "pppoe" )
pppd_ppp0=( "defaultroute" "usepeerdns" "persist" )

username_ppp0='xdsl.123456@home'
password_ppp0='password'

Voila! You're done.

## Dialup
 
/etc/init.d/net.ppp0 start

## Hangup
 
/etc/init.d/net.ppp0 stop

If inode.at drops the connection it will redial and put ppp0 up automatically!

To force a redial:

## Get a new IP
 
/etc/init.d/net.ppp0 restart

Firewalling and Masquerading

## Install shorewall firewall
 
emerge net-firewall/shorewall
rc-update add shorewall default

## nano -w /etc/shorewall/shorewall.cfg
 
CLAMPMSS=Yes
STARTUP_ENABLED=Yes
IP_FORWARDING=On

## nano -w /etc/shorewall/interfaces
 
#ZONE   INTERFACE       BROADCAST       OPTIONS
net     ppp0            -
loc     eth0            detect          dhcp,tcpflags,detectnets,nosmurfs,routefilter
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
 
 
## nano -w /etc/shorewall/zones
 
#ZONE   TYPE    OPTIONS                 IN                      OUT
#                                       OPTIONS                 OPTIONS
fw      firewall
net     ipv4
loc     ipv4
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE
 
 
## nano -w /etc/shorewall/masq
 
#INTERFACE              SUBNET          ADDRESS         PROTO   PORT(S) IPSEC
ppp0                    eth0
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE

Then setup your policies and rules based on your needs.

nano -w /etc/shorewall/policy
nano -w /etc/shorewall/rules

Finally, start shorewall

## start shorewall
 
/etc/init.d/shorewall start

LAN DHCP/DNS Server

## Install dnsmasq
 
emerge net-dns/dnsmasq
rc-update add dnsmasq default

## nano -w /etc/dnsmasq.conf

domain-needed
bogus-priv
interface=eth0

dhcp-range=192.168.1.2,192.168.1.250,255.255.255.0,infinite
dhcp-host=00:11:22:33:44:55,fileserver,192.168.1.2,infinite

# subnet mask
dhcp-option=1,255.255.255.0

# default router
dhcp-option=3,192.168.1.1

# dns server
dhcp-option=6,192.168.1.1,192.168.1.1

# broadcast address
dhcp-option=28,192.168.1.255

## run dnsmasq
 
/etc/init.d/dnsmasq start

 
-  howto/gentoo_-_connect_to_inode.at_using_pppoe.txt · Last modified: 2008/10/03 07:07 (external edit)