Gentoo Archives: gentoo-server

From: LMA1980 <lma1980@×××××.com>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] gentoo router and server on one machine, need help.
Date: Sun, 08 Nov 2009 15:34:04
Message-Id: FC1CC503-1BB9-46B9-819F-1E19612D55AC@gmail.com
In Reply to: [gentoo-server] gentoo router and server on one machine, need help. by Tamer Higazi
1 Hi,
2 I don't really get the question but I'll try to help you out with logic.
3
4 Never did I install asterisk but I did build a test case with apache
5 and a router on the same box.
6
7 First you shall ask what you want to see on eth0 and eth1. On my test
8 case I wanted to see all port of apache on eth1 (lan) and only port80
9 on eth0 (wan).
10
11 I manage to route all network between lan & wan with simple routing
12 rules but I did had to build a special case where I wanted to NAT eth0
13 port80 request to my loopback (lo) where my local apache is listening.
14 I also NATed eth1 to the lo when explicitly requesting answer from
15 eth1's IP (more then 1 IP is handy when using chroot or other special
16 security need).
17
18 I guess you'll have to setup proper listening port to asterisk before.
19
20 Additionally a little bit of reading (more then some howto) could be
21 good as securing a router and a server on a same machine is a serious
22 task (note that it still a not so hard one) that request a good plan.
23 I had to rethink mine twice before getting the good setup. Test
24 machine died in a power outage since and didn't got time to build it
25 back so I can't supply exemple script.
26
27 Hope it did help you out.
28
29 LMA1980
30
31 Le 09-11-08 à 09:56, Tamer Higazi a écrit :
32
33 > Hi people!
34 > I am not a network pro, therefor I ask you gladly for help. I have a
35 > gentoo box with 2 eth0 cards. I have red the gentoo home router
36 > guide at:
37 >
38 > http://www.gentoo.org/doc/en/home-router-howto.xml?style=printable
39 >
40 > but I need to use the machine as router as well as server itself.
41 >
42 > I have 2 NIC in the machine (eth0,eth1). On the machine is asterisk
43 > and
44 > apache installed. I want to use the machine a router and server as
45 > well.
46 >
47 > the sip gateway connected at eth0 is configured as:
48 > 192.168.1.5 with it's gateway 192.168.1.1 and nothing goes along to
49 > asterisk.
50 >
51 > I guess, it's not possible to have on the same gateway address a
52 > service
53 > running. Could you give me some good advise how to get the thing to
54 > run?!
55 >
56 >
57 > # This network configuration was written by net-setup
58 >
59 > config_ppp0=("ppp")
60 > link_ppp0="eth1"
61 > plugins_ppp0=("pppoe")
62 > pppd_ppp0=(
63 > "defaultroute"
64 > "usepeerdns"
65 > )
66 >
67 > username_ppp0="xxxx"
68 > password_ppp0="xxxx"
69 >
70 > config_eth1=("85.183.112.3 broadcast 85.255.255.255 netmask
71 > 255.0.0.0")
72 > config_eth0=("192.168.1.1 broadcast 192.168.1.255 netmask
73 > 255.255.255.0")
74 >
75 > Tamer
76 >