linux interface based routing with two interfaces [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
i have 2 interfaces on linux instance. both have static IPs . i have traffic from outside world coming to eth0(208.67.x.x) and inside my server i want the traffic to be redirected to eth1(192.168.X.x) to talk to any application inside.
Please help me on the route configs ..and can I do that on linux instance?

You can use a simple package called Firestarter. Firestarter internally edits iptables which are the actual rules to forward packets from source to destinations inside the linux kernel. Please follow the following guidelines to solve your problem. Note that I have given command line examples below but there is also a gui to help you with the setup.
Install firestarter on ubuntu using the command in the shell
sudo apt-get install firestarter
Define the external and internal interfaces in the /etc/firestarter/configuration file at appropriate places.
Select dhcp server on/off if you wish to run dhcp server on internal network interface.
You can also define rules for inbound and outbound traffic as firestarter is also a firewall. The rules can be defined in /etc/firestarter/inbound and /etc/firestarter/outbound folders.
For more information on iptables and firestarter visit :
https://help.ubuntu.com/community/IptablesHowTo
Hope this helps you with your problem. Thanks!

Related

iptables / forward request to specific IP to wifi network [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
Improve this question
I'm struggling with the Linux tool "iptables".
Following situation:
I have a RaspberryPi running with HASS (Home Assistant) connected via ethernet.
Now I want to add my inverter to home assistant, but this needs to be done by using his own WiFi network. So I need to forward requests to IP 11.11.11.1 (only this IP, not all trafic) to the wifi network.
Is that doable with iptables? Meaning defining a rule which says "target is 11.11.11.1, so lets put this to the wifi network".
I'm actually not sure whether iptables can do that or not. I read soming about nginx, but not sure how this would work.
iptables -A FORWARD -i eth0 -o wlan0 -p tcp --destination 11.11.11.1
That command did the trick. Now all TCP requests to 11.11.11.1 are forwarded to Wifi (wlan0) interface.
If someone sees any mistakes in that, please reply as I'm not really familiar with networks settings and Linux commands. Thx.

Connecting WinSCP with Ubuntu on VirtualBox [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm trying to connect Winscp with virtual machine. I'm working on Windows,and this problem is killing me for 5 hours. Studied a lot of examples, but I can't find out what is the problem. I tried to connect with putty to, but connection is every time refused. Tried to connect with every protocol, but didn't help. I even can't install ssh into Ubuntu, because something is blocking but not firewall(failed to fetch us archive ubuntu com). Port forwarding too wasn't very helpful.
1st Adapter is NAT, and second host-only.
Problem is that I need to enter home directory, and add some files, so I'm trying to find the easiest way to do this.
I would really appreciate any help. Here is my ifconfig, ip a, and interfaces picture.
1
Thanks!
Use the following step to configure.
1- Run ipconfig /all on your windows machine and see which ip are assigned to your virtual adopters.
2- Assign the same range ip to your virtual machine. For example:
If on virtual adopter ip is: 192.168.130.1
Then assign ip to your vm as: 192.168.130.*
and set gateway to : 192.168.130.1
and restart the service network and check the reachability by pinging from both side.
3- If You able to ping then you will be able to use internate on your VM. Then install the ssh.
Now you will be able to use.

Raspberry Pi 2: routing table has no the specified gateway [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have this routing table:
I used SSH to be able to use my Raspberry Pi on my laptop screen. Everything was fine until I opened my browser and wanted to ping Google in the terminal. I can't, though.
When I try to ping 8.8.8.8 (Google's nameserver), I get the message below the routing table in the image above. But the strange thing is, when I run SSH with PuTTY on a different laptop, the Internet connection is fine. So probably the problem is on my laptop.
How can I fix this issue?
Seems like you are using 192.168.1.1 as a gateway, yet you have configured 192.168.137.0/24 as the network.
You should either try to configure the default gateway to - perhaps - 192.168.137.1 or your IP address to 192.168.1.x.
An ifconfig output would be handy.
Edit:
Add default gateway:
route add default gw 192.168.137.1
You might also need to remove current default gateway(s).

Ifconfig doesn't provide any Details on Kali Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Folks,
I have Kali linux running on VM machine..there are 2 interfaces configured on this machine..1 interface is configured as "share with my Mac" and the other interface is configured as "Private to Mac".And i believe "private to Mac" option will allow me to connect my VM linux machine to the local machine.... ifconfig command doesn't show any output. i have manually configured the IP address to both interface by editing vi /etc/network/interfaces and restarted the network services using the command "/etc/init.d/networking restart"...but still ifconfig doesn't give any result....
Actually i want to communicate on port ssh from my local machine to the linux vm machine..since the machines do not communicate each other.i am not able to work anymore..Can someone please have a look in this issue and let me know what changes are required to complete my requirement...
Have you tried sudo ifconfig ? If it doesn't work the problem could be the drivers of your network card. I'm not sure this will works but you can watch this tutorial How to install network card to Kali

Where to configure network options [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
With most Linux/Unix you have the ability to configure, for example, DNS servers in 2 places. You can set it on the network interface configuration or you can set it in the traditional resolv.conf.
Staying with DNS, most distros recommend configuring it via the interface configuration script which is different among distros. Like Ubuntu uses /etc/network/interfaces and RHEL uses /etc/sysconfig/network-scripts/.
Why is this the recommended location when resolv.conf would be much more universal?
Also I find it troubling placing anything other than Ethernet and IP options (layer 2 & layer 3 options) in the interface configuration. Everything else ( like DNS, Hostname, NTP, ...) belongs in its own /etc location in my opinion.
But this has sparked a debate among my colleagues and I would like more answers.
Debian has some explanations here: https://wiki.debian.org/NetworkConfiguration section "Defining the (DNS) Nameservers".
Basically, the /etc/resolv.conf should not be used in modern Desktop Linux distributives because several programs may overwrite it, if installed and active: resolvconf, network-manager and dhcp clients.
But on the server installation, there can be no such program and no DHCP. In such cases you can manually edit resolv.conf.

Resources