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.

I am connected to the internet via wlan0(wifi) and also have an ethernet port(not connected to the internet). I am looking for some iptables rule / route addition, which will let me do a ping via eth1 (ping -I eth1 www.google.com) successfully.

Here's my interface details:

saurabh@pc-saurabh:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:24:e8:e9:4b:bf brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 brd 10.0.0.255 scope global eth1
    inet6 fe80::224:e8ff:fee9:4bbf/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:24:d6:42:3d:5c brd ff:ff:ff:ff:ff:ff
    inet 192.168.11.6/24 brd 192.168.11.255 scope global wlan0
    inet6 fe80::224:d6ff:fe42:3d5c/64 scope link 
       valid_lft forever preferred_lft forever

Here's my routes:

saurabh@pc-saurabh:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.11.0    0.0.0.0         255.255.255.0   U     2      0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
0.0.0.0         192.168.11.1    0.0.0.0         UG    0      0        0 wlan0
share|improve this question
1  
How do you expect to ping an Internet site from an interface without Internet access? –  Michael Hampton Mar 27 at 1:42
    
I am looking for an iptable rule(or something else) , which will forward the packet to the other interface, so that the ping(ping -I eth1 www.google.com) works –  user3465593 Mar 27 at 1:47
    
This doesn't make any sense. Exactly what is the actual problem you are trying to solve? –  Michael Hampton Mar 27 at 1:58
    
I'm trying to create a reverse ssh tunnel to this system from my server, but unfortunately, all the sshd traffic is going to be denied on the wlan0 interface, because of which its not possible. I have another machine connected back to back on the eth1(that machine has ip address 10.0.0.2) and a masquarade rule set through which I can share internet, and reverse ssh tunnel works for that system. Thought that this problem can be solved if something similar is done for this system also. –  user3465593 Mar 27 at 2:30

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.