Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
The HuaweiE303 3G has an internal nameserver and gateway that defaults 
to 192.168.1.1. If it happens to be on the same subnet as your hardware 
configured ethx, the cdc-ether device appear by NO gateway.
If you force the 3G to eth0 with udev, the system is all ok, and the 
cdc_ether device is assigned to eth0, the hardware address to eth1, the gateway,>/br> nameserver at 192.168.1.1 is available, and you can access the www via the gateway,  however the hardware eth1 on the same network is null and void. 
If you change the hardware eth1 to any other subnet it works. 
The only problem is that the rest of my 'world' is on the same subnet, and changing 
that would be an enoumouse task. The E303 does have a webpage at 192.168.1.1 
but does not allow a different address, so you are stuck with it.

I tried the solution : 
http://serverfault.com/questions/336021/two-network-interfaces-and-two-ip-addresses-on-the-same-subnet-in-linux
// added two tables
1. /etc/iproute2/rt_tables:
    add end of file
   1    eth0
   2    eth1
2. Created a script.sh 
//----------------

#!/bin/sh
sysctl -w net.ipv4.conf.all.arp_filter=1
echo "net.ipv4.conf.all.arp_filter = 1" >> /etc/sysctl.conf

gate_way="192.168.1.1"
subnet="192.168.1.0/24"
eth0_adr="192.168.1.100"
eth1_adr="192.168.1.101"
ip route add default via $gate_way table eth0
ip route add default via $gate_way table eth1
ip route add $subnet dev eth0 src $eth0_adr table eth0
ip route add $subnet dev eth1 src $eth1_adr table eth1

#Define the rules for when to use the new routing tables:

ip rule add from $eth0_adr table eth0
ip rule add from $eth1_adr table eth1
//---------------

#ip route show >
default via 192.168.1.1 dev eth0  metric 1 
127.0.0.0/8 dev lo  scope link 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.101 
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.100 
//------------------------
#route -n >
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    1      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
//-------------------------
ifconfig -a
eth0      Link encap:Ethernet  HWaddr 58:2c:80:13:92:63  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::5a2c:80ff:fe13:9263/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:468 (468.0 B)

eth1      Link encap:Ethernet  HWaddr 08:00:27:eb:35:fd  
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:feeb:35fd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:509 (509.0 B)  TX bytes:468 (468.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

What is amasing is when the 3G is removed then eth1 can access the network.
// ----------------------
System EBox3300 Vortex86DX, Slackware with special kernel build3.3.1


What I am missing?
share|improve this question
    
Why did you put EVERYTHING in a <pre> tag? This makes it much harder to destinguish between your text and source and output –  Christopher Perrin Oct 7 '12 at 23:21
    
Please edit ur question, to make it more readable. –  Marko Oct 14 '12 at 11:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.