0

I am running Ubuntu 13.10 on a laptop with one physical wired NIC (eth0) and one physical wireless NIC (wlan0. The current config is shown below (I removed lo interface since it is of no relevance)

casa@ubuntu:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 9c:8e:99:00:01:e5  
          inet addr:97.76.237.67  Bcast:97.76.237.79  Mask:255.255.255.240
          inet6 addr: fe80::9e8e:99ff:fe00:1e5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5837 errors:0 dropped:0 overruns:0 frame:0
          TX packets:384 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:772954 (772.9 KB)  TX bytes:51795 (51.7 KB)
          Interrupt:20 Memory:d4700000-d4720000 

wlan0     Link encap:Ethernet  HWaddr ac:81:12:8e:d4:8e  
          inet addr:192.168.1.19  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ae81:12ff:fe8e:d48e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14510 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8404 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2622226 (2.6 MB)  TX bytes:8724928 (8.7 MB)

eth0 is assigned a static address of 97.76.237.67 with network mask 255.255.255.240 with the gateway for this subnet at 97.76.237.65. wlan0 obtains address from DHCP server running at 192.168.1.1.

The current configuration of IP routing is shown below:

casa@ubuntu:~$ ip route
default via 97.76.237.65 dev eth0
97.76.237.64/28 dev eth0  proto kernel  scope link  src 97.76.237.67  metric 1 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.19  metric 9 

What I would like to achieve is to have all traffic into 97.76.237.0 subnet go through to 97.76.237.65 gateway through eht0 interface. All other traffic (Internet traffic) should go through 192.168.1.1 gateway across wlan0.

is there anybody who could kindly guide me through this process ?

Thank you in advance

Marek

  • Can you tell us the outcome of what you've done so far? – Xavier J Jan 18 '14 at 15:53
  • For example, I tried to add admin table to /etc/iproute2/rt_tables2 and then add routes into that table, but it does not seem to work too well: casa@ubuntu:~$ sudo ip route add 67.76.237.65/28 dev eth0 src 67.76.237.67 table admin RTNETLINK answers: Invalid argument I am not sure why it is like this, given that I followed syntax closely ... – user137708 Jan 18 '14 at 16:37
  • I try to follow the tutorial at kindlund.wordpress.com/2007/11/19/… but it does not seem to work on Ubuntu ... – user137708 Jan 18 '14 at 17:16
0

Delete the default route for eth0:

ip route delete default

Set up a new default route through wlan0:

ip route add default via 192.168.1.1 dev wlan0

Assuming your 97.76.237.0 subnet is a /24, add a new route:

ip route add 97.76.237.0/24 dev eth0 via 97.76.237.65 proto static
  • thank you i assume that if I need to add one more subject (97.76.238.0) accessible through the very same eth0 port, I can simple repeat the last statement with the proper changes in IP values. – user137708 Jan 19 '14 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.