1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ip addr

Discussion in 'Tarifa Firmware' started by seb16, Sep 10, 2007.

  1. seb16

    seb16 LI Guru Member

    Hi!
    I would have 2 questions:
    Shortened one:
    ~ # ip addr add 192.168.1.2/24 dev vlan1
    -sh: ip: not found
    Is it possible to have such feature with Tarifa.

    Now full long question:
    I have been trying to have my routeur (WRT54GL) to work with tv decoder from my isp provider without using a switch but only my router.
    With the basic configuration the decoder would complain when linked to the lan (I guess it checks it is directly linked to the modem).
    That's why I am messing around with the firmwares and found Tarifa which looks more user friendly than openwrt that I tried.

    Anyway I have my router (192.168.2.1) that has wan linked with my modem (bridged with ip 192.168.1.1) and which connects through ppoe to my isp.
    I plugged my decoder to case 4 of the lan (which is port 0 on WRT54GL) and put this port into the same vlan containing the wan (port 4), by doing this:
    nvram set vlan1ports="0 4 5"
    and removing it from vlan0ports.
    And I have a pc connected to one of the lan available port (1 or 2 or 3) with IP 192.168.2.100
    Everything is working fine, the decoder works, I have access to inet from my pc (192.168.2.100)

    Now the tv decoder has a nice feature : mediacenter, which means you can share datas from your pc to the decoder. You run an http server on port 26180 from your pc and the decoder is supposed to get the link between the two (you can indicate ip address of your router from the decoder interface, so I put 192.168.2.1 there).
    I added 26180 to the Games/Apps ports, and I wanted to add a route to redirects 192.168.2.1:26180 traffic to my pc 192.168.2.100
    I wanted to assign an ip to the vlan1 by doing this :
    ip addr add 192.168.1.2/24 dev vlan1

    And then I could have done the redirect this way :
    iptables -I PREROUTING -t nat -d 192.168.1.2 -j DNAT --to-destination 192.168.2.100
    And then finally put 192.168.1.2 in the decoder interface (instead of 192.168.2.1 originally)

    The problem is that there is no ip command in Tarifa. Is there a way to configure that through the web interface ?

    Am I missing something ? Is there an easier way to proceed ?

    Thanks!
    Sebastien.
     
  2. mstombs

    mstombs Network Guru Member

    For

    ip addr add 192.168.1.2/24 dev vlan1

    try

    ifconfig vlan1:0 192.168.1.2 netmask 255.255.255.0

    which assigns a secondary IP address (alias) to the WAN port - just an alternative linux command that I know works with Hyperwrt Thibor and Tomato at least.

    use

    ifconfig

    and

    route

    to check the effect of this.
     
  3. seb16

    seb16 LI Guru Member

    Thank you mstombs,
    It indeed replaces the ip addr like charm!
    Sébastien.
     

Share This Page