Eine IPv4 in Gluon einrichten

ALERT! Ein gluon-reconfigure überschreibt alle unten gemachten Änderungen. ALERT!

In Gluon hat man standardmäßig keine IPv4-Addresse. Wenn man statisch eine IPv4 konfigurieren will, dann muss man auf Policy Routing zurückgreifen. Man kann das so einrichten:
HOST=10.99.240.123/16
GW=10.99.80.1

grep ffh /etc/iproute2/rt_tables > /dev/null || echo "240 ffh" >> /etc/iproute2/rt_tables

eval $(/bin/ipcalc.sh $HOST)

cat >> /etc/config/network <<EOF

config interface 'client_ip'
        option ifname 'br-client'
        option ipaddr '${HOST}'
        option proto 'static'

config route 'client_ip_route_ffh'
        option interface 'client_ip'
        option target '${NETWORK}'
        option netmask '${NETMASK}'
        option source '${IP}'
        option table 'ffh'

config route 'client_ip_route_default'
        option interface 'client_ip'
        option target '0.0.0.0/0'
        option gateway '${GW}'
        option source '${IP}'
        option table 'ffh'

config rule 'client_ip_rule'
        option src    '${IP}/32'
        option lookup 'ffh'
EOF

Impressum -- Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
This website is using cookies. More info. That's Fine