|
|
| Next: Bug#552976: net-snmp: FTBFS: mv: cannot stat `deb.. |
| Author |
Message |
Martin External

Since: Oct 29, 2009 Posts: 3
|
Posted: Thu Oct 29, 2009 12:29 am Post subject: iproute2 and ifupdown Archived from groups: comp>os>linux>networking (more info?) |
|
|
Hi,
I'm having trouble using ifupdown scripts on debian mixed up with ip
commands. The file /etc/network/interfaces looks as follows
iface eth0 inet static
address 192.168.100.1
network 192.168.100.0
netmask 255.255.255.0
broadcast 192.168.100.255
up ip addr add 172.17.0.1/16 dev eth0
up ip rule add from 192.168.100.0/16 dev eth0 table intern
up ip rule add from 172.17.0.0/16 dev eth0 table extern
up ip route add 192.168.100.0/24 dev eth0 table intern
up ip route add 192.168.200.0/24 via 192.168.100.253 table intern
up ip route add default via 192.168.100.254 table intern
up ip route add 172.17.0.0/16 dev eth0 table extern
up ip route add 192.168.10.0/24 via 172.17.2.1 table extern
up ip route add default via 172.17.254.254 table intern
pre-down ip route flush table intern
pre-down ip route flush table extern |
|
| Back to top |
|
 |
Martin External

Since: Oct 29, 2009 Posts: 3
|
Posted: Thu Oct 29, 2009 12:36 am Post subject: Re: iproute2 and ifupdown [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Sorry, I didn't finish my message.
iface eth0 inet static
address 192.168.100.1
network 192.168.100.0
netmask 255.255.255.0
broadcast 192.168.100.255
up ip addr add 172.17.0.1/16 dev eth0
up ip rule add from 192.168.100.0/16 dev eth0 table intern
up ip rule add from 172.17.0.0/16 dev eth0 table extern
up ip route add 192.168.100.0/24 dev eth0 table intern
up ip route add 192.168.200.0/24 via 192.168.100.253 table intern
up ip route add default via 192.168.100.254 table intern
up ip route add 172.17.0.0/16 dev eth0 table extern
up ip route add 192.168.10.0/24 via 172.17.2.1 table extern
up ip route add default via 172.17.254.254 table intern
pre-down ip route flush table intern
pre-down ip route flush table extern
pre-down ip rule del from 192.168.100.0/16 dev eth0
pre-down ip rule del from from 172.17.0.0/16 dev eth0
pre-down ip addr del 172.17.0.1/16 dev eth0
When I run
# /etc/init.d/networking stop
Deconfiguring network interfaces...done.
.... everything looks good so far, but the commands "ip addr show" and
also
"ifconfig" show me, that the interface is still configured.
# /etc/init.d/networking start
Configuring network interfaces...RTNETLINK answers: File exists
Failed to bring up eth0.
Should all the IP stuff be outsourced to it's own init script? Or may
I be able
to use the standard netconfig on debian systems?
Thanks for your hints,
Martin |
|
| Back to top |
|
 |
Martin External

Since: Oct 29, 2009 Posts: 3
|
Posted: Thu Oct 29, 2009 5:07 am Post subject: Re: iproute2 and ifupdown [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Hi Klaus,
On 29 Okt., 10:42, klaus zerwes <kzer....DeleteThis@web.de> wrote:
> append a ' || true' to every line regarding up, down, pre-*, ...
that would do the trick. Now I'll come down to the last row in my
interfaces file.
> let me guess: you did not bring the interface down before you edited
> /etc/network/interfaces
you guessed right. I edited the file to my needs and along with the
"|| true"
assignment after a reboot I may stop and restart the network as I
want.
> Of course you can write your own init-script, but I would try to do it
> the debian way.
Because it now works out well, I use the debian way. I'm just curious,
when
the ifupdown package is updated to the iproute2 tools to have a
homogeneous
network config in Debian.
Thanks for your hints,
Martin |
|
| Back to top |
|
 |
klaus zerwes External

Since: Oct 29, 2009 Posts: 1
|
Posted: Thu Oct 29, 2009 6:10 am Post subject: Re: iproute2 and ifupdown [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
Martin wrote:
> Sorry, I didn't finish my message.
>
> iface eth0 inet static
> address 192.168.100.1
> network 192.168.100.0
> netmask 255.255.255.0
> broadcast 192.168.100.255
>
> up ip addr add 172.17.0.1/16 dev eth0
[...]
> pre-down ip addr del 172.17.0.1/16 dev eth0
append a ' || true' to every line regarding up, down, pre-*, ...
>
> When I run
>
> # /etc/init.d/networking stop
> Deconfiguring network interfaces...done.
>
> ... everything looks good so far, but the commands "ip addr show" and
> also
> "ifconfig" show me, that the interface is still configured.
let me guess: you did not bring the interface down before you edited
/etc/network/interfaces
> # /etc/init.d/networking start
> Configuring network interfaces...RTNETLINK answers: File exists
> Failed to bring up eth0.
try a 'ifconfic eth0 down' and eventually clean up the routing table by
hand before you run 'ifup eth0'
> Should all the IP stuff be outsourced to it's own init script? Or may
> I be able
> to use the standard netconfig on debian systems?
you can use files in /etc/network/if-<$action>.d/ but I prefer setting
everything in interfaces.
Of course you can write your own init-script, but I would try to do it
the debian way.
>
> Thanks for your hints,
> Martin
Good luck
Klaus
--
Klaus Zerwes
http://www.zero-sys.net |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can 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
|
| |
|
|