You are not logged in.

#1 2013-10-14 22:37:45

walterdnes
New member
Registered: 2012-07-15
Posts: 5

Slightly complex networking setup.

I looked through the Funtoo Linux Networking page, but didn't find what I needed. First, I'll show what I'm doing in Gentoo, and I'd like to translate it into Funtoo. My desktop Gentoo /etc/conf.d/net

config_eth0="
192.168.123.250/29 broadcast 192.168.123.255 mtu 1454
169.254.1.2/16 broadcast 169.254.255.255"
routes_eth0="
default via 192.168.123.254 metric 20
192.168.123.248/29 via 192.168.123.254 metric 0
169.254.0.0/16 via 169.254.1.2 metric 0"

I have 2 IP addresses. 192.168.123.248/29 is my home LAN. I also have a networked TV tuner that comes up as some random address in the 169.254.0.0/16 range. Note the 3 routes...

high priority (metric 0) for my home LAN
high priority (metric 0) for the TV tuner
low priority (metric 20) default for everything else, i.e. my DSL connection to the internet.

What's not mentioned here, is that I also have emergency backup dialup service. Yeah, it's painfully slow, but I've used it a couple of times. I assume it comes up with metric 1 or so. The nice part about the Gentoo setup is that dialup can co-exist with eth0. I.e. I can dialup, while my LAN connection remains active, and my TV tuner is showing a TV program.

On my laptop (Funtoo) /etc/conf.d/netif.eth0 is...

template="interface"
ipaddr="192.168.123.253/29 169.254.1.5/16"
gateway="192.168.123.254"
nameservers="192.168.123.254"

My "dialup" script copies the dialup ISP's mailserver info to /etc/ssmtp/ssmtp.conf before connecting
#!/bin/bash
sudo /bin/cp -f /etc/ssmtp/295.ssmtp.conf /etc/ssmtp/ssmtp.conf
sudo /usr/sbin/pon 295.ca

My "dialdown" script restores my DSL ISP's mailserver info after disconnecting
#!/bin/bash
/usr/bin/sudo /usr/sbin/poff
/usr/bin/sudo /bin/cp -f /etc/ssmtp/teksavvy.ssmtp.conf /etc/ssmtp/ssmtp.conf

Years ago, before I figured out route and metric, I had the "dialup" script tear down eth0, and the "dialdown" script restore it. I can do that now if I have to.

But better still, is there a way to incorporate "metric" and multiple routes into Funtoo? I was thinking of a script in /etc/local.d/ with the appropriate ifconfig and route commands. But I believe that they're executed at the very end of the bootup sequence. Stuff like sshd may not start if it doesn't find eth0 ready and waiting.

Offline

Board footer

Powered by FluxBB