Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
network settings at boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Beerke
n00b
n00b


Joined: 19 Apr 2003
Posts: 53

PostPosted: Sun Dec 28, 2003 5:15 pm    Post subject: network settings at boot Reply with quote

Hi i need a way to make the following settings permanent

i got and adsl modem which runs the sip_spoof hack which means that my network card in the pc has the external ip adress

my ip addresses are as follows
Code:

adsl modem 10.0.0.138
external ip 80.126.152.xxx
internal network ip 192.168.1.10


when i boot up it fails to start up my external network card, cause it can't find a destination
Code:
/etc/conf.d/net
iface_eth1="192.168.1.10 broadcast 192.168.1.255 netmask 255.255.255.0"
iface_eth0="80.126.152.xxx broadcast 255.255.255.255 netmask 255.255.255.255"
gateway="eth0/10.0.0.138"


When i do it manually it works

Code:
ifconfig eth0 80.126.152.xxx netmask 255.255.255.255 broadcast 255.255.255.255
route add 10.0.0.138 dev eth0
route add default gw 10.0.0.138


I got an example of how to do it in debian but don't know how to apply them in gentoo

Code:
auto eth0
   iface eth0 inet static
        address         80.126.152.xxx
        netmask         255.255.255.255
        pointopoint     10.0.0.138
        broadcast       255.255.255.255
        gateway         10.0.0.138

        up              /sbin/iptables -t nat -A POSTROUTING -o $IFACE -j SNAT --to $IF_ADDRESS
        down            /sbin/iptables -t nat -D POSTROUTING -o $IFACE -j SNAT --to $IF_ADDRESS
Back to top
View user's profile Send private message
HogRider
Apprentice
Apprentice


Joined: 29 May 2002
Posts: 160

PostPosted: Sun Dec 28, 2003 5:23 pm    Post subject: Re: network settings at boot Reply with quote

Let's see if we can walk through this...

Beerke wrote:

<snip>
my ip addresses are as follows
Code:

adsl modem 10.0.0.138
external ip 80.126.152.xxx
internal network ip 192.168.1.10


Notice the three ip addresses
Beerke wrote:

when i boot up it fails to start up my external network card, cause it can't find a destination
Code:
/etc/conf.d/net
iface_eth1="192.168.1.10 broadcast 192.168.1.255 netmask 255.255.255.0"
iface_eth0="80.126.152.xxx broadcast 255.255.255.255 netmask 255.255.255.255"
gateway="eth0/10.0.0.138"


What it's not finding is a route to your default gateway.

Beerke wrote:
When i do it manually it works

Code:
ifconfig eth0 80.126.152.xxx netmask 255.255.255.255 broadcast 255.255.255.255
route add 10.0.0.138 dev eth0
route add default gw 10.0.0.138


Notice you've added the route to your default gateway.

Now, the simple solution is to set eth0 to the 10.0.0.138 address. The 80.126.152.xxx address is the other end of a pppoe link (or so it appears), and your provider should take care of the routing. Alternitively, the 80.x add'y should be assigned to ppp0.

You've created a cludge in your manual config, which would probably work, but not properly.

Good luck.
_________________
Mike

"Computers are like air conditioners, they stop working properly if you open Windows"
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'


Last edited by HogRider on Mon Dec 29, 2003 12:02 am; edited 1 time in total
Back to top
View user's profile Send private message
Beerke
n00b
n00b


Joined: 19 Apr 2003
Posts: 53

PostPosted: Sun Dec 28, 2003 8:13 pm    Post subject: Reply with quote

Quote:
Now, the simple solution is to set eth0 to the 10.0.0.138 address. The 80.126.152.xxx address is the other end of a pptp link (or so it appears), and your provider should take care of the routing.


If i do this this would mean that i must do NAT on my ADSL modem as on my SERVER. My ADSL modem is fully transparant. Normally the modem would carry the external ip (80.126.152.xx) but with this setup the external network card on the server gets the external ip. So i am not looking for the easy way, cause i already know how to do that. There are some reasons why this hack is done on this modem, one of them is that i can use traceroute.

As i have read it is possile to set it automagically on debian, it should also be possile to do it under gentoo. Yet i don't know how to do it.
Back to top
View user's profile Send private message
HogRider
Apprentice
Apprentice


Joined: 29 May 2002
Posts: 160

PostPosted: Mon Dec 29, 2003 12:02 am    Post subject: Reply with quote

If you're not running the pppoe from this box (sounds like you're running it from the modem) Then add an alias to the interface.

In '/etc/conf.d/net', define:
alias_eth0=10.x.x.x.....

This should do what you're asking. I found it easier to configure my modem for passthrough, and run the pppoe direct from my server, YMMV.
_________________
Mike

"Computers are like air conditioners, they stop working properly if you open Windows"
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
Back to top
View user's profile Send private message
Beerke
n00b
n00b


Joined: 19 Apr 2003
Posts: 53

PostPosted: Mon Jan 05, 2004 7:07 pm    Post subject: Reply with quote

I tried doing the below but that doesn't seem to work

Quote:
In '/etc/conf.d/net', define:
alias_eth0=10.x.x.x.....


when i the try to ask my route it takes a long time before it brings up the routing table. It seems that is sending in a loop or something
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum