OpenWrt Forum Archive

Topic: Different IPs on Lan und Wlan

The content of this topic has been archived on 13 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello.

i want to set up my Kamikaze 7.09 Box (Wl500-gp) with different Ips on Wlan and Lan:


192.168.0.1 | LAN
                  |
           +-----------+
           | Openwrt   | 192.168.1.1
           |                |----------
           +------------+     Wlan
                  |
                  | WAN (PPPoe)
                  |
                  | 192.168.2.1
            +-----------+
             | DSL        |
             | Modem   |
             +-----------|
I haven't found a HowTo for this Setup sad
How do i configure this Second IP (192.168.1.1)?

Second Question:
I have to set via ifconfig the IP 192.168.2.2 on the eth0.1 Interface to connect to the WebInterface of my DSL Modem. Can i configure this too, so this IP will be set after boot?

Thanks for your help

(Last edited by olqs on 1 Dec 2007, 17:26)

The files that you need to edit are found in /etc/config.

First you will need to to add a new interface for you wifi interface and remove the bridge. To do this make the following changes to the network config file.

1) Add add a new config section for the wifi interface, something like this.

config interface wifi
    option ifname "wl0"
    option proto static
    option ipaddr 192.168.1.1
    option netmask xxx.xxx.xxx.xxx  (use your correct netmask here)

2) change the wan interface from dhcp to static. wan interface should look something like

config interface wan
   option ifname "eth0.1"
   option proto static
   option ipaddr 192.168.2.2
   option netmask xxx.xxx.xxx.xxx (use your correct netmask here)


3) In the "config interface lan" section remove the "option type bridge" line this will remove the bridge interface. Ensure that the lan interface has the ip address 192.168.0.1 and correct netmask


Next you want to modify the wireless config file.
4) make sure that the "option device" and "option network" point to the new wifi interface that you created.
They should look something like

   option device  wl0
   option network  wifi


reboot and you should be left with 5 interfaces
eth0.0  on 192.168.1.1
eth1.1 on 192.168.2.2
wl0 on 192.168.1.1
lo on 127.0.0.1
and eth0 with no ipaddress


Darren

Sorry that i haven't replied earlier. I'm very pressed at work at the moment.
Thanks you helped me a lot.

But the config for my wan connection isn't working. Perhaps i wasn't clear enough smile

I connect to the internet via pppoe, so i have configured "option proto pppoe" in the interface wan section.
But my DSL Modem have a WebInterface and i need to set additionally a static IP on the eth0.1 Interface to connect to this WebInterface from a client.
At present i set this ip 192.168.2.2 with: ifconfig eth0.1 192.168.2.2
My question is: Can i set this IP automatically, because i have to set it manually every time i restart rp-pppoe. I think rp-pppoe clears all IP-Information on the eth0.1 after start.

The discussion might have continued from here.