Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

router and server on one linux machine, need help.

2 views
Skip to first unread message

Tamer Higazi

unread,
Nov 8, 2009, 8:52:08 AM11/8/09
to
Hi people!
I am not a network pro, therefor I ask you gladly for help. I have a
gentoo box with 2 eth0 cards. I have red the gentoo home router guide at:

http://www.gentoo.org/doc/en/home-router-howto.xml?style=printable

but I need to use the machine as router as well as server itself.

I have 2 NIC in the machine (eth0,eth1). On the machine is asterisk and
apache installed. I want to use the machine a router and server as well.

the sip gateway connected at eth0 is configured as:
192.168.1.5 with it's gateway 192.168.1.1 and nothing goes along to
asterisk.

and through eth1 the dialup with pppoe goes there.

I guess, it's not possible to have on the same gateway address a service
running. Could you give me some good advise how to get the thing to run?!


# This network configuration was written by net-setup

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

username_ppp0="xxxx"
password_ppp0="xxxx"

config_eth1=("85.183.112.3 broadcast 85.255.255.255 netmask 255.0.0.0")
config_eth0=("192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0")

Tamer

David Schwartz

unread,
Nov 8, 2009, 9:55:57 AM11/8/09
to
On Nov 8, 5:52 am, Tamer Higazi <n...@mail.de> wrote:

> the sip gateway connected at eth0 is configured as:
> 192.168.1.5 with it's gateway 192.168.1.1 and nothing goes along to
> asterisk.

Is this supposed to be your description of the problem? That "nothing
goes along to asterisk"? Your message describes your setup a bit but
doesn't specify what you need help with or what the symptoms are of
your problem.

If you have basic connectivity issues, it helps a lot to tell us what
can ping what (and for a router, to/from which address). It also helps
to paste in interface configurations, router tables, and the like. It
also helps to mention which obviously stupid mistakes you've already
checked for (such as forgetting to turn IP forwarding on). (Otherwise,
10 people will reply "did you turn on iP forwarding?')

DS

Tamer Higazi

unread,
Nov 8, 2009, 1:07:18 PM11/8/09
to
Hi David!
It has nothing todo with asterisk. I want the machine to run as router
as well as server at once and I don't know how to set up the machine.

ipforwading is activated and I want the device at eth0 (192.168.1.1) can
access the service. what ipadress will I give the device (connected at
eth0), gateway and subnetmask to make use from the service configured
for the network segment 192.168.0.0 ?!


tux tamer # route -n
Destination Gateway Genmask Flags Metric Ref Use
Iface
213.191.64.102 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
85.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 213.191.64.102 0.0.0.0 UG 0 0 0 ppp0

ifconfig:
tux tamer # ifconfig
eth0 Link encap:Ethernet HWaddr 00:18:f3:c1:db:b5
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::218:f3ff:fec1:dbb5/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:398 (398.0 B)
Interrupt:27 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:40:95:31:65:ab
inet addr:85.183.112.3 Bcast:85.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::240:95ff:fe31:65ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:91436 errors:0 dropped:0 overruns:0 frame:0
TX packets:58048 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:122948770 (117.2 MiB) TX bytes:5652954 (5.3 MiB)
Interrupt:21 Base address:0x8c00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:258 errors:0 dropped:0 overruns:0 frame:0
TX packets:258 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:214961 (209.9 KiB) TX bytes:214961 (209.9 KiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:85.183.112.3 P-t-P:213.191.64.102 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:91188 errors:0 dropped:0 overruns:0 frame:0
TX packets:57665 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:120927688 (115.3 MiB) TX bytes:4361162 (4.1 MiB)


David Schwartz schrieb:

Pascal Hambourg

unread,
Nov 8, 2009, 1:51:02 PM11/8/09
to
Hello,

Tamer Higazi a ᅵcrit :


> It has nothing todo with asterisk. I want the machine to run as router
> as well as server at once and I don't know how to set up the machine.

1) Do the router settings as usual.
2) Do the server settings as usual.
They don't interfere.

> eth0 Link encap:Ethernet HWaddr 00:18:f3:c1:db:b5
> inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
> inet6 addr: fe80::218:f3ff:fec1:dbb5/64 Scope:Link
> UP BROADCAST MULTICAST MTU:1500 Metric:1
> RX packets:0 errors:0 dropped:0 overruns:0 frame:0

Hmm, looks like eth0 is UP but not RUNNING. And it received no packet,
which would be quite surprising on a LAN with other active hosts if the
interface was running fine. Is the ethernet link ok ?

> eth1 Link encap:Ethernet HWaddr 00:40:95:31:65:ab
> inet addr:85.183.112.3 Bcast:85.255.255.255 Mask:255.0.0.0

Where does this address comes from ? There is no such 85.0.0.0/8
network, this block is split in multiple networks, and by using this
address and mask you prevent yourself from communicating with them. An
IP address is not necessary for an ethernet interface transporting only
PPPoE.

David Schwartz

unread,
Nov 8, 2009, 2:49:29 PM11/8/09
to
On Nov 8, 10:07 am, Tamer Higazi <n...@mail.de> wrote:

> It has nothing todo with asterisk. I want the machine to run as router
> as well as server at once and I don't know how to set up the machine.

There should be nothing special you need to do.

> ipforwading is activated and I want the device at eth0 (192.168.1.1) can
> access the service. what ipadress will I give the device (connected at
> eth0), gateway and subnetmask to make use from the service configured
> for the network segment 192.168.0.0 ?!

You can give at any address inside 192.168.1.0/24 except 192.168.1.1.
It doesn't need a gateway if it's only going to access devices on the
LAN. The subnet size should match the router's.

If you want the other machines in 192.168.1.0/24 to be able to access
the Internet, you'll need to set up NAT on your router. In that case,
192.168.1.1 should be their default route (gateway).

> eth1      Link encap:Ethernet  HWaddr 00:40:95:31:65:ab
>           inet addr:85.183.112.3  Bcast:85.255.255.255  Mask:255.0.0.0

That doesn't seem to make much sense.

DS

Bill Marcum

unread,
Nov 8, 2009, 7:20:27 PM11/8/09
to
On 2009-11-08, Tamer Higazi <n...@mail.de> wrote:
>
> eth1 Link encap:Ethernet HWaddr 00:40:95:31:65:ab
> inet addr:85.183.112.3 Bcast:85.255.255.255 Mask:255.0.0.0
> inet6 addr: fe80::240:95ff:fe31:65ab/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:91436 errors:0 dropped:0 overruns:0 frame:0
> TX packets:58048 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:122948770 (117.2 MiB) TX bytes:5652954 (5.3 MiB)
> Interrupt:21 Base address:0x8c00
>
> ppp0 Link encap:Point-to-Point Protocol
> inet addr:85.183.112.3 P-t-P:213.191.64.102 Mask:255.255.255.255
> UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
> RX packets:91188 errors:0 dropped:0 overruns:0 frame:0
> TX packets:57665 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:3
> RX bytes:120927688 (115.3 MiB) TX bytes:4361162 (4.1 MiB)
>
You have eth1 and ppp0 on the same ip address. If ppp0 is ppp-over-ethernet
on the eth1 interface, eth1 doesn't need to have an ip address.
I have this in /etc/network/interfaces on my router:

auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet static
address 0.0.0.0

auto dsl-provider
iface dsl-provider inet ppp
provider dsl-provider
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf

auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.224

(Debian and Ubuntu use /etc/network/interfaces. Other distros may use
different configuration files.)

Tamer Higazi

unread,
Nov 11, 2009, 2:12:17 PM11/11/09
to
dear Bill!
I gladly love to thank you. The idea of cancelling the ethenets
interface's IP-Adress where the PPPoE Modem is connected to, solved all
my probelms at all.


I wish you a great day!


Tamer Higazi

Bill Marcum schrieb:

0 new messages