Two ethernet, same subnet, route to two different gateways

Hi there,

I was not writing here technical tricks for a long time,

Recently I have to deal with a strange network configuration:

Two (virtual) ethernet interfaces with ip addresses on the same subnet, but that have to route packets to two different gateways.

I’ve made a schema for better explaining this kind of configuration:

So the simple way to achieve this kind of scenario is using: iptables!

ip route flush table 4
ip route flush table 5
iptables -t nat -F

iptables -t mangle -F
iptables -F

ip route add table 4 default via

ip route add table 5 default via

iptables -t mangle -A OUTPUT -p udp -s —sport 5060 -j MARK —set-mark 4
iptables -t mangle -A OUTPUT -p udp -s —sport 5060 -j MARK —set-mark 5

ip rule add fwmark 4 table 4
ip rule add fwmark 5 table 5

ip route flush cache

First of all we flush any previous settings in the affected tables, then we add to table 4 and table 5 the different gateways. After that we use the mangle table of ipfilter framework that let us edit packets marking them with a custom marker. In detail, we’ll mark the packets coming from a specific interface’s address and from a specific port. By the way you could enlarge this rule as much as you want, removing the port number for example.

In this case for packets marking we used the same number of the associated table but this is not mandatory!

After that we add the rule for moving all the packets we’ll mark in their respective table. Thanks to this kind of rule we ensure that every marked packet will be forwarded to the respective gateway!

That’s all folks! Have fun! :)

Finally it’s here! WebRTC Blueprints! The book I reviewed! =)

Finally it’s here! WebRTC Blueprints! The book I reviewed! =)

Oracle Database 11g installation’s story

Today I’ve experimented installing Oracle Database 11g,

After unsuccessful installation on debian-based system because of wrong path, missing packages, etc. I’ve tried using Fedora 18, one of most compatible linux distro thanks its own derivation by RedHat Linux, certified working by Oracle.

I’ve installed it over a virtual machine (VBox based) through Fedora 18 XFCE edition thanks this how-to:

The process is very linear but not painless :-p I suggest you to follow the how-to as much as you can but trying avoiding the passes regarding “Packages Groups” suggested by the author.

The installation could stop sometimes because of missing deps or maybe for self errors, in any case push “Retry” button and don’t give up! :D

If you can’t get it working you can use the tricky way -> You can download a prebuilt image VirtualBox containing all you need for starting use Oracle Database 11g!

Please refer to this link for more info:

15 interesting and extremely helpful #Linux CLI tricks

Davvero interessante! :)

Epic Fail - Ubuntu piace ma per i driver c’è da soffrire

Epic Fail - Ubuntu piace ma per i driver c’è da soffrire

Spotify Infographic

Spotify Infographic

Any sufficiently advanced technology is indistinguishable from magic

Arthur C. Clarke - Ogni tanto mi torna in mente e la ricondivido..

Redirezionare voce e sms (2 SIM in 1)


Ho notato che l’argomento è molto cliccato su internet e per questo ho deciso di scrivere questo piccolo howto dato che molti operatori mobili hanno eliminato dal loro portafoglio offerte la possibilità di associare 2 numeri di telefono ad un’unica scheda SIM,

Tutto ciò che vi serve per redirezionare il traffico voce e sms da una scheda SIM all’altra è un cellulare Android (1.5+) oltre a quello in cui avete la prima SIM ovviamente (NB: SOLO il cellulare che dovrà redirezionare voce e sms dovrà essere Android non necessariamente entrambi!).

  • Redirezionare telefonate: Il processo è semplice basta recarsi in: Impostazioni -> (Impostazioni chiamate/Chiamata) -> (Trasferimento chiamate/Deviazioni) -> Sempre a questo punto inserite il numero dell’altra scheda SIM e avete completato la parte di procedura. (NB: in caso volessi resettare l’impostazione è sufficiente ripetere l’operazione lasciando vuoto il campo dove hai inserito il numero di telefono)
  • Redirezionare SMS: Il processo è anche in questo caso semplice ma necessita l’installazione di un’app esterna, io vi consiglio SMS Forwarding, la trovate sul PlayStore, la configurazione è davvero semplice e permette di configurare anche l’inoltre via mail degli SMS, notificare batteria quasi scarica etc, ecco l’URL per il download:

Inspired by Linux

Inspired by Linux

History of Nintendo 2012

1 of 7