Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am setting up an internal subnet on the second ethernet adapter of my server. The intent is to eventually route all that subnet's traffic though a tunnel.
However, I can't seen to get past the ethernet device.
(enp8s0=internal subnet eno1=subnet connected to wan)
Example:
Code:
$ ping -I enp8s0 192.168.190.20
PING 192.168.190.20 (192.168.190.20) from 192.168.192.1 enp8s0: 56(84) bytes of data.
--- 192.168.190.20 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 66ms
ip route:
Code:
default via 192.168.190.1 dev eno1 onlink
192.168.190.0/24 dev eno1 proto kernel scope link src 192.168.190.20
192.168.192.0/24 dev enp8s0 proto kernel scope link src 192.168.192.1
I also modified the iptables using:
Code:
$ sudo iptables -t nat -A POSTROUTING -j MASQUERADE
$ sudo iptables -A FORWARD -i enp8s0 -o eno1 -j ACCEPT
In this case only one interface (en01) can reach the target address. No routing is required, since the server is directly connected to the subnet belonging to the IP address of interest.
@ferrari I though the "-I" flag meant ping from a specific device.
No, it means interface. From 'man ping'...
Quote:
-I interface
interface is either an address, or an interface name. If interface is an address, it sets source address to specified interface address. If interface in an interface name, it sets source
interface to specified interface. For IPv6, when doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) is required.
It really only has relevance if there are two or more routes to a given IP address from a given device (usually a router). The source address will be that of the interface the packet is being sent from.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.