Hi,
Anyone could help me, please?
I've got a OpenWrt system with only one physical interface.
I would need to generate up to 8 virtual interfaces to appear as different machines on the network.
If possible, I would like to get dhcp addresses from the router for the 8 interfaces.
I've tried a lot of different configurations of /etc/config/network, but I didn't manage to get anything that works.
For example, with:
/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 ipv6 '0'
option igmp_snooping '0'
option multicast_querier '0'
option proto 'static'
option ipaddr '192.168.1.91'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
option dns '8.8.8.8'
option macaddr 'D4:91:AF:60:00:01'
config interface 'lan2'
option ipv6 '0'
option ifname 'eth0.2'
option ipaddr '192.168.1.92'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
option dns '8.8.8.8'
option proto 'static'
option macaddr 'D4:91:AF:60:00:02'
config interface 'lan3'
option ipv6 '0'
option ifname 'eth0.3'
option ipaddr '192.168.1.93'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
option dns '8.8.8.8'
option proto 'static'
option macaddr 'D4:91:AF:60:00:03'
config globals 'globals'
option ula_prefix 'fd56:3b56:d85c::/48'
we get in ifconfig:
eth0 Link encap:Ethernet HWaddr D4:91:AF:60:00:01
inet addr:192.168.1.91 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2649 errors:0 dropped:0 overruns:0 frame:0
TX packets:186 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1742277 (1.6 MiB) TX bytes:45114 (44.0 KiB)
Interrupt:36
eth0.2 Link encap:Ethernet HWaddr D4:91:AF:60:00:02
inet addr:192.168.1.92 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3951 (3.8 KiB)
eth0.3 Link encap:Ethernet HWaddr D4:91:AF:60:00:03
inet addr:192.168.1.93 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:7311 (7.1 KiB)
But from other computer doing ping, only 192.168.1.91 interface is available on the network.