Wednesday, August 10, 2011

How to set Openwrt Backfire for running as a routed client

first flash firmware

(my router is wzr-hp-g300h so go to
http://wiki.openwrt.org/toh/buffalo/wzr-hp-g300h

sudo arp -s 192.168.11.1 001122334455

sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0

telnet to the router and set root's password)

then follow
http://wiki.openwrt.org/doc/recipes/routedclient
only in "Using MASQUERADE" section

as a result my /etc/config/network:

config interface loopback                                                      
        option ifname   lo                                                     
        option proto    static                                                 
        option ipaddr   127.0.0.1                                              
        option netmask  255.0.0.0                                              
                                                                               
config interface lan                                                           
        option ifname   eth0                                                   
        option type     bridge                                                 
        option proto    static                                                 
        option ipaddr   192.168.2.1                                            
        option netmask  255.255.255.0                                          
        #option gateway  192.168.1.1                                           
        option dns      192.168.1.1                                            
                                                                               
config interface wan                                                           
        option proto    dhcp                                                   
                                                                               
config switch                                                                  
        option name     rtl8366s                                               
        option reset    1                                                      
        option enable_vlan 1                                                   
                                                                               
config switch_vlan                                                             
        option device   rtl8366s                                               
        option vlan     1                                                      
        option ports    "0 1 2 3 5"                                            

/etc/config/wireless:

config wifi-device  radio0
    option type     mac80211
    option channel  3
    option macaddr    00:11:22:33:44:55
    option hwmode    11g
    option htmode    HT20
    list ht_capab    SHORT-GI-40
    list ht_capab    DSSS_CCK-40

config wifi-iface
    option device   radio0
    option network  wan
    option mode     sta
    option ssid     Bank
    option encryption none


/etc/config/dhcp:

config 'dnsmasq'
    option 'domainneeded' '1'
    option 'boguspriv' '1'
    option 'filterwin2k' '0'
    option 'localise_queries' '1'
    option 'rebind_protection' '1'
    option 'rebind_localhost' '1'
    option 'local' '/lan/'
    option 'domain' 'lan'
    option 'expandhosts' '1'
    option 'nonegcache' '0'
    option 'authoritative' '1'
    option 'readethers' '1'
    option 'leasefile' '/tmp/dhcp.leases'
    option 'resolvfile' '/tmp/resolv.conf.auto'

config 'dhcp' 'lan'
    option 'interface' 'lan'
    option 'start' '100'
    option 'limit' '150'
    option 'leasetime' '12h'
    list 'dhcp_option' '3,192.168.2.1'
    list 'dhcp_option' '6,192.168.1.1'

config 'dhcp' 'wan'
    option 'interface' 'wan'
    option 'ignore' '1'

/etc/init.d/network restart
/etc/init.d/dnsmasq restart
or
reboot


root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 01:01:01:01:01:01
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11352 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12615 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1377475 (1.3 MiB)  TX bytes:12224421 (11.6 MiB)

eth0      Link encap:Ethernet  HWaddr 01:01:01:01:01:01
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11352 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12616 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1536403 (1.4 MiB)  TX bytes:12225464 (11.6 MiB)
          Interrupt:4

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:587 (587.0 B)  TX bytes:587 (587.0 B)

wlan0     Link encap:Ethernet  HWaddr 01:01:01:01:01:01
          inet addr:192.168.1.111  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16952 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11345 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13798355 (13.1 MiB)  TX bytes:1705910 (1.6 MiB)

root@OpenWrt:~#


thanks
- https://forum.openwrt.org/viewtopic.php?id=17316

No comments:

Post a Comment